Skip to content

Keep SCTP cwnd at the pacer's rate on random loss; re-run scenarios - #16

Merged
stasadance merged 1 commit into
mainfrom
claude/project-thread-3ut2e9
Nov 24, 2026
Merged

stasadance merged 1 commit into
mainfrom
claude/project-thread-3ut2e9

Conversation

@stasadance

@stasadance stasadance commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Problem

At 400 ms RTT with 2% loss, unreliable got 4 KB/s with 83% dropped. The pacer wasn't the limit: its budget was full. SCTP's Reno cwnd was: every reliable loss halved it, down to the 4 MTU minimum, every 1–2 s. That gives about cwnd/RTT ≈ 15 KB/s, and reliable takes 12 of it.

Fix

  • rtc fork (9e4c4bf on lagless): new Association::set_cwnd_floor / RTCPeerConnection::set_sctp_cwnd_floor. Fast recovery and RACK cuts stop at the floor. It never raises cwnd, and an RTO still collapses cwnd to 1 MTU. The default 0 keeps RFC behaviour. rtc-sctp tests: 215 pass.
  • Pacer: sets the floor to rate × (base RTT + 40 ms), but only while srtt hasn't grown over the lowest RTT seen and the pacer isn't draining. So random loss stops shrinking the window, and congestion (RTT growth, as in bloat) still gets the normal cut.
  • 04-scenarios.md: adds a re-run after Fix reliable latency under bursty loss and RTT swings #13 and this change.

Bench (Chrome, 1 seed × 20 s)

scenario before (#13) with floor
rtt400 unreliable KB/s / ping p95 4 / 723 25.8 / 402
random5 unreliable KB/s / ping p95 13.3 / 341 26 / 202
bursty reliable p95 263 (ndc 307) 104
bloat ping p95 / reliable p95 386 / 381 396 / 389
contention8 worst peer ping/rel p95 464 / 839 551 / 586
rtt-swing unreliable KB/s 2.5–9.6 2.2

A first version without the RTT-growth check broke bloat (ping p95 1.1 s), so the check stays.

Still open: during RTT swings the floor is off, because it can't tell the swing from a queue, so no gain there.

Tests

Rust: 14 pass, including a new floor test. e2e: all pass.

- Uses the rtc fork's new cwnd floor (9e4c4bf): while RTT hasn't grown
  over the lowest seen, a loss-driven cwnd cut stops at
  rate x (base RTT + 40 ms). Random loss at high RTT no longer halves
  cwnd to 4 MTU; congestion (RTT growth) still gets the normal cut.
- 04-scenarios.md: re-run after #13 and the floor. rtt400 unreliable
  4 -> 25.8 KB/s, random 5% 13 -> 26 KB/s, bursty reliable p95 104 ms.
@stasadance
stasadance merged commit f8d3897 into main Nov 24, 2026
4 checks passed
@stasadance
stasadance deleted the claude/project-thread-3ut2e9 branch November 24, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant