pub struct PathModel { /* private fields */ }Expand description
Passive BBR path model. Holds the windowed BtlBw / RTprop estimates and
exposes them plus the derived BDP. Sized in blocks of block_bytes so
the sender can read the BDP directly as a flow-window target.
Implementations§
Source§impl PathModel
impl PathModel
Sourcepub fn new(block_bytes: usize) -> Self
pub fn new(block_bytes: usize) -> Self
New model whose BDP is reported in blocks of block_bytes (the data
payload per block: k * item_bytes, excluding parity and headers, so
the estimate is goodput, not wire rate).
Sourcepub fn on_ack(
&mut self,
delivered_blocks: u64,
now_us: u64,
rtt_us: u64,
newest_send_us: u64,
)
pub fn on_ack( &mut self, delivered_blocks: u64, now_us: u64, rtt_us: u64, newest_send_us: u64, )
Fold in one ACK: delivered_blocks is the cumulative count the
receiver has delivered, now_us the arrival time, rtt_us the
round-trip time the just-delivered block measured (0 if none), and
newest_send_us the send time of the newest block this ACK delivered.
A delivery-rate sample is emitted only once the window from the anchor
spans at least one RTprop (floored at BW_SAMPLE_FLOOR_US); its
rate is the delivered bytes over max(ack_window, send_span). Anchoring
at the last emitted sample - not the previous ACK - averages a run of
coalesced ACKs over the real interval they cover; dividing by the
send-span (the spread of send times across the delivered blocks) caps an
in-order frontier leap - a retransmit unblocking a buffered backlog - at
the rate the blocks were actually sent. Neither can fabricate a peak for
the max filter to latch onto. This is BBR’s max(ack_elapsed, send_elapsed) delivery-rate guard, per round trip, on an unpaced sender.
delivered_blocks must be non-decreasing and now_us monotonic.
Sourcepub fn rtprop_us(&self) -> u64
pub fn rtprop_us(&self) -> u64
Round-trip propagation delay estimate in microseconds (0 until the first RTT sample).
Sourcepub fn rtt_now_us(&self) -> u64
pub fn rtt_now_us(&self) -> u64
Smoothed recent round-trip time in microseconds (SRTT, 0 until the first RTT sample) - the “RTT_now” of the standing-queue estimate.
Sourcepub fn rtt_mean_us(&self) -> u64
pub fn rtt_mean_us(&self) -> u64
Mean RTT in microseconds across all samples - the sustained latency under load. A bufferbloat pacer is judged by how far this sits below the un-paced mean (the min RTT alone only shows the best moment).
Sourcepub fn queue_delay_us(&self) -> u64
pub fn queue_delay_us(&self) -> u64
Self-induced queue delay in microseconds: RTT_now - RTprop. A
sustained value above ~25 ms during our own transfer is bufferbloat we
are causing - the signal to pace down rather than blast. 0 before the
first RTT sample, and clamped at 0 (the smoothed RTT can dip a hair
below the windowed-min RTprop between samples).
Sourcepub fn bdp_blocks(&self) -> u64
pub fn bdp_blocks(&self) -> u64
Bandwidth-delay product in blocks - the in-flight window that keeps the bottleneck busy with no standing queue.
Sourcepub fn backhaul_hops(
&self,
nominal_bps: u64,
mcs_norm: f32,
congestion_fraction: f32,
) -> u8
pub fn backhaul_hops( &self, nominal_bps: u64, mcs_norm: f32, congestion_fraction: f32, ) -> u8
Estimated number of Wi-Fi backhaul hops (0..=3) behind the first hop.
A single-radio repeater receives then retransmits on the SAME channel;
carrier-sense self-interference roughly halves throughput per hop. So
with nominal_bps the single-hop PHY rate (the first-hop MCS, item 5)
and BtlBw the measured end-to-end bottleneck (item 6),
round(log2(nominal / BtlBw)) is the backhaul-hop count - 2x for one
hop, 4x for two, 8x for three.
Gated so real congestion does not read as a mesh hop: the first hop must
be healthy (mcs_norm high - the local radio is fine, so the reduction
is downstream) AND the loss must NOT be congestion-classed
(congestion_fraction low). A single-radio repeater’s penalty is a
structural bandwidth halving with no extra loss, whereas a congested
shared link shows the rising-delay, congestion-classed loss the item-3
classifier flags - so the loss class, not an RTT-inflation proxy, is the
discriminator (real repeaters add bandwidth penalty, not latency). This
answers what TTL cannot - an L2-bridged repeater does not decrement the
IP TTL, but its performance signature is unmistakable.