- 2074 Chaitra · 5 marks
USB host, hub, device and packets
Short answer
The USB host controls the bus, enumerates devices, and initiates transfers via tokens. A hub expands ports and repeats signals. A device is a slave that responds with descriptors and data. Packets are token (OUT, IN, SETUP, SOF), data (DATA0/1), handshake (ACK, NAK, STALL), and special types.
Explain the functions of USB Host, USB Hub and USB Device. Discuss different packets used in USB protocol.
USB Host
The host is the USB master. There is only one host per bus (the PC) with a host controller and root hub. Functions: detects attachment and removal, enumerates devices (assigns addresses), controls all transfers by sending tokens, manages bandwidth, supplies power, sends SOF every 1 ms, and performs error checking.
USB Hub
A hub expands the number of ports (star topology, up to 7 tiers, 127 devices). Functions: detects connect/disconnect on its downstream ports, reports status to the host, repeats signals upstream and downstream, supplies power (self- or bus-powered), isolates low-speed devices, and handles reset and suspend/resume.
USB Device
A function (keyboard, flash drive, printer) or hub that responds to the host. Functions: answers to the assigned address, supplies descriptors (device, configuration, interface, endpoint), sends or receives data via endpoints (endpoint 0 is control), supports suspend/resume. Devices are slaves and cannot start a transfer.
Packets used
| Group | Packets | Purpose |
|---|---|---|
| Token | OUT, IN, SETUP, SOF | Start a transaction, give address and endpoint |
| Data | DATA0, DATA1 (DATA2, MDATA) | Carry the payload |
| Handshake | ACK, NAK, STALL, NYET | Report status |
| Special | PRE, ERR, SPLIT, PING | Hub and high-speed control |
A transaction is: token (host) -> data (host or device) -> handshake (receiver). Every packet has SYNC, PID and EOP; token and data packets also carry their fields (address and endpoint, or data) and a CRC. Example IN transaction: the host sends an IN token, the device sends DATA0 and the host replies ACK; if the device has no data it replies NAK.
✓ Answer checked by Claude Sonnet 5.5
Related questions
- USB interface chips: device vs host · Instrumentation II, chapter 3
- USB enumeration; device vs host interface chips · Instrumentation II, chapter 3
- Types of USB packets · Instrumentation II, chapter 3 · asked 3×
- USB 1.1 vs 2.0 and device identification · Instrumentation II, chapter 3
- USB On-The-Go (OTG) protocol · Instrumentation II, chapter 3 · asked 3×
- I/O functions used with data files · Computer Programming, chapter 10 · asked 2×