USB-C Hubs and Ethernet (2020)
lucumr.pocoo.org
lucumr.pocoo.org
You can also do this with USB-A, get an USB-A controller that sends pause frames, plug it into a powered USB hub and connect to your computer. Unplug, watch the ethernet link still being online and suddenly the network dies. Mostly happens with Realtek USB Ethernet controllers.
This is a firmware feature so technically you can turn it off.
If you want to try it with PCI or PCIe: get a powered backplane or bifurcation board or thunderbolt-to-pci bridge. Connect/use as normal then disconnect the host while leaving power on. Same problem happens with controllers that send pause frames.
It turned out to be pause frames! The switches were too eager to propagate them, or something? The fix was to just disable them on all NICs - TCP can handle packet loss and rate control pretty well in those conditions anyway (gigabit switched ethernet).
(I can't take any credit for the work debugging and mitigating this issue.)
Anyway, it seems this is one of those bugs that pops back up from time to time... people try to implement this bit of the spec along with the rest, but don't realize how it's really supposed to behave under stress, and it's never tested under this kind of stress...
I have now heard that this problem happens with a lot of devices and the most common element in most of them is that people also have netgear switches on their network but not exclusively.
The most reliable workaround is to ensure that the USB-C adapter with an ethernet card in it is powered off when the laptop goes to sleep. Many do that if they are not also used for USB-C PD or whatever it's called.
The what now? I've never heard of "PAUSE" frames before, but those sound like a feature just waiting to be exploited.
Do we know how common the behaviour to forward the frames is? This sounds like it could bring down any vulnerable public network of their choice by just logging on and sending that special packet...
But vendors who make home switches often ignore standards.
1. https://en.wikipedia.org/wiki/Ethernet_flow_control#Pause_fr...
This malfunctioning behaviour doesn't seem that uncommon though. Here [1] is another story from 2016 with the same root cause.
I'd like to know how widespread that non-standard behaviour really is.
I could imagine that many small businesses, e.g. cafes, restaurants etc, use cheap consumer switches to manage their guest wifi. Those would seem to be vulnerable.
Another thing: Maybe this is nonsense, but couldn't you spoof PAUSE frames coming from another MAC address than your own, e.g. on wifi? If that's possible, you could disrupt service for selected other network participants even on well-functioning switches (provided you know the victim's MAC address).
[1] http://jeffq.com/blog/the-ethernet-pause-frame/
HN discussion: https://news.ycombinator.com/item?id=12339902
To troubleshoot, I’d plug into the hub to have Ethernet connectivity, and the network would seem to work fine. Took me weeks of guessing before considering that a powered-but-disconnected USB hub could be the culprit.
Odd that this is an issue across so many vendors. Perhaps they share a chip, but still, it reads as a mistake on the Hub as well as the Switch side of things.
Now I have Anker 3.1 Mini-Dock (without the ethernet), it works well but it has issues with HDMI. For whatever the reason, the system think that the HDMI is plugged in the hub whereas it is not. So, It cause a strange issue with multimonitor since the system believes that there is a second monitor plugged to it. But yet it couldn’t show the second monitor in the display setting but it insists that it is plugged.
I'm guessing a lot of the manufacturers just ended up using the same chip for their docks/hubs, and some manufacturers just don't care if there was a firmware update from the chip vendor.
TP-Link (or more specifically Atheros AR8327 used inside it) here is likely breaks a IEEE standard (may be even the most basic one - 801.2d), but when no-one send pause frames this goes unnoticed.
As workaround now don't connect power to the hub and instead connect charger to a laptop directly (if a hub is powered you can connect only one cable to s laptop to get both - power and external USB+Ethernet).
The one difference I see is that the docking stations are meant to be independently powered and I think it has its own fan. I’m sure the internals are different too, but I don’t know how. Curious if anyone knows more about the difference between the hardware/firmware on the hubs vs the stations.
I think the use of Display Port a plays a big factor. The Cables Matters and Dell docks only had dual HDMI and had far fewer issues.
five years ago I would have said five years
now I'd say 10
The problem is the 'feature' of some USB Ethernet controllers where they keep the ethernet link active when the host disconnects. As described in the article, it's the PAUSE frame that some switches forward to all devices on the network causing them to... pause sending data. The link stays up but nothing happens. Perhaps the idea was that you get a fast connection resume, but it's not like ethernet handshaking takes a lot of time so they might as well simply disconnect the ethernet link when the USB ethernet controller notices the host computer has disconnected.
This seems unlikely for the reasons you listed. Since USB is a polled bus and has shared bandwidth, implementing the flow control is likely very beneficial in case the bus can't temporarily handle the full Ethernet speed.
So, a USB-to-Ethernet gizmo just monitors its internal Ethernet-to-USB queue and if it starts to overflow, it attempts to flow control the switch. But, if no USB host is connected, no USB data requests ever arrive, the queue overflows and never gets cleared...
There may also be some WoL/USB remote wakeup stuff at play, which may be why these ICs do not drop the link on USB host disconnect by default. In fact, I wonder if messing with those settings on the host side could remediate the issue...
The weird thing is that there is a whole lot of cool stuff you can do with the on-chip firmware like mDNS proxy for offline devices, but it's all so hidden and vague that nobody bothers to do a whole lot about it.
Keeping to whatever the spec supports is nice, but if the world doesn't work that way you still get a broken product at the end of the day.
Instead of pause, it should (at least have the option to) disconnect. Ethernet link training isn't a computationally expensive and lengthy process anymore, at least not from the user's perspective. Between plugging it in and moving your hands to your input device L1 and L2 are up before you even get a chance to look at your display with L3 being available pretty quickly thereafter.