PathProbe
Padding that lets a still screen's stream test its path once congestion control has cut its target under the configured rate.
A tick whose stream offered under CongestionSteer.APP_LIMITED of the
target tests nothing of the path, so the steer raises it no further than
the capacity the path last showed: a desktop that sits still after a real
queue keeps the cut rate until its screen moves (#489). While the target
stands under the ceiling, the steer's hold is over and the stream itself
fills less than APP_LIMITED of the target, the transport pads it to the
target (rate_bps), so the path carries, or queues, the rate the steer
asks of it, and the steer climbs or backs off as it does on a moving
screen. A queue on a tick that followed padding ends the probe, the path
found: the next one waits QUIET_S, doubling to QUIET_MAX_S while probes
keep ending that way, and back to QUIET_S once a target reaches the
ceiling. A tick that measured no delay pads nothing.
Attributes
attributeQUIET_S= 15.0attributeQUIET_MAX_S= 240.0attributepadding= Falseattributequiet_until= 0.0attributequiet_s= self.QUIET_SFunctions
constructor__init__() -> NoneSource Code
def __init__(self) -> None:
self.padding = False
self.quiet_until = 0.0
self.quiet_s = self.QUIET_SReturns
Nonefuncrate_bps(target_kbps, ceiling_kbps, content_bps, queue_s, held, now) -> floatThe padding to send until the next tick, in bits per second.
Source Code
def rate_bps(self, target_kbps: float, ceiling_kbps: float, content_bps: Optional[float],
queue_s: Optional[float], held: bool, now: float) -> float:
"""The padding to send until the next tick, in bits per second.
Args:
target_kbps: The target the steer just set.
ceiling_kbps: The configured target.
content_bps: What the stream itself sent over the tick, padding left
out, or None when unmeasured (nothing pads then).
queue_s: The queue the tick read, as `CongestionSteer.target` takes it.
held: Whether the steer holds its target after a cut (its drain).
now: Monotonic time of the tick.
"""
padded, self.padding = self.padding, False
if target_kbps >= ceiling_kbps:
self.quiet_s = self.QUIET_S
return 0.0
if queue_s:
if padded:
self.quiet_until = now + self.quiet_s
self.quiet_s = min(self.quiet_s * 2.0, self.QUIET_MAX_S)
return 0.0
if queue_s is None or content_bps is None or held or now < self.quiet_until:
return 0.0
target_bps = target_kbps * 1_000.0
if content_bps >= target_bps * CongestionSteer.APP_LIMITED:
return 0.0
self.padding = True
return target_bps - content_bpsparamtarget_kbpsfloatThe target the steer just set.
paramceiling_kbpsfloatThe configured target.
paramcontent_bpsOptional[float]What the stream itself sent over the tick, padding left out, or None when unmeasured (nothing pads then).
paramqueue_sOptional[float]The queue the tick read, as CongestionSteer.target takes it.
paramheldboolWhether the steer holds its target after a cut (its drain).
paramnowfloatMonotonic time of the tick.
Returns
float