Module congestion

Module congestion 

Source
Expand description

Consumer-side congestion control for NDN.

Provides window-based algorithms that react to Data arrivals, congestion marks (NDNLPv2 CongestionMark), and timeouts. Consumers use these to regulate how many Interests are in flight.

§Design

CongestionController is an enum (not a trait) — avoids dynamic dispatch and matches the RtoStrategy/ReliabilityConfig pattern used elsewhere. All state is internal; callers only see window() and the event methods.

§Example

use ndn_transport::CongestionController;

let mut cc = CongestionController::default(); // AIMD
assert_eq!(cc.window(), 2.0);

// Data arrived successfully — grow window.
cc.on_data();
assert!(cc.window() > 2.0);

// Congestion mark received — cut window.
cc.on_congestion_mark();
assert!(cc.window() < 3.0);

Enums§

CongestionController
Consumer-side congestion control algorithm.