ostp/ostp-server/src
ospab f789167a22 feat(congestion): actually pace sends instead of releasing whole windows
pacing_rate had been computed on every ACK since the controller was written
and never read by anything: admission was decided purely by cwnd. But cwnd
bounds how much may be UNACKNOWLEDGED, not how fast it reaches the wire, so a
full window went out back-to-back. On a bottleneck with a deep buffer that
burst is absorbed rather than dropped, and it lands as standing queue — the
mechanism behind the multi-second RTT this protocol has been showing on
mobile. It is also why BBR could not simply be dropped in: BBR's whole model
is "send at the estimated bottleneck rate", which is meaningless without a
pacer underneath it.

Adds a token bucket to CongestionController, charged in on_send so every byte
that reaches the wire pays exactly once — retransmits included, since those
are precisely what must not bypass the limit and pile into a full queue.

Burst allowance is 10ms-at-rate rather than one packet. Pacing intervals here
are fractions of a millisecond, so strict per-packet release would need a
sub-millisecond timer per packet; sizing the burst to the loop's existing
~10ms wakeup lets the configured rate still be saturated. There is a floor of
4 MTU so a cold or collapsed rate estimate can never wedge sending entirely.

Wired into both directions. The client gates its proxy-event branch on it,
and the server's per-session backpressure snapshot reports zero headroom when
the bucket is empty. The download path matters most here — that is the one
carrying video — and it was also still clamped to the old 16384-packet
ceiling (~20 MB outstanding), now aligned with MAX_CWND_PACKETS.

Tested that the bucket denies once drained and refills over time; the second
is what keeps a stalled bucket from wedging sending permanently.
2026-07-31 19:18:42 +03:00
..
transport fix(server): UoT — set TCP_NODELAY + tear down half-open connections 2026-07-12 01:25:34 +03:00
api.rs fix(server): constant-time comparison for Management API secrets 2026-07-18 17:38:09 +03:00
dispatcher.rs feat(congestion): actually pace sends instead of releasing whole windows 2026-07-31 19:18:42 +03:00
dns.rs fix(server): rate-limit the (currently unwired) open UDP DNS listener 2026-07-18 17:42:49 +03:00
fallback.rs Remove stealth_port entirely and integrate fallback into UoT HTTP handler 2026-06-10 02:26:13 +03:00
lib.rs fix(server): throttle relay reads to the client session's congestion window 2026-07-18 15:40:12 +03:00
outbound.rs fix(server): outbound connect no longer lets a dead IPv6 candidate eat the whole timeout 2026-07-18 16:40:57 +03:00
relay.rs fix(server): throttle relay reads to the client session's congestion window 2026-07-18 15:40:12 +03:00
relay_node.rs Refactor: Phase 1 and 2 - Async architecture, JNI fixes, SmolTCP data races, and Tunnel optimizations 2026-06-03 02:06:06 +03:00
router.rs Remove built-in DNS server and owndns features 2026-06-10 22:52:35 +03:00
signal.rs Initial public release: Ospab Stealth Transport Protocol v0.1.0 2026-05-14 21:41:54 +03:00
tui.rs Initial public release: Ospab Stealth Transport Protocol v0.1.0 2026-05-14 21:41:54 +03:00