Available on crate feature
std only.Expand description
Phantom Protocol - Session Management
The Session is the virtual association between two endpoints that persists
across IP changes (single-path seamless connection migration — not multipath
aggregation). It owns the per-direction AEAD CryptoState (hot-swapped on rekey
via ArcSwap), the header-protection keys, the rotating connection-ID chain, the
per-direction replay window, the stream table, the pacer + BBR bandwidth
estimator, and the migration / liveness state. The Scheduler it holds is
vestigial (see SchedulerMode).
Structs§
- Bandwidth
Snapshot - Read-only snapshot of the session’s pacing / bandwidth state
(Phase 2.6). Returned by
Session::bandwidth_snapshotfor 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_pathwhen the peer migrates. The demux applies it:addare the CIDs to register at the new leading edge,removethe CIDs that fell past the trailing edge, andanchoris a CID still routed for this session (the demux resolves the session’s channel through it). - Crypto
State - Crypto state for session encryption.
- Session
- Session - virtual association between two endpoints
Enums§
- Session
State - 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_LIMITof2^32) the gap is essentially always 0 or 1. - REBIND_
VALIDATION_ PATH_ ID - Reserved
path_idfor 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_INVOCATIONSceiling (Invariant 8) so a long-lived session ratchets keys instead of failing withNonceExhausted.