Expand description
Wire protocol v2 chunk header and frame metadata (ADR 0001).
byte 0 bit 7 keyframe | bits 4-6 fec_type | bits 0-3 version = 2
byte 1 channel_id u8
bytes 2-3 frame_id u16 BE per channel, wraps
bytes 4-5 chunk_idx u16 BE 0..n-1 data, n..n+k-1 parity, within the block
bytes 6-7 n u16 BE data chunks in this FEC block
byte 8 k u8 parity chunks in this FEC block
byte 9 flags2 bit0 frame_meta, bit1 discardable, bit2 end_of_frame
bytes 10-11 last_len u16 BE real length of data chunk n-1 of this block
bytes 12-13 chunk_len u16 BE payload size of full chunks in this block
bytes 14-17 send_ts u32 BE low 32 bits of sender monotonic µs
bytes 18-19 block_idx u16 BE FEC block index within the frame
bytes 20+ payloadStructs§
- Chunk
Header - Frame
Meta - Optional per-frame metadata carried at the start of block 0 / chunk 0’s
payload when
FLAG2_FRAME_METAis set.
Enums§
Constants§
- CONTROL_
CHANNEL - DEFAULT_
CHUNK_ LEN - Default chunk payload before path-MTU discovery raises it.
- FLAG2_
DISCARDABLE - FLAG2_
END_ OF_ FRAME - FLAG2_
FRAME_ META - HEADER_
LEN - MAX_
CHUNK_ LEN - Upper bound the sender will ever use; keeps a chunk inside one 1400-byte QUIC packet after QUIC + HTTP/3 + WebTransport framing.
- VERSION
Functions§
- ts_
delta_ us - Wrap-aware difference of two 32-bit microsecond send timestamps.