Each USB device provides information about itself through a set of standard descriptors.

The host reads these descriptors during enumeration to determine:


1. Device Descriptor

Contains general information about the device. Every USB device has exactly one Device Descriptor.

Field Size Description
bLength 1 Size of this descriptor (18 bytes)
bDescriptorType 1 Descriptor type = 0x01
bcdUSB 2 USB specification version (e.g., 0x0200 for USB 2.0)
bDeviceClass 1 Class code (or 0x00 if defined per-interface)
bDeviceSubClass 1 Subclass code
bDeviceProtocol 1 Protocol code
bMaxPacketSize0 1 Max packet size for endpoint 0 (8, 16, 32, or 64)
idVendor 2 Vendor ID (VID) — assigned by USB-IF
idProduct 2 Product ID (PID) — assigned by manufacturer
bcdDevice 2 Device release number
iManufacturer 1 Index of manufacturer string descriptor
iProduct 1 Index of product string descriptor
iSerialNumber 1 Index of serial number string descriptor
bNumConfigurations 1 Number of supported configurations

2. Configuration Descriptor

Describes a specific operating configuration.

Field Size Description
bLength 1 Size of this descriptor (9 bytes)
bDescriptorType 1 Descriptor type = 0x02
wTotalLength 2 Total length of all returned data (including interface and endpoint descriptors)
bNumInterfaces 1 Number of interfaces in this configuration
bConfigurationValue 1 Value used by SET_CONFIGURATION to select this config
bmAttributes 1 Self-powered, remote wakeup flags
bMaxPower 1 Maximum current draw (in 2 mA units)

A device may support multiple configurations, but only one is active at a time.


3. Interface Descriptor

Defines a functional component within a configuration.

Includes:

Example

A USB printer may have one interface responsible for printing.
A USB headset may have separate interfaces for Audio Streaming and HID control buttons.

Note

A single configuration can contain multiple interfaces, which is how composite devices expose multiple functions.


4. Endpoint Descriptor

Describes how to access a specific endpoint.

Field Size Description
bLength 1 Size of this descriptor (7 bytes)
bDescriptorType 1 Descriptor type = 0x05
bEndpointAddress 1 Endpoint number + direction (bit 7: 0=OUT, 1=IN)
bmAttributes 1 Transfer type (Control, Bulk, Interrupt, Isochronous)
wMaxPacketSize 2 Maximum packet size for this endpoint
bInterval 1 Polling interval (for Interrupt and Isochronous endpoints)

5. String Descriptor (Optional)

Provides human-readable Unicode strings such as:

Example

String descriptors are referenced by index from other descriptors (e.g., iManufacturer, iProduct). Index 0 requests a list of supported Language IDs.


6. Class-Specific Descriptors

Some device classes require additional descriptors beyond the standard set.

Examples

Class Descriptor Key Contents
Hub Hub Descriptor Number of ports, power switching, over-current protection
HID HID Descriptor Report descriptor length, HID specification version
Audio Audio Streaming Interface Descriptor Format type, sample rate, bit depth

7. SuperSpeed Endpoint Companion Descriptor (USB 3.0)

Added in USB 3.0, this descriptor accompanies each Endpoint Descriptor for SuperSpeed devices.

Field Description
bMaxBurst Maximum number of packets the endpoint can send/receive in a burst (0–15)
bmAttributes For bulk: max streams; for isochronous: mult value
wBytesPerInterval Total bytes transferable per service interval (isochronous/interrupt)

See also: Data Bursting and Bulk Streaming


Descriptor Hierarchy

Device Descriptor
└── Configuration Descriptor(s)
    └── Interface Descriptor(s)
        ├── Class-Specific Descriptor(s)  [if applicable]
        └── Endpoint Descriptor(s)
            └── SS Endpoint Companion Descriptor  [USB 3.0 only]