Visual RFC.
ALL RFCs / RFC 9221
Read the RFC ↗
RFC 9221 / UNRELIABLE QUIC DATAGRAMS

Read the two DATAGRAM frame layouts

02

A DATAGRAM frame has a type and application bytes. The least-significant bit of its type decides whether an explicit Length field is present. Length counts only the Datagram Data bytes.

RFC 9221 · § 4EXAMPLE
3 / 3
Read the two DATAGRAM frame layoutsThree complete plaintext frame byte examples compare type31 with explicit length, type30 without a length, and an empty type31 datagram.31 02 68 69 is four frame bytes with two data bytes hi.30 68 69 is three frame bytes whose data reaches the end of this packet frame space.31 00 is a valid two-byte empty frame. Outer QUIC headers and authentication tag are not included; rectangles are schematic widths and contain no stream-ID field.LEN changes the frame layout31 00Type 0x31LEN=1Length 00value 0VALID EMPTY DATAGRAMFrame 2 bytes · data 0 bytes
03
Keep zero-length datagrams valid.

31 00 has an explicit zero data length. Empty application data is permitted; the encoded frame is not zero bytes long.

Source for this drawing: RFC 9221 · Read RFC section 4 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Terms in this drawing
LEN bit
The low bit of type 0x30/0x31 that controls the optional Length field.
Variable-length integer
A QUIC integer whose encoded byte length grows with the value.
Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Frame types are 0x30 and 0x31. LEN=1 includes a QUIC variable-length integer Length; LEN=0 omits Length and extends the data to the end of the QUIC packet. Empty datagrams are allowed.

  • Frame types are 0x30 and 0x31. LEN=1 includes a QUIC variable-length integer Length; LEN=0 omits Length and extends the data to the end of the QUIC packet. Empty datagrams are allowed.
  • The explicit-length example31 02 68 69 has type 0x31, Length 2 and two ASCII payload bytes68 69 (hi). Its full frame size is4 bytes, not2.
  • The no-length example30 68 69 uses type 0x30 with the same two data bytes, ending exactly at the QUIC packet boundary. A later frame in that packet would be consumed as data, so it cannot be placed after this DATAGRAM.
  • The zero-length example31 00 is a valid empty DATAGRAM. It still has a type and length field, so its full frame size is2 bytes.
  • Type and Length are QUIC variable-length integers. In these examples both values fit one byte. Larger payload lengths can require two or more bytes for Length, affecting the whole-frame bound.
DETAILS

Hexadecimal byte strings are complete frame examples, not entire encrypted QUIC packets. Their outer packet headers and authentication tag are omitted. Layout widths are schematic. RFC 9000 section 16 supplies the variable-length integer encoding; these small values use the shortest valid one-byte representation.

Read the RFC section ↗

All chapters in RFC 9221

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