STRUCTURE, MODES, AND CABLES
USB is simple and flexible. It scales nicely, capable of running very basic devices, such as a keyboard, right up to demanding mass storage devices. It is all based around a single controller on the host machine. All communications are initiated by the host—devices cannot communicate directly with each other. Each device is assigned an address. The host controller sends packets of data, one bit at a time. Every connected device receives the data, but only the specified device responds, and only one device at a time can reply. Despite the huge number of devices you can connect at once, it essentially only talks to one at a time.
USB has four data transfer types, which help make it so flexible. Control transfer does the initial housekeeping and setup. Bulk transfer is for when it’s vital you get every bit, such as file transfers— here, bandwidth and latency may suffer. Interrupt transfers are for peripherals that require a quick response, such as a mouse—latency is prioritized here. It involves regularly spaced transfers set by the device, the host collecting one packet at a time. Isochronous transfer prioritizes bandwidth, and there may be data loss. This is used for real-time video, such as webcams or audio, where keeping going is more important than the odd dropped bit. When you plug in a device, it passes a USB class code to the host controller, and picks the appropriate data transfer mode and type.
The original USB 1.1 standard allowed for a 3m (9 feet, 10 inches) cable. The limit was down to the time allowed for a device’s response to a host request, as well as maintenance of signal integrity. USB 2.0 raised this to 5m (16 feet, 5 inches). SuperSpeed modes are more demanding. There is no specified maximum, but 3m is recommended. You can work around these limits by using powered hubs; each acts as a signal repeater, maintaining integrity and timing. As you can run five tiers from a host controller, you can reach 15m, if you really need it.