Author Topic: How to determine if Ethernet over USB is being used...  (Read 16170 times)

st2000

  • Member
  • ***
  • Posts: 44
How to determine if Ethernet over USB is being used...
« on: November 12, 2014, 01:44:49 pm »
Hi,

I have a USB Device which communicates to a Win PC box using a physical USB connection.  The device comes with its own proprietary Win USB driver.

I have a Frontline USB protocol analyzer (that I have never used).  What I would like to know...  Is there an easy way to identify if the USB Device I have is actually inserting Ethernet over USB?

-thanks

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How to determine if Ethernet over USB is being used...
« Reply #1 on: November 12, 2014, 02:43:28 pm »
If it's using Microsoft's WinUSB driver, it's not using an Ethernet driver. In Device Manager, find the device and see what driver it's using.

st2000

  • Member
  • ***
  • Posts: 44
Re: How to determine if Ethernet over USB is being used...
« Reply #2 on: November 12, 2014, 05:10:20 pm »
When the USB Device is plugged into the computer, the computer does not know what driver to load.  So I installed a driver (i.e. put it in a place where Windows can find it).  The next time I plugged in the USB Device, Windows installed the driver.  Now in the Device Manager window a "Network Adapters" device shows up when our USB Device is plugged in.  Also, I can run WireShark and point it at the newly created network and it will decode Ethernet packets.

So, I can say that we are dealing with Ethernet over USB.

Questions:

1. Is Ethernet over USB a well defined (ubiquitous) protocol?

2. If yes, why is there not a generic USB driver for Ethernet over USB such as there are generic USB drivers for HID mice and keyboards.

3. This USB Device has Vendor&Product IDs identifying it as a Cypress USB chip.  What identifies it as a something that will have Ethernet over USB?

-thanks
 

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: How to determine if Ethernet over USB is being used...
« Reply #3 on: November 12, 2014, 06:31:52 pm »
There is a well defined Ethernet over USB protocol, its part of CDC. Its not ubiquitous, in that its not widely used. That's may be why you don't have an inbox driver for it, or it may not be a CDC standard device.

You need to look at the device and/or interface class. A CDC device should have CDC device class (2), and/or CDC interface class (which is also 2). An Ethernet Control Model (ECM) CDC device has a subclass of 6. That's defined in the ECM spec.

You can find all the class specs at the USB-if: http://www.usb.org/developers/docs/devclass_docs/

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How to determine if Ethernet over USB is being used...
« Reply #4 on: November 12, 2014, 09:16:22 pm »
CDC has a bunch of ways to support networking:

bInterfaceSubClass 0x0C
Ethernet emulation model (EEM) devices exchange Ethernet-framed data. EEM isn’t intended for devices that use routing or Internet connectivity.

bInterfaceSubClass 0x06
Ethernet control model (ECM) devices, which include cable modems, exchange Ethernet-framed data.

bInterfaceSubClass 0x0D
Network control model (NCM) devices build on ECM with improvements that support higher data rates. NCM devices can transfer multiple Ethernet frames in a single bulk transfer.

bInterfaceSubClass 0x0E
Mobile broadband interface model (MBIM) devices extend NCM with support for more efficient transfers. Instead of Ethernet frames, MBIM devices transfer raw IP packets. The model is intended for mobile broadband networking devices. With alternate interface settings, a device can support both NCM and MBIM.

bInterfaceSubClass 0x02
bInterfaceProtocol = 0xFF, Remote NDIS, Microsoft-defined

Windows provides drivers for remote NDIS and WMC. Windows 8 added an MBIM driver.


st2000

  • Member
  • ***
  • Posts: 44
Re: How to determine if Ethernet over USB is being used...
« Reply #5 on: November 14, 2014, 12:13:34 pm »
Thanks Barry & Jan.  All excellent information.

Here is what I found.   The USB Device box I would like to emulate reports USB Class: ff and USB Subclass ff.  Obviously this was left undefined.  I'm not sure how one goes about confusing Windows into doing nothing (not loading a default USB driver) - but this appears to be a good first step.  The Product&Vendor ID simply point to a Cypress chip/part.  It's worth noting that I had to install a vendor supplied USB driver to get everything working.  At that point a new network showed up on the Windows box and our software happily connected to it.

What I want to do is swap out the above USB Device box with a Freescale based board using the Freescale CDC example where limited support allows Ethernet over USB to travel from the USB port to the RJ45 port (the other direction was not implemented (someone went to lunch early!)).  I have loaded up the Freescale CDC example and am happy to confirm what the two of you indicate in your posts.  That the USB Class is indeed 02 and the USB SubClass is 02.

