Skip to content

M4b followups - #11

Merged
mp0rta merged 35 commits into
mainfrom
m4b-followups
Oct 15, 2026
Merged

mp0rta merged 35 commits into
mainfrom
m4b-followups

Conversation

@mp0rta

@mp0rta mp0rta commented Oct 15, 2026

Copy link
Copy Markdown
Owner

No description provided.

mp0rta added 30 commits October 15, 2026 05:56
…mismatch

A later MP_CAPABLE-with-data is a mapping, so a checksum presence that differs from the
decision is the DSS presence mismatch of spec G3 and resets with the same reason.
Move the MP_FAIL DSN lookup and the failed mapping's stream offset out of
check.py into endpoints.py (mp_fail_dsn, failed_mapping) and test them,
including a 32-bit DSS match and an offset across the 64-bit wrap.
check.py's options() reuses the shared flag helper, and csum-fail2's
answer count is the bare RSTs csum_fail_checks admits instead of a
"minus one" over the RST rows.
verify_chunk returns the stream offset of the first octet that is
neither the pattern nor an allowed inversion (an extra inversion
included), and the error names it instead of the chunk start.
run.sh waited for mptcp-rs-tun to create mtun0 and added its addresses a
second later, so the client's first SYN always left a TUN without them
and was lost (with m2-lossy's netem loss the run could then fall back to
plain TCP). Create the persistent TUN with its addresses and capture
first, as the server role and the suite already do; the client attaches.
The negotiation rows' pcap check was a script outside the repository.
With INTEROP_CSUM set, run.sh passes --csum to check.py, which checks the
MP_CAPABLE A bits (SYN: the client's setting; SYN/ACK: the decision from
an mptcp-rs server, the sysctl from Linux; third ACK and MP_CAPABLE with
data: the decision, spec G2) and that every DSS mapping and MP_CAPABLE
with data carries a checksum exactly when checksums are used (G3).
Presence is read from the option length, as tshark decodes the checksum
field only sometimes.
…ches

pattern.verify_chunk returns None or the stream offset of the first
octet that is neither the pattern nor an allowed inversion (an extra
inversion included), as mptcp-rs-tun's now does; both verifiers print it
instead of the chunk start.
…at M; R2 ends it; an answered join is freed after its RST
…M) + 0x06

A mapping installed while Waiting whose DSN-SSN offset is not the initial one means the
peer reinjected on this subflow: contiguity is gone, so the subflow takes the G11
"otherwise" path (RST + MP_FAIL(M.dsn) + MP_TCPRST 0x06, hold discarded) before any of
that mapping is delivered. Previously a valid copy of M's DSNs was delivered and moved the
DATA_ACK past M while Waiting went on.
…ecksum (G8)

Linux kernels with cfcceb7a39fc but not b110f1dd6cb6 send the DATA_FIN-only DSS with an
uninitialised checksum when checksums are on, and Linux never verifies it. Ignoring it
hung the close. At recv.next all data up to it has arrived, so it is taken; a mismatch at
any other DSN is still ignored.
With INTEROP_CSUM unset the effective setting is on:off (ours on, Linux
sysctl off): run.sh passes --csum whenever a Linux end takes part, so
default runs check the A bits and checksum presence too. Default runs
with two mptcp-rs ends stay unchecked; INTEROP_CSUM still checks every
pairing.
…t per segment

check.py wanted exactly one DLL=0 DSS on the wire, the M1 rule from when our
infinite mapping went out once on a pure ACK. Since e0d2c5b (M4a) it also
rides every data segment until its first new octet is TCP-ACKed, which fixed
a silent truncation when that one copy was lost or overtaken, and the M4b
spec keeps that rule. The client now sends one ACK-only copy plus the data
in flight before that ACK, so dataack-strip failed on main (bisected to
e0d2c5b).

The check now asserts what the rule promises: one infinite mapping (one DSN),
from the client only, exactly one ACK-only copy, and retired for good: plain
client data follows its last copy and no copy comes after it.
…ress

