This document captures the protocol structure and behavioral contract needed to implement native QUIC + HTTP/3 in Asupersync, without inheriting executor/runtime assumptions from external stacks.
- RFC 9000 (QUIC transport)
- RFC 9001 (QUIC-TLS)
- RFC 9002 (loss detection and congestion control)
- RFC 9114 (HTTP/3)
- RFC 9204 (QPACK)
- Variable-length integer codec (QUIC varint, up to 2^62-1)
- Connection ID type (0..=20 bytes)
- Packet number representation (u64 storage, truncated wire widths)
- Packet header codecs:
- Long header: Initial (plus type envelope)
- Short header: 1-RTT shape
- Transport parameter codec:
- Known parameter decoding/encoding
- unknown parameter preservation for forward compatibility
- TLS crypto-level progression (
Initial→Handshake→OneRtt) and handshake confirmation gate - Key-update and peer key-phase transition handling
- Connection lifecycle (
Idle/Handshaking/Established/Draining/Closed) - ACK processing with packet-number ranges, packet/time-threshold loss detection, PTO backoff
- Congestion-window state tracking (cwnd/ssthresh) with explicit send-admissibility check
- Stream table with:
- local/remote stream lifecycle
- per-stream and connection-level flow control
- out-of-order receive reassembly
- STOP_SENDING / STOP_RECEIVING / RESET_STREAM / final-size invariants
- round-robin writable stream selection
- HTTP/3 frame and SETTINGS codecs
- Control stream protocol checks (SETTINGS-first, duplicate guard, GOAWAY tracking)
- Request stream state machine (HEADERS/DATA/trailers ordering)
- Unidirectional stream type registry (control/push/qpack-encoder/qpack-decoder)
- Static-only QPACK policy enforcement + static-table planning helpers for request/response heads
- Varint encoding length must match value range.
- Decode must reject truncated buffers and impossible forms.
- Connection IDs longer than 20 bytes are invalid.
- Header decode must preserve packet-number byte width.
- Transport parameters must round-trip unknown entries byte-for-byte.
- Stream reassembly must only advance contiguous receive offset and preserve final-size constraints.
- Connection and stream flow control must reject overrun deterministically.
- HTTP/3 control/push/QPACK stream typing must reject duplicate or mismapped stream usage.
- Header protection and payload encryption backend binding
- Retry and version-negotiation packet full-path handling
- Full wire-level QPACK encoder/decoder stream instruction layer
- Interop capture suite and deterministic lab-runtime packet-fault scenarios
src/net/quic/andsrc/http/h3/exist as prior experiment surfaces.Cargo.tomlintentionally does not expose production QUIC/H3 features today.- Current task is native-first core extraction and implementation, not dependency reenabling.
The Phase 1 core should be:
- Pure and deterministic over byte slices.
- Runtime-agnostic (no async executor assumptions).
- Memory-safe and explicit in error states.
- Small enough to fuzz and property-test exhaustively.
- Varint boundary fixtures:
- 0, 63, 64, 16383, 16384, 2^30-1, 2^30, 2^62-1
- Packet header fixtures:
- valid Initial/Short forms
- truncated and malformed headers
- Transport parameter fixtures:
- known-only sets
- mixed known+unknown
- duplicate and length-corrupt entries
Native QUIC + HTTP/3 protocol/runtime substrate in:
src/net/quic_core/mod.rssrc/net/quic_native/{tls,transport,streams,connection}.rssrc/http/h3_native.rs