---
title: "Types of USB packets"
subject: "Instrumentation II"
chapter: 3
key: "semester_5/instrumentation_ii:usb-packet-types"
source: https://www.bctengineer.com/q/semester_5/instrumentation_ii/usb-packet-types
site: BCT Engineering
---

# Types of USB packets

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

- Asked in: 2073 Shrawan, 4 marks; 2073 Chaitra, 3 marks; 2072 Chaitra, 3 marks (asked 3 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-types
- Whole chapter: https://www.bctengineer.com/md/semester_5/instrumentation_ii/chapter-3

## Question

The fundamental elements of communication on the USB data bus is a packet. Discuss various types of packets used in USB protocol.

## Short answer

USB packets start with SYNC, PID and end with EOP. Four groups: token (OUT, IN, SETUP, SOF), data (DATA0/DATA1 with payload and CRC16), handshake (ACK, NAK, STALL, NYET) and special (PRE, ERR, SPLIT, PING). They control transactions between host and device.

## Answer

Data on the USB bus is sent as **packets**. Every packet begins with a SYNC field (8 bits, to synchronise the receiver clock), then a **PID** (Packet Identifier, 4 bits + its 4-bit complement) and ends with an EOP (end of packet). The PID defines the packet type. There are four groups.

#### 1. Token packets
Sent by the host to start a transaction. Format: SYNC, PID, address (7 bits), endpoint (4 bits), CRC5, EOP.
| Token | Meaning |
|---|---|
| OUT | Host will send data to the device |
| IN | Host requests data from the device |
| SETUP | Starts a control transfer (command to the device) |
| SOF | Start of Frame, sent every 1 ms (125 us in high speed) with an 11-bit frame number |

#### 2. Data packets
Carry the payload: SYNC, PID, data (0-1023 bytes; 8/64/512/1024 bytes by speed and transfer type), CRC16, EOP.
- **DATA0 and DATA1** alternate for data toggle synchronisation (error recovery); **DATA2, MDATA** are used in high speed.

#### 3. Handshake packets
Only a PID; report the status of a transaction.
- **ACK:** data received correctly.
- **NAK:** device cannot accept or has no data now; try later.
- **STALL:** endpoint halted or request not supported.
- **NYET:** data accepted but not ready for the next (high speed).

#### 4. Special packets
- **PRE:** preamble that enables low-speed traffic through a hub.
- **ERR:** error indication from a hub (split transaction).
- **SPLIT:** split transaction for high-speed hub to full/low speed device.
- **PING:** asks whether a high-speed endpoint can accept data.

```text
 IN transaction : Host -> [IN token]  Device -> [DATA0] Host -> [ACK]
 OUT transaction: Host -> [OUT token][DATA1]  Device -> [ACK]
```

## Check yourself

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

1. What does every USB packet begin with?
   A. PID
   B. CRC
   C. SYNC field
   D. Address
   Answer: C. Every packet begins with SYNC to synchronise the receiver clock, then PID. (Key point: Packet start)

2. Which of these is a token packet sent by the host to start a transaction?
   A. ACK
   B. DATA0
   C. SETUP
   D. NYET
   Answer: C. Tokens are OUT, IN, SETUP and SOF; ACK and NYET are handshakes, DATA0 is data. (Key point: Token packets)

3. What does NAK mean?
   A. Data received correctly
   B. Device cannot accept or has no data now; try later
   C. Endpoint halted
   D. Start of frame
   Answer: B. NAK = busy or no data; ACK is success and STALL is halted endpoint. (Key point: Handshake meaning)

4. What is the purpose of alternating DATA0/DATA1?
   A. Choose speed
   B. Data toggle synchronisation for error recovery
   C. Mark end of frame
   D. Carry the address
   Answer: B. Alternate PIDs let the receiver detect lost or repeated packets. (Key point: Data toggling)

## Related in Instrumentation II

- [USB host, hub, device and packets](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-host-hub-device-packets) — Instrumentation II, chapter 3
- [USB protocols and common packet fields](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-packet-fields) — Instrumentation II, chapter 3, asked 2×
- [USB On-The-Go (OTG) protocol](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-otg) — Instrumentation II, chapter 3, asked 3×
- [USB signals and bus states](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-signals-bus-states) — Instrumentation II, chapter 3
- [Basic data transfer mechanisms in USB](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-transfer-mechanisms) — Instrumentation II, chapter 3
- [USB standards and data transfer mechanisms](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Ausb-standards-transfer-mech) — Instrumentation II, chapter 3

## Related in other subjects

- [Communication protocol and OSI architecture](https://www.bctengineer.com/question.md?key=semester_8%2Ftelecommunications%3Aprotocol-osi-architecture) — Telecommunications, chapter 8
- [Communication protocol and its need](https://www.bctengineer.com/question.md?key=semester_8%2Ftelecommunications%3Acommunication-protocol-need) — Telecommunications, chapter 8, asked 3×
- [Performance balance and bus design elements](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aperf-balance-bus-design) — Computer Organization and Architecture, chapter 1, asked 2×
- [Bus admittance matrix and its elements](https://www.bctengineer.com/question.md?key=semester_5%2Fpower_system_analysis_ii%3Aybus-definition-elements) — Power System Analysis II, chapter 1
