Protocol layer

Packet transmission

A packet consists of:

Addresses and Endpoints

Each device in the tree of connected devices is assigned a unique 7-bit address in the range 1 to 127 inclusive. Address zero is reserved for communicating with newly connected devices, before they are assigned their proper address by the root hub.

Each device can support multiple "pipes". Each pipe is a unidirectional communication path, which either sends data to, or receives data from, an endpoint on the device. Input and output endpoints are independently identified by a 4-bit endpoint number. A device must support the Default Control Pipe (using input endpoint zero and output endpoint zero).

Token packets

SOF (Start Of Frame) packet

The hub transmits a SOF packet every 1.0ms (±0.5µs).

SETUP packet

Only the hub may transmit a SETUP packet.

After a SETUP packet, the hub transmits a DATA0 packet, specifying the command. When sent to endpoint zero, the DATA0 packet is 8 bytes long, following a defined format. The device must respond with an ACK packet.

IN packet

Only the hub may transmit an IN packet.

After receiving an IN packet, the device should transmit a DATA0/DATA1 packet, to which the hub responds with an ACK. Alternatively, the device can transmit a NAK or STALL packet.

OUT packet

Only the hub may transmit an OUT packet.

After an OUT packet, the hub transmits a DATA0/DATA1 packet, to which the device responds with an ACK, NAK, or STALL packet.

Data packets

DATA0/DATA1 packets

When sending a sequence of data packets, the sender alternates DATA0 and DATA1 packets, so that a lost packet can be immediately detected.

Handshake packets

ACK (Acknowledge) packet

NAK (Negative Acknowledge) packet

STALL (Error) packet