Expand description
Multi-path / connection migration state (Phase 4.2).
Tracks the per-path lifecycle from “newly observed” through
“validated” so the session can refuse to send application data over
an unverified path. Each path is identified by the 1-byte
path_id field in PacketHeader (Phase 3.3 / Phase 4.2 wire
addition).
§Validation protocol
When a peer arrives on a new (session_id, path_id) tuple — a fresh UDP source IP, a different transport leg, whatever — the receiver MUST NOT trust the path for application data until it has proven reachability by completing a challenge-response round-trip:
- Receiver registers the new
path_id(state:Unvalidated). - Receiver calls
PathRegistry::issue_challengeto allocate a fresh 32-byte random challenge, stored under thepath_id. The state transitions toValidating. - Receiver sends a
PATH_VALIDATIONflagged packet on the new path carrying the challenge bytes as its payload. - The legitimate peer echoes the same bytes back in a
PATH_VALIDATIONpacket (the AEAD authentication guarantees only the legitimate peer who holds the session key can do this). - Receiver calls
PathRegistry::verify_response. If the bytes match the stored challenge, the path transitions toValidatedand may carry application data. A mismatch transitions toFailed.
The cryptographic protection comes from the AEAD layer: a network
attacker observing the wire cannot forge a PATH_VALIDATION packet
with the right payload because they don’t hold the session AEAD key.
The challenge bytes themselves don’t need to be secret — they exist
to bind a specific path-validation attempt to a specific response.
§Use against migration
When a peer’s source IP changes mid-session (mobile handoff, LTE↔Wi-Fi switch, multi-path), the session must NOT silently accept packets on the new path — that would let an attacker hijack by spoofing the source IP. Issuing a challenge on the new path before accepting traffic forces the attacker to also hold the AEAD key, which they don’t.
Structs§
- Path
Registry - Per-session collection of
PathStates indexed bypath_id. - Path
State - Per-path bookkeeping. Lives inside
PathRegistry.
Enums§
- Path
State Kind - Lifecycle state of a single path within a session.
- Registration
Result - Outcome of a
PathRegistry::registercall.
Constants§
- PATH_
CHALLENGE_ LEN - Width of a path-validation challenge / response, in bytes.