The Ping Protocol was introduced in USB 2.0 for high-speed OUT transactions to reduce wasted bandwidth. It is only defined for high-speed devices.

Applies to:


Problem: Wasted Bandwidth

During an OUT transaction, the host sends an OUT token packet followed by the data packet. If the target endpoint buffer cannot accept the data, the data must be discarded and the transaction must be retried.

Low- and full-speed USB Bulk and Control OUT transactions suffer a bandwidth penalty when a NAK handshake is returned, because the data sent from the host must be discarded by an endpoint if it cannot accept the data. This penalty is even more severe for high-speed devices due to the larger data payload size.

Example: OUT Data NAK

OUT Data NAK vs Ping Protocol Solution.png

In this example, an OUT transaction with a 512-byte payload is delivered to an endpoint that cannot accept the data. The endpoint has a full buffer and cannot store the data, so:

This type of behavior is not uncommon and results in large amounts of bandwidth being wasted.


Solution: Ping Protocol

Rather than sending large data payloads that are rejected time after time, the Ping protocol requires first checking whether a device is ready to accept the data before sending it.

Ping Responses

There are two typical responses to a PING packet:

Response Meaning
NYET (Not Yet) Target endpoint is not ready to receive data
ACK (Acknowledge) Endpoint is ready to receive the OUT transaction

The Ping protocol also defines how often a ping packet should be sent so that bandwidth is not wasted by sending back-to-back-to-back ping packets.


Ping Protocol Sequence Example

Ping Protocol Sequence.png

1. Host ──── PING ──────────► Device
   Host ◄─── NYET ──────────── Device    (not ready — buffer full)

2. Host ──── PING ──────────► Device
   Host ◄─── ACK ───────────── Device    (ready — buffer available)

3. Host ──── OUT Token ──────► Device
   Host ──── DATA (512B) ────► Device
   Host ◄─── ACK ───────────── Device    (data accepted)

In this example:


Bandwidth Comparison

Method Bytes on the wire Result
OUT + NAK (failed) ~520 bytes Data discarded — wasted
PING + NYET ~8 bytes No data sent — minimal overhead
PING + ACK + OUT ~8 + ~520 bytes Data delivered successfully

The PING token is only a few bytes, compared to 512+ bytes for a wasted data packet.


NYET vs. NAK Response

Response Sent in Response to Meaning
NYET (Not Yet) PING token Endpoint buffer is not available — retry PING later
ACK (Acknowledge) PING token Endpoint buffer is available — proceed with OUT transaction
NAK (Not Acknowledge) OUT data packet Endpoint could not accept the data — data discarded
Note

When a device responds with ACK to a PING, the host can immediately send the OUT transaction with confidence that the data will be accepted.


Applicability

Transfer Type Ping Protocol Used?
High-speed Bulk OUT Yes
High-speed Control OUT (data stage) Yes
Full-speed or low-speed OUT No — Ping is HS-only
High-speed IN transactions No — device only sends when data is available
Isochronous OUT No — no handshake mechanism
High-speed Interrupt OUT No — guaranteed bandwidth allocation

Benefits


Relationship to SuperSpeed

In USB 3.0 SuperSpeed, the Ping protocol is not needed. SuperSpeed replaces it with an asynchronous flow control mechanism:

See End-to-End Protocols (USB SuperSpeed)#3. Polled Flow Control for details.