1. Overview
2. Related Materials
3. USB Block Diagram
4. Understanding USB Concepts
4.1 USB Specification
4.2 USB Interface
4.3 USB Endpoint
4.4 USB Pipe
4.5 USB Data Transfer Types
4.6 USB Device Class
4.7 USB Descriptors
4.8 USB Communication Process
5. Summary
6. Discussion or Reflection
1. Overview
-
USB (Universal Serial Bus) is ‘universal’ in daily life, yet complex enough that even engineers may find it difficult to explain clearly. -
This article aims to explain the USB communication protocol in depth using a diagram, allowing readers to understand USB from a macro or logical perspective.
2. Related Materials
-
https://www.usb.org/document-library/usb-20-specification -
https://www.usbzh.com/
3. USB Block Diagram

4. Understanding USB Concepts
4.1 USB Specification
The USB specification is a standard document established by the USB Implementers Forum (USB-IF), defining various aspects of USB technology, including electrical characteristics, protocols, device classes, and data transfer types.
-
Main VersionsUSB 1.0/1.1: Low Speed (1.5 Mbps) and Full Speed (12 Mbps).
USB 2.0: High Speed (480 Mbps).
USB 3.0/3.1/3.2: Super Speed (5 Gbps, 10 Gbps, 20 Gbps).
USB4: Based on Thunderbolt 3, up to 40 Gbps.
-
ExamplesUSB 2.0 specification: defines the electrical characteristics, protocols, and device classes of USB 2.0.
USB 3.2 specification: defines the super speed transmission and dual-channel mode of USB 3.2.
4.2 USB Interface
The USB interface is a logical channel for communication between USB devices and hosts. A USB device can have multiple interfaces, each corresponding to a function.
-
Interface DescriptorInterface descriptor: describes the type, endpoints, and protocol of the interface.
-
Interface Class: defines the function of the interface, such as HID (Human Interface Device), CDC (Communications Device Class), Mass Storage, etc.
-
ExamplesHID interface: used for keyboards, mice, etc.
CDC interface: used for serial converters, modems, etc.
Mass Storage interface: used for USB drives, external hard drives, etc.
4.3 USB Endpoint
A USB endpoint is a data buffer on a USB device used to store data to be sent or received. Each endpoint has a unique address and direction (IN or OUT).
-
Endpoint TypesControl Endpoint (Endpoint 0): used for device enumeration and configuration.
Interrupt Endpoint: used for low-latency data transmission (such as HID devices).
Bulk Endpoint: used for large data transfers (such as Mass Storage devices).
Isochronous Endpoint: used for real-time data transmission (such as audio devices).
-
ExamplesKeyboard: uses an interrupt IN endpoint to send key data.
USB Drive: uses bulk IN and bulk OUT endpoints to transfer file data.
4.4 USB Pipe
A USB pipe is a logical channel between the host and device for data transmission. Each pipe corresponds to an endpoint.
-
Pipe TypesControl Pipe: used for control transfers.
Interrupt Pipe: used for interrupt transfers.
Bulk Pipe: used for bulk transfers.
Isochronous Pipe: used for isochronous transfers.
-
ExamplesControl Pipe: used for device enumeration and configuration.
Interrupt Pipe: used for data transmission from keyboards and mice.
Bulk Pipe: used for file transfers from USB drives.
4.5 USB Data Transfer Types
USB defines four types of data transfers, each corresponding to different application scenarios.
-
Transfer TypesControl Transfer: used for device enumeration, configuration, and control commands.
Interrupt Transfer: used for low-latency data transmission (such as HID devices).
Bulk Transfer: used for large data transfers (such as Mass Storage devices).
Isochronous Transfer: used for real-time data transmission (such as audio and video devices).
-
ExamplesControl Transfer: the host sends a request to get the device descriptor.
Interrupt Transfer: the keyboard sends key data.
Bulk Transfer: USB drive transfers file data.
Isochronous Transfer: the camera transmits video data.
4.6 USB Device Class
The USB device class defines the function and communication protocol of devices. Common device classes include:
-
Common Device ClassesHID (Human Interface Device): keyboards, mice, game controllers, etc.
CDC (Communications Device Class): serial converters, modems, etc.
Mass Storage: USB drives, external hard drives, etc.
Audio: headphones, microphones, etc.
Video: cameras, video capture cards, etc.
-
ExamplesHID device class: defines the communication protocol for keyboards and mice.
CDC device class: defines the communication protocol for serial converters.
Mass Storage device class: defines the file transfer protocol for USB drives.
4.7 USB Descriptors
USB descriptors are data structures that USB devices use to report their configuration and functionality to the host. Common descriptors include:
-
Common DescriptorsDevice Descriptor: describes the vendor ID, product ID, device class, etc.
Configuration Descriptor: describes the configuration information of the device.
Interface Descriptor: describes the type, endpoints, and protocol of the interface.
Endpoint Descriptor: describes the address, direction, and maximum packet length of the endpoint.
-
ExamplesDevice Descriptor: the device reports its vendor ID and product ID to the host.
Interface Descriptor: the device reports its interface type (such as HID interface) to the host.
Endpoint Descriptor: the device reports the address and direction of its endpoint to the host.
4.8 USB Communication Process
The following is the basic process of USB communication:
-
Device Connection: The device connects to the host, which detects the device and begins the enumeration process.
-
Device Enumeration: The host retrieves the device descriptors, configures the device, and assigns an address.
-
Data Transmission: The host and device transmit data through pipes.
-
Device Disconnection: The device disconnects from the host, and the host releases resources.
5. Summary
-
Understanding USB-related conceptsUSB Specification: defines the standards for USB technology.USB Interface: the logical channel for communication between devices and hosts.USB Endpoint: the data buffer on the device.USB Pipe: the logical channel between the host and device.USB Data Transfer Types: Control Transfer, Interrupt Transfer, Bulk Transfer, Isochronous Transfer.USB Device Class: defines the function and communication protocol of devices.USB Descriptors: data structures that report the device’s configuration and functionality to the host. -
USB is commonly encountered in daily life because it is ‘universal’, and the USB communication protocol sits between physical layer communication protocols (IIC, UART, SPI, etc.) and the OSI reference model (Ethernet).
6. Discussion or Reflection
-
What are the similarities and differences between USB and CAN protocols? -
Is HID more resistant to interference than CDC?