Read the two DATAGRAM frame layouts
02A 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.
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 ↗
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.
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.
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 ↗