Leg A 100 Mbit/s x 10 ms RTT, leg B 10 Mbit/s x 300 ms RTT with jitter,
0.5 % loss and 1 % reordering, 1 GiB in one direction (cf.
mptcp_net-next#635, leftover C9). check.py prints the receiver's
delivery over time from its DATA_ACK advances and fails on a gap of
2 s or more, also in logs-only mode (the kernel-to-kernel baseline).
…only checks

m2-hetero's kernel client sends 1 GiB (kclient.py --send N), and its
kernel-to-kernel baseline reads the pcaps in logs-only mode, which needs
check.py to know both ends are Linux.
server.py's fixed-size sender (--send-bytes) reads to the peer's EOF
before its own shutdown, so kclient --send 0 --expect N must close its
half once N octets are in; reading to EOF first deadlocked both ends
until run.sh's timeout (m2-hetero s2c with the kernel client).
…hor, retired only once ACKed

infinite_mapping_checks now reads the client's TUN capture with the SSN and TCP seq/ACK:
- copies with one DSN but another SSN are a second mapping (RFC 8684 L1368-1370);
- the first plain client data must follow a server TCP ACK, as the TUN delivered it, that
  covers an octet sent only with the infinite mapping (M4b spec, MP_FAIL state machine;
  e0d2c5b). The old shape, one ACK-only copy then plain data, is now rejected: it is the
  truncation e0d2c5b fixed, and the pre-e0d2c5b bisect run fails with it.
…after fallback

The nstat pins keep MPFailTx/Rx >= 1 (Linux counts one per late MP_FAIL it processes, 2 or 9
seen). New mp_fail_bounds, on the wire, per direction:
- MP_FAILs split at gaps >= 0.5 s form at most 7 episodes (G13: the initial exchange plus
  retries at +1, +3, +7, +15, +31, +63 s; interval from RTO >= 1 s, doubling; +127 s is past
  the 120 s cut-off), each shorter than 0.5 s. Linux answers every late MP_FAIL, so an answer
  of ours would loop and keep an episode going.
- G18: as the echoer, our pure-ACK MP_FAILs after the echo are >= 0.5 s apart (retries only);
  as the originator, no MP_FAIL of ours ACKs peer data sent after its echo or infinite mapping.

Packet gains TCP seq, length and ACK number (defaulted).
… the full byte count

delivery_summary measured gaps only between DATA_ACK advances, so a stall
before the first advance was invisible, no advances gave a 0 s gap, and
nothing required DATA_ACK to reach the transfer's size (logs-only too).
It now starts at the sender's first payload on the server-side links, ends
at the advance covering all n octets, and fails without that evidence.
…at the echo's retirement and follow the G13 schedule

mp_fail_bounds ran over the server-side capture and looked only at
MP_FAIL packets, so it could not tell what reached us, nor when our echo
retired; the 7-episode bound limited neither the backoff nor the 120 s
deadline.

- It now reads the mptcp-rs end's own TUN (own_capture), every packet from
  1 s before to 1 s after the MP_FAIL traffic.
- Echoer: the echo retires on a peer TCP ACK of an octet sent only with our
  infinite mapping (the dataack-strip rule). No MP_FAIL of ours, pure ACK
  or data-bearing, may follow it, except the run we wrote before reading
  that ACK: within 5 ms and before our first segment without MP_FAIL
  (0.4 ms seen in csum-fail1-s2c 20261013T185639-dDLsVJ).
- Our episodes after the first are G13 retries: the first at least
  MIN_RTO (1 s) after our first MP_FAIL, each interval at least double the
  previous (50 ms allowed), none later than 120 s after our first.
- Originator: the G18 rule takes the first echo or infinite mapping that
  reached us, so a lost echo no longer fails a correct run.
The 5 ms post-retirement window, the doubling of observed retry
intervals, and counting every later episode as a retry could fail a
correct run whose process paused mid-drain, whose retry timer was
serviced late, or whose infinite-mapped payload went out late.

- After the retiring ACK, an MP_FAIL of ours is allowed only until our
  first segment without MP_FAIL on that subflow.
- Timer retries are only our pure-ACK MP_FAILs answering no new peer
  payload that start an episode; the k-th must be at or after
  first + (2^k - 1) MIN_RTO, less 50 ms. Late handling only delays them.
  The 7-episode, 0.5 s episode and 120 s limits stay.
…ests

Timer emissions cannot be identified on the wire: a data-driven MP_FAIL
can hide a retry, and a delayed window update looks like one. The
retry-spacing lower bound and its classifier are removed; the schedule is
covered with injected time by mp_fail.rs's
waiting_sends_mp_fail_on_acks_and_retries, echoer_idle_retries_bounded,
waiting_times_out_at_120s and after_fallback_mp_fail_triggers_nothing.
Kept: at most 7 episodes, each under 0.5 s, nothing of ours past first +
120 s, the post-retirement rule and the G18 rules over our own capture.
…1's bounds

While our infinite mapping is due, mptcp.rs attaches the echo to every
segment (fail_due), so an ordinary window update is a payload-free
MP_FAIL too, and the 0.5 s pure-ACK spacing rule rejected it. Retry
spacing and no-answer-after-fallback are pinned by mp_fail.rs's
echoer_idle_retries_bounded and after_fallback_mp_fail_triggers_nothing;
the wire keeps the episode, 120 s, retirement and originator G18 rules.
The echoer answer case now comes after retirement.
@mp0rta
mp0rta merged commit e9aa443 into main Oct 15, 2026
14 checks passed
@mp0rta
mp0rta deleted the m4b-followups branch October 15, 2026 19:19
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