A USB hub will not function when it's connected more than 5 hubs away from the root port

65

9

I am trying to utilize my monitor's ability to switch video input and USB source (much like a KVM switch) with a USB hub. Previously I had all of the devices plugged directly into USB ports on the monitor. I could switch video input on the monitor to the Surface via its dock or the desktop (both machines are running Windows 10) and USB switched along with the video.

Since introducing the USB hub the Surface dock no longer works with USB, but the desktop does. If I bypass the dock and plug a USB cable directly into the Surface it too works. When connected through the Surface dock I receive the error:

Too many USB hubs are connected together. A USB hub will not function when it's connected more than 5 hubs away from the root port.

The desktop is a generic PC but since the Surface is having issues I've specifically called it out in the list of devices in my configuration:

If I read the error explicitly I can only count 4 USB hubs: Surface Book, Surface Dock, Monitor, and USB hub. To explain how I have things hooked up I've put together this diagram:

Diagram of configuration

Until this error I was under the impression that powered USB allowed for 127 devices to be daisy chained. Is this impression incorrect or is something wrong with my configuration?

Additional info based on responses:

My USB Hub chain as viewed with USB Tree Viewer when connected to my Surface Book via the Surface Dock:

USB Tree Viewer screenshot of Surface Dock hub connections

From this I definitely see that there are more than 5 hubs from the root port to the devices at the end. It seems that a "single layer" hub at the end would solve the issue. According to Ali Chen's comment "finding this information in marketing documents" would be unlikely.

ahsteele

Posted 2017-05-03T16:46:38.050

Reputation: 1 730

28Are you plugged into the front or the back of your computer? I'm asking this because some computers are built that the front USB ports are actually not primary ports, but rather "hubbed" from the back ports. – IronWilliamCash – 2017-05-03T16:59:11.700

@IronWilliamCash plugged into the back of the desktop. – ahsteele – 2017-05-03T17:03:08.600

1Is there a reason the monitor has to be in the mix? – LPChip – 2017-05-03T17:05:57.850

3@LPChip (I'm a team member of ahsteele's) the monitor acts as a KVM switch for us, by switching between video signals the USB travels alongside as well. This allows us to carry over keyboards, mice, and other USB peripherals between the surface and the desktop. – Robert H. Engelhardt – 2017-05-03T17:15:26.803

@rheone is there an actual KVM switch also? I don't see one in the graph above. – IronWilliamCash – 2017-05-03T18:12:03.150

1@IronWilliamCash, the monitor has a built in KVM, there is no KVM beyond that – Robert H. Engelhardt – 2017-05-03T18:15:09.213

1@rheone.... There is probably the last hub we are looking for. It probably connects to the USB hub inside the monitor. So the monitor probably counts as 2 hubs. – IronWilliamCash – 2017-05-03T18:16:21.673

14Use Device Manager. Menu->View->Devices By Connection. You can then see the hubs chained from each other. This will tell you whether there are hidden hubs where a single hub is really two internally, or hubs on the motherboard. – Ben – 2017-05-04T11:54:30.437

