Skip to content

fix(router): size reorder buffer to the BDP + drop-not-skip at the OOM cap - #4239

Merged
0pcom merged 1 commit into
skycoin:developfrom
0pcom:fix-reorder-buffer-bdp
Aug 26, 2026
Merged

fix(router): size reorder buffer to the BDP + drop-not-skip at the OOM cap#4239
0pcom merged 1 commit into
skycoin:developfrom
0pcom:fix-reorder-buffer-bdp

Conversation

@0pcom

@0pcom 0pcom commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

The reorder window was a flat 2048 packets (~2.8 MB) — ~16× below the MPTCP receive-buffer requirement B ≥ 2·ΣBW·RTT_max (~46 MB / ~32Ki packets at the ~500 Mbps target, ~350 ms slowest-active-leg RTT). Undersizing collapses throughput under wide-mux skew rather than degrading gracefully, and trips the OOM backstop far too easily. Bumps reorderWindow 2048 → 32768 (a CAP, not steady occupancy — normal skew buffers only a handful).

Also closes the last stream-corruption path: the maxGap backstop used to flushAll (deliver past the gap = skip), which corrupts the reliable ordered stream (bad record mac). At the cap it now drops the excess out-of-order packet (checked before buffering, so memory stays bounded) and never skips — the dropped seq is re-requested via SACK, and the leg-dataprogress prune + retransmit refill the frontier in order. Removed the unused flushAll.

Sizing follows the MPTCP/MP-QUIC multipath literature; a follow-up will make the window adaptive to the measured RTT_max of the active set. Developed with AI assistance (Claude).

…M cap

The reorder window was a flat 2048 packets (~2.8 MB) — ~16x below the MPTCP
receive-buffer requirement B >= 2*sum(BW)*RTT_max (~46 MB / ~32Ki packets at the
~500 Mbps gigabit target with a ~350 ms slowest-active-leg RTT). Undersizing
doesn't degrade gracefully: out-of-order data overflows and throughput collapses,
and it hit the OOM backstop far too easily. Bump reorderWindow 2048 -> 32768.

Also close the last stream-corruption path: the maxGap backstop used to flushAll
(deliver PAST the gap = skip), which corrupts the reliable ordered stream (the
bad-record-mac failure). At the cap the buffer now DROPS the excess out-of-order
packet instead (checked BEFORE buffering so memory stays bounded) and never skips;
the dropped seq is re-requested via SACK and the leg-dataprogress prune + retransmit
refill the frontier IN ORDER. Removed the now-unused flushAll. Test asserts the
buffer holds the gap, drops excess at the cap, and drains in order once it fills.

The window is a flat gigabit-sized cap for now (steady occupancy stays tiny); a
follow-up will make it adaptive to the measured RTT_max of the active set.
@0pcom
0pcom merged commit 481f080 into skycoin:develop Aug 26, 2026
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