---
title: "USB protocols and common packet fields"
subject: "Instrumentation II"
chapter: 3
key: "semester_5/instrumentation_ii:usb-packet-fields"
source: https://www.bctengineer.com/q/semester_5/instrumentation_ii/usb-packet-fields
site: BCT Engineering
---

# USB protocols and common packet fields

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

- Asked in: 2078 Bhadra, 6 marks; 2076 Asoj, 1+3 marks (asked 2 times)
- 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-packet-fields
- Whole chapter: https://www.bctengineer.com/md/semester_5/instrumentation_ii/chapter-3

## Question

Describe different types of USB protocols along with the common USB packet fields.

## Short answer

USB defines four transfer protocols: control for configuration, bulk for large data, interrupt for periodic polling, and isochronous for real-time streaming. Common packet fields across token, data, and handshake packets include SYNC, PID, device/endpoint address, data, and CRC for error checking.

## Answer

USB is a host-controlled serial bus. All communication is by **transactions**, built from **packets**. The "protocols" of USB are the four transfer protocols (control, bulk, interrupt, isochronous) together with the token-data-handshake packet protocol.

#### Types of USB protocols (transfer types)
1. **Control transfer:** configuration and commands (enumeration, SET_ADDRESS). Setup stage, optional data stage, status stage; error-checked.
2. **Bulk transfer:** large, non-time-critical data (printer, storage); error-checked with retry, uses spare bandwidth.
3. **Interrupt transfer:** small data with guaranteed polling interval (keyboard, mouse); host polls the device.
4. **Isochronous transfer:** real-time streaming (audio, video) with guaranteed bandwidth but no retry and no handshake.

#### Packet types
| 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 |

#### Common packet fields
```text
 | SYNC | PID | ADDR | ENDP | CRC5 | EOP |   token packet
 | SYNC | PID |       DATA        | CRC16 | EOP |   data packet
 | SYNC | PID | EOP |                              handshake packet
```
- **SYNC:** 8 bits (KJKJKJKK in full speed) to synchronise the receiver clock.
- **PID (Packet identifier):** 4-bit type plus its 4-bit complement for error checking.
- **ADDR:** 7-bit device address (up to 127 devices).
- **ENDP:** 4-bit endpoint number (up to 16).
- **Frame number:** 11 bits in SOF packets.
- **DATA:** 0 to 1023 bytes (8/64/512 by speed and type).
- **CRC:** CRC5 protects token fields; CRC16 protects the data field.
- **EOP:** end of packet, two bit times of SE0 followed by J state.
Bits are sent least significant bit first, NRZI coded with bit stuffing (a 0 inserted after six consecutive 1s).

## Check yourself

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

1. Which transfer type suits audio/video streaming with no retry?
   A. Control
   B. Bulk
   C. Interrupt
   D. Isochronous
   Answer: D. Isochronous gives guaranteed bandwidth but no retry or handshake. (Key point: Transfer for streaming)

2. Which transfer type is used by a keyboard/mouse?
   A. Interrupt
   B. Bulk
   C. Isochronous
   D. Control only
   Answer: A. Interrupt transfer has a guaranteed polling interval for small data. (Key point: Keyboard transfer)

3. What is the PID field?
   A. 8-bit sync
   B. 4-bit type plus its 4-bit complement for error checking
   C. 7-bit address
   D. 11-bit frame number
   Answer: B. The PID is 4 bits of type with 4 complement bits. (Key point: PID field)

4. What do CRC5 and CRC16 protect?
   A. CRC5 token fields, CRC16 data field
   B. CRC5 data, CRC16 token
   C. Both SYNC
   D. Both PID
   Answer: A. Token packets use CRC5; data packets use CRC16. (Key point: CRC use)

## Related in Instrumentation II

- [USB protocols followed in USB design](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-design-protocols) — 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×

## Related in other subjects

- [Instruction fields and address formats for X=(E+F)*(G+H)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Acode-fields-e-f-g-h) — Computer Organization and Architecture, chapter 2