Note that your motherboard itself has the usb connection, which is chained to the port of your PC if you use the front-panel (that's already once chain more) – Mathijs Segers – 2017-05-05T10:35:38.880

Note that the USB standard doesn't promote stacking hubs like this. You open the door for all kinds of trouble by stacking them this far. – None – 2017-05-05T20:50:57.327

@Mast how far does it allow stacking? – Tim – 2017-05-07T11:23:33.447

@Tim Good question, I actually forgot the exact timing values. Basically, since everything goes by handshake, if the time takes too long, you won't match your timing spec anymore. Personally I get nervous at 3 hubs and further. Make your cables too long or introduce too many hubs and you'll miss the timing spec. You can find the 2.0 spec here, but feel free to make it a new question.

– None – 2017-05-07T15:52:53.367

@Tim, the topic of handshake delay is covered here, https://superuser.com/a/1105099/620011 There is no danger in "stacking" hubs, all certified USB 2.0 hubs are tested for 5-tier operability with 5-m cables, by USB-IF test specifications.

– Ale..chenski – 2017-05-08T06:26:44.187

Answers

54

When counting hubs, you assume that every individual box/device has only one hub. This assumption is likely untrue.

To begin, the 10-port "amazon hub" definitely has at least two hubs in chain, because single hubs are not manufactured with 10 ports, 7-port maximum [see this explanation].

Then the Dell monitor has also some special design - it has TWO UPSTREAM ports. What is its internal architecture, who knows.

The "surface dock" is also a suspect for having more than one USB hub in the chain. And I don't know if the "surface" uses extra internal hub for whatever reason.

To get the actual idea how many hubs are there in the chain and what/how all things are connected, use USBTreeView.exe on the Surface side. I am sure the Surface got the chain right, and you do have more than 5 hubs in the chain.

Addition: USB standard allows for 127 devices per one root controller, it doesn't mean that they are "daisy chained", just total of 127. In fact, if we discount hubs as functional USB devices, the total number of useful devices comes down to 102, since you would need 17 7-port hubs to accommodate the devices, in three-tier configuration, and each hub will take one address out of available space.

Ale..chenski

Posted 2017-05-03T16:46:38.050

Reputation: 9 749

1

Damn, beat me to it. :D Well, here’s some pictures to illustrate this: Device Manager, PCB.

– Daniel B – 2017-05-03T18:22:44.510

5I would guess that the 10-port "amazon hub" has three 4-port chips in a cascade 1->2. The first (upstream) has two ports connected to two other chips, and 2 ports are free. So you have 4+4+2 port hub. These to ports should still work. – Ale..chenski – 2017-05-03T18:28:52.023

@AliChen since we are guessing what do you the 7-port "amazon hub" would have in it? – ahsteele – 2017-05-05T05:52:24.687

1@ahsteele, there are single-chip 7-port USB 3.0/3.1 hubs, USB5807 for example. But I would guess that the "7-port amazon hub" has two 4-port ICs. The uppper level IC has 3 user-accessible ports, and one port is used to connect the second 4-port IC, making 3+4=7 downstream ports total. AFAIK, the same box also comes as 4-port design. I would guess that one PCB can accommodate all three options, 4, 7, and 10, with BOM change. But why are you asking? What Device Manager or USBTreeView show? You should have these results ready, do you? – Ale..chenski – 2017-05-05T06:17:23.987

@AliChen I will tomorrow. Sadly was unable to mess with this today as had some other stuff come up. Do plan on reporting back tomorrow with results from the USBTreeView. – ahsteele – 2017-05-05T06:21:31.357

@AliChen I added a screenshot of the USB Tree Viewer when connected to the Surface Book via the Surface Dock. I definitely count more than 5 hubs in the chain, but am curious if there is a different hub I can use to connect multiple devices at the end which won't have as many internal hubs. – ahsteele – 2017-05-05T16:52:21.200

1@ahsteele, yes, just as I guessed, the last hub (4-port IC from the 10-port anazon hub) has two ports to user connectors (should be usable), and the other two ports go to the next level of hubs (as I guessed, 2 x 4 port), which exceed the USB requirement. They are 6-th in the chain, and labelled with yellow marks. You need to get a "single layer" hub. Any 4-port hub should work just fine, or a seven-port but the one with a single hub controller IC. – Ale..chenski – 2017-05-05T17:54:57.900

1@AliChen is there any way to tell if a hub is a "single layer" hub? I.e. is there a marketing or tech spec I could look at before purchase? – ahsteele – 2017-05-05T17:56:37.037

2@ahsteele, I don't think you will find this information in marketing documents. One way is to get a sample and plug it into a host with USBTreeView, and look. The other way is to open the plastic up and take a look inside. Or maybe you can find a tear-up review of the device, but again, manufacturers can make substitutions in internal circuitry, so you never know. Sorry. Keep in mind that some keyboards may have a built-in hub, so they would fail to function even if you have the last hub correctly. – Ale..chenski – 2017-05-05T18:02:20.767

75

Your 10 port USB hub (and other devices) may actually contain multiple USB hubs in series internally.

USB hub - Wikipedia

USB hubs are often built into equipment such as computers, keyboards, monitors, or printers. When such a device has many USB ports, they all usually stem from one or two internal USB hubs rather than each port having independent USB circuitry.


As stated, the USB spec allows 127 devices to be connected through a single port. However, the USB spec only allows hubs five levels deep, or seven if including both the end device and the root device (the onboard controller itself).

A Technical Introduction to USB 2.0 - USB.org (PDF)

A newly attached hub will be assigned its unique address, and hubs may be cascaded up to five levels deep.

Interoperability Testing with USB Type C - USB.org (PDF)

"Contains devices behind 5 levels of nested hubs – the maximum allowed"

Steven

Posted 2017-05-03T16:46:38.050

Reputation: 24 804

That is terrible design. Why shouldn't we be allowed to chain as many hubs as we like? It seems pretty easy to hit that limit of 5, as OP's setup doesn't even appear to be that complicated. – JamEngulfer – 2017-05-05T00:46:10.213

9

Steven, you are confusing the number of "tiers" (connections) with the number of hubs. The number of hubs is limited due to timing constraint imposed on turn-around of ACK/NAK/whatever. It is stated in Section 4.1.1 of USB 2.0 Specifications. The response time must be limited in half-duplex network topology. For explanation of the reasoning behind this limit, see https://superuser.com/a/1105099/620011

– Ale..chenski – 2017-05-05T02:54:39.567

3@JamEngulfer, yes, the USB is not the best implementation of the network paradigm. But it wasn't supposed to cover wide area of devices, it was meant to be cheap. So the cost limitation has driven the solution to be half-duplex. As such, the protocol response can't be deferred, and time-out limit is short, dictating limitations on total turn-around time, with hub repeaters eating most of it. So here the limit comes. – Ale..chenski – 2017-05-05T03:03:23.907

It's really not so bad, 1 hub 4 devices, 2 hub levels (5 hubs but only in 2 levels) 16 devices, 3 hub levels (21 hubs) 64 devices, 4 hub levels (85 hubs) 256 devices, this is now more than what is imposed by other limits on USB (127 device limit). – ttbek – 2017-05-05T22:00:19.927

20

To add some experimental data to the other answers, your problem is specifically with Surface Book exactly because Surface Dock has two USB hubs. I, too, have a Surface Dock with a Surface Book and that's what I see in the Device Manager when I connect a mouse to the dock:

enter image description here

The highlighted hubs belong to the Surface Dock, I verified it by connecting the mouse directly to one of the ports in the Surface Base.

Thus you have:

  1. Surface Dock - 2 hubs
  2. Monitor - at least 1 hub
  3. 10-port USB Hub - at least 2 hubs, since, as mentioned in other answers, one hub can have maximum 7 ports

So at the very minimum you have 5 hubs. Probably the monitor has more than one hub, and that's why you are getting the error.

Spc_555

Posted 2017-05-03T16:46:38.050

Reputation: 331

The one hub that you're missing is the first hub that's built into the computer itself, the "root hub". – Agent_L – 2017-05-04T14:44:20.453

5@Agent_L the root hub doesn't count towards the 5 hub limit – Spc_555 – 2017-05-04T14:47:06.070

@VasilyAlexeev Unless you're using a panel on front, which sometimes actually does add one. Not always though – Mathijs Segers – 2017-05-05T10:36:33.360

4@MathijsSegers then, by definition, it's not a root hub, but a normal hub built in the computer case – Spc_555 – 2017-05-05T10:41:39.340