USB Topology
Bus topology is a connection model between the host and USB peripherals. The USB architecture has a well defined physical and logical bus topology, which is fully described in the USB specification.
USB Physical Bus Topology
The physical bus topology defines how USB devices are connected to the host. The following figure shows a USB host with several common peripherals connected as it is seen by the user.
|
Example of the USB topology from the user's point of view
|
USB host with host controller
2-port root hub integrated into the host controller
4-port hub integrated into the keyboard (part of the compound device)
USB keyboard (part of the compound device)
USB keypad (part of the compound device)
4-port hub (part of the 7-port hub)
4-port hub (part of the 7-port hub)
USB mouse
USB flash drive
4-port hub
4-port hub
USB bluetooth adapter
The following figure illustrates the same topology, but with the peripherals represented more explicitly.
|
Example of the USB topology from the host's point of view
|
The devices on the USB bus are physically connected to the host via a tiered, star topology which looks like a tree. The attachment points (also known as USB ports) for peripheral devices are provided by a special class of USB device known as a hub.
The hub communicates with the host the same way as any of the devices attached to the USB but plays the special role. The root hub provides one or more initial attachment points to the host. The additional attachment points provided by external hubs.
A root hub is integrated within the USB host controller. The host controller / root hub pair is always at the center of the star and considered the first tier or root node of the USB tree. Any other node in the tree is an external hub that is an intermediary between peripheral devices and the host computer.
An external hub has a single connection (an upstream port) to a higher level in the USB topology hierarchy, and numerous (typically 4 or 7) downstream ports for connecting peripheral devices and other hubs, enabling up to 127 devices to be connected by cascading multiple hubs.
The peripheral devices are always leafs in the USB tree and connected to the host through a chain of USB hubs. A modern host systems have multiple host controllers, so it's likely to find more than one USB tree on the computer.
Theoretically, the USB protocol allows up to 127 peripheral devices (including hubs) to be connected to a single host controller. The address field in a USB packet specifying which device the packet is designated for, is 7 bits long. So it allows the address values between 0 and 127. Address 0 is reserved for a device which has not yet had its address assigned. However, the practical number of devices is far smaller than the theoretical maximum. There is a high chance that the USB bus will run out of either bandwidth or power long before you get anywhere near 127 devices.
Using USBlyzer - Viewing the USB components and their relationships
The USB device tree panel provides a graphical view of the hierarchical relationships between the host and the USB devices.
USB Logical Bus Topology
The logical bus topology defines how the various components that make up the physical topology are viewed and communicated by the host software.
While devices are physically attached to the host in a tiered, star topology, the host communicates with each peripheral device as if it were directly connected to the root hub's port. Even though the activity between the host and peripheral devices use the logical perspective, the host is aware of the physical topology to support connection and disconnection on hubs with attached devices. When a hub is removed, all of the devices attached to the hub must be removed from the host's view of the logical topology.
|
Example of the USB logical topology
|
Client Software View
The client software communicates with the device as if it were directly connected to the host.
|