Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Course
  • Protocol Metrics Reference
  • Protocols Glossary
  • Reading Path
  • Protocol Fundamentals25
  • AMBA Family (APB / AHB / AXI)17
  • Coherence Fabrics (ACE / CHI)17
  • Memory Interfaces (DDR / LPDDR / HBM)17
  • PCIe & CXL17
  • Embedded Peripherals (I2C / SPI / UART)17
  • High-Speed I/O (USB / Ethernet / MIPI)17
    • USB Link & Packet Model
      • USB Link & Packet Model: Concepts
      • USB Link & Packet Model: Integration
      • USB Link & Packet Model: Debug
      • USB Link & Packet Model: Interview
    • Ethernet MAC / PHY Basics
    • MIPI CSI / DSI Overview
    • High-Speed I/O Debug
    • High-Speed I/O (USB / Ethernet / MIPI): Tricky Q&A
  • Protocol Verification & Compliance21
  • Protocols Interview Prep5
  • Interface Protocols Cheatsheet
Loading lesson

←USB Link & Packet Model
  1. Topics
  2. Bus Protocols
  3. High-Speed I/O (USB / Ethernet / MIPI)
  4. USB Link & Packet Model
  5. USB Link & Packet Model: Concepts
On this page

    Interface ProtocolsAll levels

    USB Link & Packet Model: Concepts

    Concepts for USB Link & Packet Model.

    Core concepts

    USB 2.0: bits on the wire are not payload bytes

    In USB 2.0’s NRZI encoding, a zero causes a state transition and a one keeps the state. Bit stuffing inserts a zero after six consecutive ones in the applicable packet bit stream so the receiver has transitions for clock recovery. The receiver removes stuffed bits before interpreting the recovered data. Packet framing, synchronisation and end-of-packet rules are separate.

    This isolated example starts the stuffing run count at zero and considers only six data ones followed by a data zero. It is not a whole packet or an electrical waveform. A full-speed signalling rate is 12 Mb/s and high-speed is 480 Mb/s; token, handshake, framing, stuffing and scheduling mean neither equals application payload throughput.

    USB 2.0: bits on the wire are not payload bytes — worked trace

    Illustrative isolated example; not measured silicon behaviour.

    Input / processing

    Result

    Interpretation

    Six consecutive input ones

    111111

    Six data bits with no NRZI transition

    Insert stuffed zero

    1111110

    One additional transmitted bit creates a transition

    Then transmit the input zero

    11111100

    Two zeros have different roles: stuffed then real

    Receiver removes only stuffed zero

    1111110

    Original seven data bits recovered

    Check yourself May the receiver remove both adjacent zeros in this example because they look redundant?

    No. Only the zero inserted after the six-one run is removed. The following zero is original data; removing it corrupts the payload.

    USB topology and enumeration

    Scope: Universal Serial Bus Specification Revision 2.0, conventional full-speed/high-speed transfers. The host schedules transactions; devices attach to root or hub ports. Enumeration includes address assignment, descriptor reads and selecting a configuration. This survey does not describe USB 3.x packet/link state machines or every USB 2.0 hub split-transaction rule.

    An endpoint is a device-side source or sink associated with a host pipe. Control supports setup/management, bulk provides error-recovered data delivery without reserved bandwidth, interrupt provides scheduled service, and isochronous prioritises bounded-time service without transaction retry. Packet-size and service-interval meanings depend on speed and transfer type; a bulk endpoint does not have a universal polling interval.

    The host addresses a configured device endpoint. USB 2.0 topology/selection view, not a payload timing trace. The final box lists endpoint choices, not broadcast destinations. EP1/EP2 assignments are illustrative descriptor choices, not mandatory numbers.
    USB 2.0 topology/selection view, not a payload timing trace. The final box lists endpoint choices, not broadcast destinations. EP1/EP2 assignments are illustrative descriptor choices, not mandatory numbers.

    What to notice

    • The host directs the transaction even when an IN payload travels from device to host.

    • Descriptor endpoint number, direction and type must agree with controller/firmware configuration.

    Check yourself If firmware queues data on EP2 while the host requests the advertised bulk-IN EP1, does successful EP0 enumeration prove that payload reaches the right pipe?

    No. EP0 control and the selected data endpoint are distinct choices. Enumeration success does not match firmware's data queue to EP1.

    USB 2.0 full-speed bulk IN: not ready, then data

    Illustrative configured device address 1, IN endpoint 1, maximum packet size 8 bytes. A host transfer requests 16 bytes, the initial expected data PID is DATA0, no reset/clear-halt/error intervenes, and both successful packets contain eight bytes. Scheduling gaps are unspecified; no hub split transactions appear.

    Transaction

    Host sends

    Device responds

    Host result

    First attempt

    IN token for address 1 / endpoint 1

    NAK: data not ready

    No data accepted, no ACK packet; DATA0 remains expected.

    Later attempt

    IN for the same endpoint

    DATA0 with bytes 0–7

    Accept valid packet and send ACK; next expected PID becomes DATA1.

    Following attempt

    IN for the same endpoint

    DATA1 with bytes 8–15

    Accept valid packet and send ACK; requested 16 bytes are satisfied.

    What to notice

    • NAK is temporary flow-control information for this bulk transaction, not evidence of a damaged cable or an endpoint halt.

    • An IN transaction is host-directed even though its data payload travels from device to host.

    Check yourself Does the first NAK consume eight bytes of the requested transfer or advance its data toggle?

    No. No data was accepted, so the host still needs all 16 bytes and still expects DATA0. The two later successful eight-byte packets satisfy this request. This is not an isochronous retry model.

    Link states and packets

    For USB 2.0 control, bulk and interrupt transfers, transactions use token, optional data and applicable handshake packets. Isochronous transfers do not use a transaction-level retry handshake. NAK can report temporary inability on applicable transfers; STALL reports a halted or unsupported endpoint condition whose recovery depends on the transfer and host-stack contract.

    USB 3.x has revision-specific link training, link states and packet mechanisms rather than reusing the USB 2.0 transaction model. Treat PCIe LTSSM only as a layering analogy, not as the USB state machine, and name the USB revision when discussing recovery or streams.

    For USB 2.0 timing, full-speed SOF packets mark 1 ms frames; high-speed SOF packets mark 125 µs microframes, eight per millisecond. At high speed, a 1 ms interval therefore spans eight microframes, not one. This is the scheduling timebase, not a promise that every endpoint transfers in every microframe: service depends on transfer type, endpoint configuration and the host schedule.

    • SOF (Start of Frame): 1 ms at full speed, 125 µs per microframe at high speed; keep speed and endpoint service interval distinct.

    • Packet-size limits depend on both speed and transfer type; do not apply a bulk-endpoint table to interrupt or isochronous endpoints.

    • ZLP (zero-length packet) marks end of some transfers.

    Apply the mechanism

    Continue to the integration exercise

    Then trace a failure

    Previous

    115 / 158

    Next: USB Link & Packet Model: Integration

    Up next

    Up nextUSB Link & Packet Model: Integration

    Sign in to save progress

    Practice this lessonPrevious lessonReport an error

    See also

    • USB Link & Packet Model: Debug
    • USB Link & Packet Model: Interview