pub struct LossClassSensor { /* private fields */ }Expand description
Stateful loss differentiator. observe_interarrival / observe_owd feed it
the running timing; classify runs the hybrid on a detected loss.
Implementations§
Source§impl LossClassSensor
impl LossClassSensor
Sourcepub fn observe_interarrival(&mut self, ia_us: f64)
pub fn observe_interarrival(&mut self, ia_us: f64)
Record one packet inter-arrival (microseconds) to update T_min. Zero
or negative spacings (duplicate / reordered arrivals) are ignored.
Sourcepub fn observe_owd(&mut self, owd_us: f64)
pub fn observe_owd(&mut self, owd_us: f64)
Record one relative one-way trip time (microseconds) to update the RTprop baseline and the recent-floor congestion detector.
Sourcepub fn classify(&mut self, gap: u32, interarrival_us: f64) -> LossClass
pub fn classify(&mut self, gap: u32, interarrival_us: f64) -> LossClass
Classify a loss of gap consecutive packets given the inter-arrival
(microseconds) measured across it. mBiaz calls it wireless when the
spacing fits the gap’s wireless window; Spike calls it wireless when the
path is not in a congestion spike; the hybrid is wireless only when both
agree, else congestion.
Sourcepub fn recent_owd_spread_us(&self) -> f64
pub fn recent_owd_spread_us(&self) -> f64
Spread (max - min, microseconds) of the recent ROTT window - the path’s current delay variation, which bounds how late a reordered packet can arrive. A consumer uses it to set a reorder-tolerant retransmit grace so jitter is not mistaken for loss. Zero before two samples.
Sourcepub fn congestion_fraction(&self) -> f32
pub fn congestion_fraction(&self) -> f32
Share of recent loss classified congestion (0..=1); 0 before any loss.
Sourcepub fn class_code(&self) -> u8
pub fn class_code(&self) -> u8
2-bit class code for the Loss frame: 0 = no loss yet, 1 = wireless,
2 = congestion, 3 = mixed (recent loss split between the two).