Skip to main content

Module session

Module session 

Source
Expand description

Phantom Protocol - Session Management

Virtual association that persists across IP changes. Manages streams, encryption state, and multi-path scheduling.

Structs§

BandwidthSnapshot
Read-only snapshot of the session’s pacing / bandwidth state (Phase 2.6). Returned by Session::bandwidth_snapshot for telemetry / debugging without exposing the mutable estimator.
CidSlide
A one-step slide of the inbound CID demux window (ε / WIRE v5, P4b), produced by Session::note_migration_path when the peer migrates. The demux applies it: add are the CIDs to register at the new leading edge, remove the CIDs that fell past the trailing edge, and anchor is a CID still routed for this session (the demux resolves the session’s channel through it).
CryptoState
Crypto state for session encryption.
Session
Session - virtual association between two endpoints

Enums§

SessionState
Session state machine

Constants§

MAX_REKEY_CATCHUP
How many epochs the receive path will catch up in one packet when accepting an authenticated forward rekey (C1). A small bound caps the HKDF work an attacker can force per spoofed packet (each step is a trial that commits nothing unless AEAD verifies) while comfortably absorbing the small epoch divergence that arises when both directions rekey at slightly different cadences. A gap larger than this is rejected; over a reliable transport the sender retransmits at the then-current epoch, so no data is lost. In practice (production REKEY_SOFT_LIMIT of 2^32) the gap is essentially always 0 or 1.
REBIND_VALIDATION_PATH_ID
Reserved path_id for validating a passive NAT rebind (M-3).
REKEY_SOFT_LIMIT
Soft high-watermark for automatic mid-session rekey (C1). Once a direction’s AEAD invocation count crosses this, the data pump rotates to a fresh key before the hard AEAD_MAX_INVOCATIONS ceiling (Invariant 8) so a long-lived session ratchets keys instead of failing with NonceExhausted.