How does an usb to ethernet adapter work

1

How does such adapter work?

enter image description here

I am using this kind of adapter right now.

It came with a cd with an installable driver.

On windows XP I had to install the driver in order for it to work.

On Linux Mint 19 x64 it did not need the driver, it worked instantly.

DonJoe

Posted 2019-05-15T18:52:12.030

Reputation: 121

Question was closed 2019-05-16T06:45:10.663

The same way any other plug and play hardware works. If the OS has a driver readily available, it will use it right away. If the OS doesn't have the driver already stored, you have to get the correct driver to the OS in order for the OS to be able to recognize and use the hardware. – music2myear – 2019-05-15T18:57:08.530

It works like any other USB device. It identifies itself as a device, in this case, a network adapter and that adapter requires a driver in order to function on Windows. It worked on Linux without a driver since the generic driver was enough. This wasn't the case on Windows XP, which is dangerous to be used if you are connecting it to the internet. – Ramhound – 2019-05-15T18:58:06.457

Could you explain / show link which explains how the driver "tells" the computer that the adapter is like the actual device? – DonJoe – 2019-05-15T18:59:05.667

@Ramhound Don't worry about XP. I used it 8 years ago. Just now this question came up to my mind :D – DonJoe – 2019-05-15T19:00:00.490

@DonJoe: What "actual device"? The adapter is the actual device. – user1686 – 2019-05-15T19:00:11.963

@DonJoe - Are you asking us to explain .inf file to you? An .inf file tells Microsoft which driver to use based on the device identification. – Ramhound – 2019-05-15T19:02:15.407

@grawity I did not explain well. How does the driver tell the OS to interpret the data over USB as data over Ethernet? – DonJoe – 2019-05-15T19:02:53.313

@DonJoe: In broad terms... it works the same way as PCI/PCIe Ethernet card drivers do. – user1686 – 2019-05-15T19:04:24.100

Answers

1

How does such adapter work?

It is an active adapter – it contains a single "USB to Ethernet" chip which acts as a standard USB device on one end, and as a standard Ethernet controller on the other end; it receives Ethernet frames and sends them over USB in a format that the driver will understand, and vice versa. For example, ASIX AX88179 is a popular controller which works well with Linux. Realtek RTL8153 is another one.

Could you explain / show link which explains how the driver "tells" the computer that the adapter is like the actual device? […] How does the driver tell the OS to interpret the data over USB as data over Ethernet

The adapter by itself is the "actual device". It does not emulate anything; the way it works isn't actually different from "normal" PCI Ethernet adapters. Those, too, have an Ethernet controller chip that receives frames over the wire and sends them over PCI to the driver. The OS never gets any "direct" access to the Ethernet cabling.

In both cases, whether it's PCI-Ethernet or USB-Ethernet, it's the adapter's job to send/receive the actual frames, and it's driver's job to tell the OS that it will be providing a "network interface" (e.g. using register_netdev() on Linux) and to convert PCI/USB data to a format understood by the OS.

On windows XP I had to install the driver in order for it to work.

On Linux Mint 19 x64 it did not need the driver, it worked instantly.

The difference between Windows XP and Mint 19 is approximately 17 years. It is quite reasonable to expect that a new OS will automatically support more hardware than a 17-year-old OS.

However, the main difference is that Linux comes with drivers for most hardware that it supports, while Windows has to install most of them as separate packages (either from CD or from Windows Update, but the latter no longer exists for WinXP). For example, Linux has built-in drivers for several ASIX and Realtek "USB Ethernet" chips.

Also, there are a few standard protocols for Ethernet over USB – e.g. CDC-ECM/EEM, which is a standard USB specification, or RNDIS, which has been popularized by Microsoft and is also commonly used for Android USB tethering. It is quite possible that the chip inside your adapter talks one of these standard protocols which Linux already supports without a model-specific driver.

user1686

Posted 2019-05-15T18:52:12.030

Reputation: 283 655