Loading
This MR collects eight TCP fixes, each in its own commit with a matching regression test.
Protocol correctness
- #946 — Send the MSS option in every SYN segment. The MSS option (a MUST in RFC 9293, Section 3.7.1) was neither sent nor processed. It is now sent advertising the configured segment size; on reception the sender clamps its segment size to the minimum of the configured and advertised values, and assumes the 536 (IPv4) / 1220 (IPv6) byte defaults when absent. New
tcp-msssuite. - #996 — Decrease the segment size by the size of TCP options. Per RFC 9293/RFC 6691 (and matching Linux
tcp_current_mss()), the payload is reduced by the 12 bytes of the timestamp option when negotiated, so segments no longer exceed the advertised MSS. Thens3-tcp-cubicsuite andtcp-validationexample now configure a 1460-byte MSS, yielding Linux-like 1448-byte payloads with their reference traces unchanged. - #940 — Do not append duplicate options to the TCP header.
AppendOption()accepted duplicate kinds whileGetOption()returns only the first, letting a stale option shadow a newer one. Duplicates (except NOP padding) are now rejected.
Loss recovery
- #1107 (closed) — Disabling SACK did not disable it completely. A cumulative ACK could move a dupack-counting guess onto the new buffer head and mark it lost below the duplicate ACK threshold, so a single reordering dupack triggered spurious retransmissions and recovery entries that kept cwnd at its minimum.
- #78 — RTO reset on partial ACKs was inverted w.r.t. the RFCs. The timer now resets on every partial ACK during fast recovery (RFC 6675, Section 6) and only on the first partial ACK after a timeout (RFC 6582, Section 4, Impatient variant). New
tcp-partial-ack-rtosuite. - #988 — No forced retransmission on SACK partial ACKs. The NewReno-style forced retransmission is now performed only when SACK is disabled; with SACK, retransmissions follow the scoreboard and pipe (RFC 6675, Section 5). New
tcp-sack-partial-acksuite. - #979 — SACK slower than no-SACK on lossy paths. Root cause was the lost-retransmission stall, resolved by the detection introduced for #1349 (closed); with the issue reproducer the transfer time with SACK drops from 1.90 s to 0.95 s (without SACK: 1.14 s). This commit adds the missing regression test (
tcp-lost-retransmission).
Robustness
- #248 — Assert crash with real-network peers.
AddRenoSack()asserted more than one outstanding segment, which real TCP stacks reached through fd-net-device can violate; it now returns gracefully.
Notes for reviewers
- The ns3tcp response vectors are regenerated (#946 adds 4 bytes to every SYN). Tests that hard-code payload-aligned sequence numbers now disable the timestamp option so their expectations remain valid under #996.
- Heads-up: #996 shifts TCP payload sizes by ~1%, which can perturb the timing-sensitive
wifi-eht-networkTCP release test. A companion one-line tolerance relaxation for that example is submitted separately (wifi MR); if this MR runs CI alone and that example flakes, that is the known interaction.