1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// TODO: Remove this once BBR is integrated into peer_connection.rs
//! BBRv3 (Bottleneck Bandwidth and Round-trip propagation time) congestion controller.
//!
//! Implementation based on the IETF draft:
//! https://datatracker.ietf.org/doc/html/draft-ietf-ccwg-bbr
//!
//! ## Why BBRv3?
//!
//! BBRv3 is a model-based congestion control algorithm that explicitly estimates
//! the network path's bottleneck bandwidth and round-trip propagation time.
//! Unlike loss-based algorithms (like TCP Reno) or delay-based algorithms
//! (like LEDBAT), BBR tolerates packet loss without drastically reducing throughput,
//! making it ideal for lossy network paths.
//!
//! ## Key Concepts
//!
//! - **max_bw**: Maximum bandwidth estimate (bottleneck bandwidth)
//! - **min_rtt**: Minimum RTT estimate (propagation delay)
//! - **BDP**: Bandwidth-Delay Product = max_bw × min_rtt (optimal inflight)
//! - **pacing_rate**: Rate at which to send packets = max_bw × pacing_gain
//! - **cwnd**: Congestion window = BDP × cwnd_gain
//!
//! ## State Machine
//!
//! BBRv3 has four primary states:
//!
//! | State | Purpose | Pacing Gain | CWND Gain |
//! |-------|---------|-------------|-----------|
//! | Startup | Find max bandwidth | 2.77 | 2.0 |
//! | Drain | Drain Startup queue | 0.36 | 2.0 |
//! | ProbeBW | Steady-state probing | 0.9-1.25 | 2.0 |
//! | ProbeRTT | Measure min_rtt | 1.0 | 0.5 |
//!
//! ## Lock-Free Design
//!
//! This implementation uses atomic operations for all state, enabling
//! concurrent access from sender and ACK processing paths without locks.
// Re-export public API
pub use BbrConfig;
pub use BbrController;
pub use DeliveryRateToken;
pub use ;
pub use BbrStats;