Understanding USB 2.0 Transfer Mechanisms: Bulk, Control, Interrupt, and Isochronous Explained
This article breaks down USB 2.0's four transfer types—Bulk, Control, Interrupt, and Isochronous—detailing their packet structures, transaction stages, error handling, bandwidth limits, and priority rules with concrete examples and diagrams to help engineers design reliable USB devices.
The introduction explains that USB transfers move data between a host and a device and are built on packets and transactions. Four transfer types are covered: Bulk, Control, Interrupt, and Isochronous.
1. Bulk Transfer
Bulk Transfer provides reliable, low‑priority data movement for large, non‑time‑critical payloads such as printers or flash drives. It uses OUT and IN transactions, with low‑speed devices not supporting bulk, high‑speed bulk endpoints limited to 512‑byte packets, and full‑speed endpoints to 8, 16, 32, or 64 bytes. High‑speed bulk endpoints must support the PING operation to report endpoint status.
IN transaction flow : The host sends an IN token, the endpoint responds with a data packet, NAK, or STALL depending on its state. The host then acknowledges a successful packet with ACK or does nothing if the packet is corrupted.
OUT transaction flow : The host sends an OUT token followed by a data packet. The endpoint replies with ACK (success), NAK (buffer full, retry later), or STALL (permanent error). CRC or bit‑stuffing errors cause no handshake.
For large bulk transfers, the host alternates DATA0/DATA1 PIDs to synchronize data toggling. After three consecutive errors the host aborts the endpoint with a STALL.
2. Control Transfer
Control Transfer consists of three stages: Setup, optional Data, and Status. It is used for device configuration, descriptor retrieval, and initialization.
Setup stage : The host sends a SETUP token (PID = SETUP) with an 8‑byte request (e.g., Get Device Descriptor, wLength = 18). The device must ACK the request; corrupted packets are discarded.
Data stage : One or more IN or OUT transactions of the same direction carry the data, split into maximum‑size packets as needed (e.g., an 18‑byte descriptor is sent as 8 + 8 + 2 bytes). The host tracks the byte count and initiates subsequent transactions.
Status stage : Completes the control sequence with a handshake opposite to the data direction (IN if the data stage was OUT, and vice‑versa). High‑speed devices may include a PING handshake. ACK indicates success; NAK or STALL signals an error.
3. Interrupt Transfer
Interrupt Transfer moves small, periodic data (e.g., mouse or keyboard reports). It can be IN or OUT. The host polls the endpoint at a negotiated interval; the device may respond with a data packet, NAK (no data), or STALL (halted).
Maximum packet sizes are 1024 B (high‑speed), 64 B (full‑speed), and 8 B (low‑speed). High‑speed interrupt endpoints may use up to 80 % of a micro‑frame, while full/low‑speed may use up to 90 %.
4. Isochronous Transfer
Isochronous Transfer supports real‑time streams such as audio or video. It includes only Token and Data stages (no handshake), and all data packets use DATA0 PID. The transfer is unreliable—no error‑recovery—but guarantees timing.
Only high‑speed and full‑speed endpoints support it; high‑speed max packet size is 1024 B, full‑speed 1023 B. Bandwidth is reserved to avoid interference from other transfers. High‑speed high‑bandwidth endpoints can send up to three transactions per micro‑frame (up to 3072 B).
5. Transfer Priorities
Priorities from highest to lowest are: Isochronous, Bulk, Control, Interrupt. Higher‑priority transfers pre‑empt lower‑priority ones on the USB bus.
6. Summary
Understanding the characteristics, packet formats, transaction flows, and priority rules of the four USB 2.0 transfer types enables designers to select the appropriate mechanism for a given application and to implement reliable USB devices.
Linux Code Review Hub
A professional Linux technology community and learning platform covering the kernel, memory management, process management, file system and I/O, performance tuning, device drivers, virtualization, and cloud computing.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
