Skip to main content

Module v2

Module v2 

Source
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+    payload

Structs§

ChunkHeader
FrameMeta
Optional per-frame metadata carried at the start of block 0 / chunk 0’s payload when FLAG2_FRAME_META is set.

Enums§

FecType

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.