---
title: "USB host, hub, device and packets"
subject: "Instrumentation II"
chapter: 3
key: "semester_5/instrumentation_ii:usb-host-hub-device-packets"
source: https://www.bctengineer.com/q/semester_5/instrumentation_ii/usb-host-hub-device-packets
site: BCT Engineering
---

# USB host, hub, device and packets

Instrumentation II · Chapter 3: Serial Interfacing With Microprocessor Based System

- Asked in: 2074 Chaitra, 5 marks
- Video: [USB Protocol Explained: Basics, Versions, Connectors, Working, Signals, and Objectives](https://www.youtube.com/watch?v=6knlPjpa_DE) — Engineering Funda
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/instrumentation_ii/usb-host-hub-device-packets
- Whole chapter: https://www.bctengineer.com/md/semester_5/instrumentation_ii/chapter-3

## Question

Explain the functions of USB Host, USB Hub and USB Device. Discuss different packets used in USB protocol.

## 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.

## Answer

#### 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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How many hosts per USB bus, and what does the host do?
   A. Many; devices start transfers
   B. One; it controls all transfers by sending tokens
   C. None
   D. Two
   Answer: B. Only one host per bus is the master that controls all transfers. (Key point: Host)

2. What is a hub's role?
   A. Expands ports, detects connect/disconnect and repeats signals
   B. Starts transfers
   C. Holds the address 0
   D. Generates SOF
   Answer: A. Hubs expand ports, detect attach/detach, report status and repeat signals. (Key point: Hub)

3. What can a USB device NOT do?
   A. Provide descriptors
   B. Start a transfer by itself
   C. Respond to its address
   D. Use endpoint 0
   Answer: B. Devices are slaves and cannot start a transfer. (Key point: Device)

4. What is the order of a transaction?
   A. Handshake, token, data
   B. Token, data, handshake
   C. Data, token, handshake
   D. Token, handshake only
   Answer: B. Token from host, then data, then handshake from the receiver. (Key point: Transaction)

## Related in Instrumentation II

- [USB interface chips: device vs host](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-interface-chips) — Instrumentation II, chapter 3
- [USB enumeration; device vs host interface chips](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-enumeration) — Instrumentation II, chapter 3
- [Types of USB packets](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-packet-types) — Instrumentation II, chapter 3, asked 3×
- [USB 1.1 vs 2.0 and device identification](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb11-vs-usb20-identify) — Instrumentation II, chapter 3
- [USB On-The-Go (OTG) protocol](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-otg) — Instrumentation II, chapter 3, asked 3×

## Related in other subjects

- [I/O functions used with data files](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Afile-io-functions) — Computer Programming, chapter 10, asked 2×
