Research: lossy links — KCP vs tuned QUIC vs WebTransport datagrams for keystroke latency #208

Open
opened 2026-10-13 14:00:28 +00:00 by kayg · 1 comment
Owner

Owner, 2026-10-13: "why aren't we trying KCP rather than QUIC? doesn't KCP get better latency over high latency connections?" and "browsers can do http/3 right and that's over quic?"

KCP lowers latency mainly on LOSSY links (aggressive early retransmit, little back-off), not on clean high-RTT links. Browsers can't use KCP or tune QUIC, but WebTransport datagrams let a page add redundancy itself (e.g. send each keystroke twice).

Research only (the transport is a foundational choice; the owner decides). Perf VM, 150 ms RTT with netem loss 0/1/3/5% and jitter; keystroke echo p50/p99/p99.9 and bulk throughput for: (a) WebSocket/TCP today, (b) QUIC (quinn) today, (c) tuned QUIC (duplicated keystroke packets, faster PTO, BBR), (d) KCP with encryption added, (e) browser WebTransport datagrams with duplicated keystrokes in real headless Chromium. Also binary size and code cost for each.

Owner, 2026-10-13: "why aren't we trying KCP rather than QUIC? doesn't KCP get better latency over high latency connections?" and "browsers can do http/3 right and that's over quic?" KCP lowers latency mainly on LOSSY links (aggressive early retransmit, little back-off), not on clean high-RTT links. Browsers can't use KCP or tune QUIC, but WebTransport datagrams let a page add redundancy itself (e.g. send each keystroke twice). Research only (the transport is a foundational choice; the owner decides). Perf VM, 150 ms RTT with netem loss 0/1/3/5% and jitter; keystroke echo p50/p99/p99.9 and bulk throughput for: (a) WebSocket/TCP today, (b) QUIC (quinn) today, (c) tuned QUIC (duplicated keystroke packets, faster PTO, BBR), (d) KCP with encryption added, (e) browser WebTransport datagrams with duplicated keystrokes in real headless Chromium. Also binary size and code cost for each.
Author
Owner

Start: lossy-link transport research (#208). Branch research-lossy-transport, base 9894aff6c0b2d9c49b5eef0bea008f55b1a2759b (origin/dev). Research only, no product code.

Plan: prototypes in $HOME/.cache/codex-scratch/research-lossy-transport/proto (source attached here at the end). One static musl binary drives (a) WebSocket/TCP/TLS 1.3, (b) quinn as configured in remote_quic.rs today (BBR, 1 MiB windows), (c) tuned quinn (stream priority + ack frequency + loss thresholds; and datagrams with duplicated keys + app ack), (d) KCP fast mode + AEAD; (e) headless Chromium (the playwright headless shell already on the perf VM) against a web-transport-quinn server, datagrams with duplicated keys, plus Chromium WebSocket and WebTransport-stream baselines. Perf VM netns pairs, netem 75 ms ± jitter each way, loss 0/1/3/5 % random and Gilbert-Elliott bursty, 20 Mbit/s bottleneck; 2,100 keys at 120 ms per cell, with and without a bulk stream. Lock held per run only.

Start: lossy-link transport research (#208). Branch `research-lossy-transport`, base `9894aff6c0b2d9c49b5eef0bea008f55b1a2759b` (origin/dev). Research only, no product code. Plan: prototypes in `$HOME/.cache/codex-scratch/research-lossy-transport/proto` (source attached here at the end). One static musl binary drives (a) WebSocket/TCP/TLS 1.3, (b) quinn as configured in `remote_quic.rs` today (BBR, 1 MiB windows), (c) tuned quinn (stream priority + ack frequency + loss thresholds; and datagrams with duplicated keys + app ack), (d) KCP fast mode + AEAD; (e) headless Chromium (the playwright headless shell already on the perf VM) against a web-transport-quinn server, datagrams with duplicated keys, plus Chromium WebSocket and WebTransport-stream baselines. Perf VM netns pairs, netem 75 ms ± jitter each way, loss 0/1/3/5 % random and Gilbert-Elliott bursty, 20 Mbit/s bottleneck; 2,100 keys at 120 ms per cell, with and without a bulk stream. Lock held per run only.
Sign in to join this conversation.
No labels
launch-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal#208
No description provided.