How Does USB Organize Tiered-Star Topologies?

The Universal Serial Bus (USB) protocol connects external peripherals to a host computer using a host-scheduled tiered-star topology. In this architecture, a single host controller manages all bus traffic, while hubs branch the connection into multiple tiers to support up to 127 devices. By centralizing scheduling and eliminating peer-to-peer bus contention, USB ensures predictable bandwidth allocation and plug-and-play device discovery.

The Tiered-Star Physical Architecture

A USB bus is structured as a tree of hubs and functions, with the host system at the top. The host contains a host controller and a root hub, which provides the initial physical ports. Each port on the root hub can connect either directly to a peripheral device (a function) or to an external USB hub, which in turn provides additional downstream ports.

The USB specification limits this hierarchy to a maximum of 7 tiers, where Tier 1 is the root hub and Tier 7 can only contain peripheral functions, not additional hubs. Because each device on a bus is assigned a 7-bit address, a single host controller can address up to \(2^7 - 1 = 127\) devices, with address 0 reserved for unconfigured devices during initial enumeration.

Host-Scheduled Communication

Unlike peer-to-peer buses where any device can initiate a transfer, USB is strictly host-centric. Peripherals cannot send data on their own; they must wait to be polled by the host controller. This design prevents collisions on the shared bus and keeps peripheral hardware simple and inexpensive.

Every USB transaction consists of up to three phases:

  • Token Packet: Sent by the host to specify the target device address, endpoint number, and transfer direction (IN for device-to-host, OUT for host-to-device).
  • Data Packet: Carries the actual payload from the sender.
  • Handshake Packet: Sent by the receiver to acknowledge successful receipt (ACK), indicate the device is busy (NAK), or report an error (STALL).

Frames, Microframes, and Transfer Types

To coordinate different types of peripherals, the host divides bus time into fixed intervals. In Low-Speed and Full-Speed USB, time is divided into \(1\text{ ms}\) frames. In High-Speed USB (USB 2.0), each frame is further subdivided into eight \(125\ \mu\text{s}\) microframes.

The host scheduler allocates bandwidth within each frame or microframe across four distinct transfer types:

  1. Control Transfers: Used for device configuration, status checks, and command delivery.
  2. Interrupt Transfers: Polled at guaranteed intervals for low-latency devices like keyboards and mice.
  3. Isochronous Transfers: Reserved for time-sensitive streaming data such as audio and video, offering guaranteed bandwidth without error-retry overhead.
  4. Bulk Transfers: Used for large, non-time-critical data like printer jobs or storage transfers, utilizing whatever bandwidth remains in the frame.

Device Enumeration and Endpoints

When a peripheral is plugged into a hub port, the hub detects the electrical change and notifies the host during its next poll. The host then resets the port, communicates with the device at default address 0, and assigns it a unique 7-bit address.

During this enumeration process, the host reads the device's descriptors to learn its capabilities, power requirements, and endpoints. An endpoint is a unidirectional buffer inside the peripheral, and a single device can expose multiple endpoints to handle different transfer types simultaneously. Once configured, the host integrates the device's endpoints into its ongoing frame schedule.