Claude/vibrant allen 0xt1al - #6
Merged
Merged
Conversation
The stack previously advertised SACK-permitted and consumed the peer's SACK blocks, but never sent its own — a peer could not selectively retransmit into our out-of-order buffer and had to go back to the cumulative ACK on every loss. Pure ACKs now carry up to 4 SACK blocks (RFC 2018) merged from the out-of-order queue whenever it is non-empty. A new TcpConfig::sack switch (default true) controls the whole feature: negotiation, block emission, and use of the peer's blocks. TcpConfig also gains ack_delay (wired up in a following commit) and validation for both. Note: adding fields to TcpConfig is a breaking change for exhaustive struct literals; construct it via ..Default::default(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EUsV3w9pksrMkRP8z2odvw
Fast retransmit previously resent every unconfirmed inflight segment from the recovery point onward (go-back-n), including segments above the peer's highest SACK block that were never reported lost. Recovery now stops at the highest SACK right edge; segments above it are left to the cumulative ACK or a later RTO. An RTO still retransmits the whole window, per RFC 6582 semantics. A lossy-transfer regression test with sack=false covers the pure go-back-n fallback. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EUsV3w9pksrMkRP8z2odvw
ack_delay = None (the default) keeps the current behavior of sending a due ACK immediately. Some(d) defers pure ACKs for up to d (bounded to 500ms per RFC 1122), cutting the pure-ACK packet rate. The delay is bypassed whenever holding the ACK back would hurt the peer: duplicate/ out-of-order feedback that drives fast retransmit, two full segments of unacknowledged data, a receive window reopening from zero, or any non-established state. The stream task folds the ACK deadline into its existing wait and distinguishes an ACK-timer wake-up from retransmission/teardown timeouts, so a deferred ACK cannot trigger go-back-n. The redundant perform_post_ack_action at the loop end (which would have discarded a deferred ACK's state) moved into try_send_ack. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EUsV3w9pksrMkRP8z2odvw
iperf3 through the tcp_proxy TUN example (this container, 8s runs): shift effective wnd forward reverse 2 256 KiB 2.80 Gbps 2.57 Gbps 3 512 KiB 3.04 Gbps 2.78 Gbps 4 1 MiB 3.23 Gbps 2.71 Gbps <- new default 6 4 MiB 3.52 Gbps 2.66 Gbps The old comment warned that a larger window overruns the TUN drain, but egress batching removed that bottleneck. shift 4 takes the forward gain with no retransmissions; going further keeps helping one-way throughput but bounds per-connection buffering at 2x the window (8 MiB at shift 6), which is too much for a default. Lossy/reordered transfer tests pass at the new default. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EUsV3w9pksrMkRP8z2odvw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.