pub struct LossController { /* private fields */ }Expand description
Loss-based congestion control, per draft-ietf-rmcat-gcc-02 §5.5.
§Why delay is not enough
A path can drop packets without ever queueing them — a wireless link with interference, or a bottleneck whose buffer is so shallow that it overflows before the delay signal moves. The delay-based half sees nothing there, so without this a sender keeps pushing into a link that is discarding a tenth of what it sends.
Between the two thresholds nothing happens. That band is deliberate: a few per cent loss is normal on a wireless link and reacting to it would give up capacity permanently.
§Divergence from upstream (D4)
This controller may move the target on its own. Upstream’s cannot: its latestBitrate is
only written inside onDelayUpdate (send_side_bwe.go:304), so on a lossy link without
queueing delay its loss estimate is computed and then never applied — exactly the case this
exists for. That is a bug rather than a design choice, and it is not inherited.
Implementations§
Source§impl LossController
impl LossController
Sourcepub fn new(initial: f64, min: f64, max: f64) -> Self
pub fn new(initial: f64, min: f64, max: f64) -> Self
A controller starting at initial, clamped to min..=max.
Sourcepub fn set_bounds(&mut self, min: f64, max: f64)
pub fn set_bounds(&mut self, min: f64, max: f64)
Change the range the target is held in, and bring the target into it.
Sourcepub fn raise(&mut self, bound: f64)
pub fn raise(&mut self, bound: f64)
Bring the target up to bound if it is below it: a measurement showed the path
carries that much (a probe).
Sourcepub fn cap(&mut self, bound: f64)
pub fn cap(&mut self, bound: f64)
Bring the target down to bound if it is above it: a deliberate cut (missing feedback).
Sourcepub fn update_fraction(&mut self, now: Instant, fraction_lost: f64) -> f64
pub fn update_fraction(&mut self, now: Instant, fraction_lost: f64) -> f64
Update from a fraction lost a receiver report gave, when there is no per-packet feedback to count from (section 7).
Sourcepub fn average_loss(&self) -> Option<f64>
pub fn average_loss(&self) -> Option<f64>
The smoothed loss fraction, if any feedback has arrived.