pub struct BandwidthEstimator { /* private fields */ }Expand description
BBR-like Bandwidth Estimator
Implementations§
Source§impl BandwidthEstimator
impl BandwidthEstimator
Sourcepub fn on_send(&mut self, bytes: u64)
pub fn on_send(&mut self, bytes: u64)
Notify the estimator that bytes were sent (increases inflight).
Sourcepub fn on_ack(&mut self, sample: DeliverySample) -> u64
pub fn on_ack(&mut self, sample: DeliverySample) -> u64
Process an ACK and update bandwidth estimates.
Returns the new recommended pacing rate (bytes/sec).
Sourcepub fn on_loss(&mut self, bytes: u64)
pub fn on_loss(&mut self, bytes: u64)
Notify a packet loss — triggers BBRv3 Fast Recovery.
Unlike earlier BBR versions that ignored loss, BBRv3 immediately backs off pacing rate and CWND relative to the lost bytes fraction.
Sourcepub fn set_app_limited(&mut self)
pub fn set_app_limited(&mut self)
Mark the sender as application-limited (not sending at line rate).
Call this when there is no data to send but the CWND has room. Samples produced during app-limited periods won’t update the BW filter, preventing bandwidth underestimation.
Sourcepub fn is_app_limited(&self) -> bool
pub fn is_app_limited(&self) -> bool
Whether the sender is currently considered application-limited.
Sourcepub fn pacing_rate(&self) -> u64
pub fn pacing_rate(&self) -> u64
Get current recommended pacing rate (bytes/sec).
Sourcepub fn inflight_bytes(&self) -> u64
pub fn inflight_bytes(&self) -> u64
Get current bytes in flight.
Sourcepub fn bottleneck_bandwidth(&self) -> u64
pub fn bottleneck_bandwidth(&self) -> u64
Get estimated bottleneck bandwidth (bytes/sec).
Sourcepub fn delivered_bytes(&self) -> u64
pub fn delivered_bytes(&self) -> u64
Get total bytes delivered.
Sourcepub fn round_count(&self) -> u32
pub fn round_count(&self) -> u32
Get the round count.