Selkies

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.0
attributeQUIET_MAX_S
= 240.0
attributepadding
= False
attributequiet_until
= 0.0
attributequiet_s
= self.QUIET_S

Functions

constructor__init__() -> None
Source Code
def __init__(self) -> None:
    self.padding = False
    self.quiet_until = 0.0
    self.quiet_s = self.QUIET_S

Returns

None
funcrate_bps(target_kbps, ceiling_kbps, content_bps, queue_s, held, now) -> float

The 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_bps
paramtarget_kbpsfloat

The target the steer just set.

paramceiling_kbpsfloat

The 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.

paramheldbool

Whether the steer holds its target after a cut (its drain).

paramnowfloat

Monotonic time of the tick.

Returns

float