Going on.  It is my hope that I can eventually use "a Windows (freely available??) generic CDC Ethernet-over-USB driver" in place of the above mentioned (probably) proprietary Ethernet-over-USB driver.  And to do so w/o having to change our software running on the Windows box which expects to see an Ethernet network.

Next step.  So, when I plugged in the USB port of the Freescale based board running the Freescale CDC example to my computer I didn't see a new network.  I'm not ruling out (my) pilot-error.  But I am left wondering if this really is a plug-n-play.  I'm running a Windows 7 computer.  And I expected it to already have a USB device driver that would automatically get loaded in and create a new network.  What might I have missed?  Is there a Microsoft CDC USB Support package that I need to download and install?

-thanks
« Last Edit: November 14, 2014, 12:22:45 pm by st2000 »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How to determine if Ethernet over USB is being used...
« Reply #6 on: November 14, 2014, 12:25:52 pm »
What does Device Manager show? Did the device install and if so, what driver is it using?

If it didn't install, take a look at the setupapilog file:

http://msdn.microsoft.com/en-us/library/windows/hardware/ff550900%28v=vs.85%29.aspx

As for the Cypress part, for vendor-defined devices, Windows uses the Vendor ID and Product ID to find an INF file that identifies the driver to load.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: How to determine if Ethernet over USB is being used...
« Reply #7 on: November 14, 2014, 04:17:29 pm »
Class/Subclass 0xff isn't there to confuse Windows, its declaring them to be vendor specific, i.e. not to any published spec.

If its a Cypress part it may even be unprogrammed, and the driver that loads for it programs it only to reattach as a driver the OS can deal with. What it shows up as once its working as an Ethernet device would be interesting to know.

Tsuneo

  • Frequent Contributor
  • ****
  • Posts: 145
Re: How to determine if Ethernet over USB is being used...
« Reply #8 on: November 17, 2014, 07:38:38 am »
Quote
st2000

But I am left wondering if this really is a plug-n-play.  I'm running a Windows 7 computer.  And I expected it to already have a USB device driver that would automatically get loaded in and create a new network.  What might I have missed?  Is there a Microsoft CDC USB Support package that I need to download and install?

As you need a plug-and-play USB-Ethernet dongle for Windows, you have to implement RNDIS (Remote NDIS) instead of CDC-ACM.

What is the MCU on the "Freescale based board"?

Anyway, I believe Freescale doesn’t distribute free RNDIS example for any MCU.
You may buy a middleWare for RTOS (eCos / MQX),
or you may implement RNDIS over the CDC-ACM source code.
The difficulty of implementation is, HID < RNDIS < MSC

Tsuneo

st2000

  • Member
  • ***
  • Posts: 44
Re: How to determine if Ethernet over USB is being used...
« Reply #9 on: November 18, 2014, 12:39:16 pm »
Thanks everyone for your help.

To be clear, I have been talking about 2 USB Devices.  A USB to BACnet interface Device that had a USB Class of 0xff & SubClass of 0xff.  And a Freescale K70 Tower kit (ARM processor & Serial board) that has a USB Class of 0x02 & SubClass of 0x02.

I'm going to talk about the USB to BACnet interface Device now:

This device uses a custom driver and when installed appears under (WinXP) DeviceManager->NetworkAdapters as a NetworkAdapter.  The only hit it is a Ethernet over USB connection is from it's Location text description: "Location 0 (MS/TP USB to RS-485 Converter".  Under (WinXP) MyComputer->MyNetworkPlaces->ViewNetworkConnections I see 2 local area connections.  The 10/100BaseT connection and the new network connection through the Ethernet over USB device.

I'm going to talk about the FReescale K70 Tower kit now:

I still need to "clear the air" with regards to USB jumper settings on the Freescale board (Host, Device, OTG, power, ect).  But have managed to get it recognized by a Windows7 box to the point where the Windows7 box has installed drivers and a new network as appeared in the (Win7) ControlPanel->NetworkandInternet->NetworkConnections menu.  In this menu the description for this network (title) is: "Freescale USB RNDIS".  So [Tsuneo], I'm not sure how to address you comment: "... you have to implement RNDIS instead of CDC-ACM ... Freescale doesn't distribute free RNDIS example(s) ...". 

My next steps are to resolve my confusion with respect to the Freescale USB jumpers as well as check on (possibly) newer or more complete Freescale examples of Ethernet over USB.  I do have an end-goal in mind.  But my next intermediate-goal is to communicate through (test) the Ethernet over USB connection.

-thanks everyone