Files
VerseVDI-Protocol/frames/datagram-v2.md
sechmachine c554cac00d
Verify Protocol / verify (push) Canceled after 0s
Verify Protocol / module (push) Successful in 53s
feat(protocol): carry complete encoded media frames
2026-07-30 22:23:22 +07:00

1.6 KiB

VerseVDI complete media datagram v2

Datagram v2 carries one complete encoded video or audio unit under one sequence. It is negotiated explicitly as datagram-v2; v1 bytes are never reinterpreted. The gateway relays encoded bytes without codec processing or provider exposure.

All multi-byte integers are unsigned big-endian. The fixed header is 23 bytes:

Offset Size Field Rule
0 2 magic ASCII VD (0x56 0x44)
2 1 version 2 only
3 1 channel media.video.v1 (10) or media.audio.v1 (11)
4 1 flags zero; unknown bits reject
5 4 sequence session-local wrapping complete-unit sequence
9 8 timestamp_ms sender timestamp, bounded by transport skew policy
17 2 fragment_index zero-based
19 2 fragment_count 1 through 891; index less than count
21 2 payload_length exact payload byte count, at most 1,177

Each QUIC datagram is at most 1,200 bytes. One complete unit is at most 1,048,576 encoded bytes and 891 fragments. A sender rejects a larger unit before fragmentation.

A receiver retains at most four incomplete media units and only received fragment bytes. Fragments for one unit must agree on channel, sequence, timestamp, flags, and count. Exact duplicates are ignored; conflicting duplicates reject that unit. Bounded reorder is accepted. An incomplete unit expires after 250 milliseconds, and accepting a fifth incomplete unit evicts the oldest. Reassembly checks the 1,048,576-byte ceiling before appending and emits only after every fragment is present.