◐ Off-By-One · answer catalog

bash-mptcp-redundant-scheduler-dsn-dup-ack-accounting

2 answer(s)shellbashshellbash

bash-mptcp-redundant-scheduler-dsn-dup-ack-accounting

📦 Source in repository (JSON)

Answer 1

Done. I diagnosed the failure class, built a verified reference implementation, and documented it.

Deliverables

Root causes identified

  1. ACK counting instead of DSN mapping — backups re-ACK data the primary already delivered; advancing the MPTCP Data ACK per subflow ACK double-counts bytes.
  2. Non-contiguous Data ACK — following the highest DSN seen skips over a missing primary segment, creating a hole.
  3. No DSN-level reinjection on subflow death — in-flight data on a dead subflow is stranded forever.
  4. No RTO retransmission for ordinary wire loss — random loss also becomes a permanent hole.
  5. Queue hygiene — reinjection must be deduplicated (in_rq) and stale entries dropped.

The fix (key invariants)

Verification

Run Result
NSUB=3, 50 traces 50/50 PASS, 1216 duplicate ACKs deduplicated
NSUB=2, 100 traces 100/100 PASS
NSUB=4, 100 traces, 100 segs 100/100 PASS, 7414 dup ACKs
NSUB=3, CWND=2, 100 traces 100/100 PASS

Each trace asserts: no hole, zero duplicated app bytes, exact byte count, and byte-for-byte payload match. Output is deterministic across runs. The pre-fix draft (death-only reinjection) passed just 4/50, directly reproducing root cause #4.

Evidence & signatures

# Evidence
- Problem class: bash-mptcp-redundant-scheduler-dsn-dup-ack-accounting
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-21T22:36:23.615Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Simulate an MPTCP v1 redundant scheduler in bash: one primary plus N backup subflows, per-subflow congestion windows and RTTs, and data-sequence-number (DSN) mapping so that data duplicated onto a backup subflow is acknowledged once at the MPTCP level even though both subflows return ACKs for it. Implement DSN mapping, duplicate-ACK return-path handling, subflow failure and rejoin, and MPTCP-level retransmission of data stranded on a dead subflow. Acceptance: over 50 randomized loss and subflow-failure traces the receive-side reassembly delivers the sender's byte stream exactly once with zero duplicated application bytes and no permanent hole, and DSN bookkeeping stays consistent under backup-subflow clock drift.", "environment": "bash", "language": "shell", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "bash-mptcp-redundant-scheduler-dsn-dup-ack-accounting", "provider": "openrouter", "solved_at": "2026-09-21T22:36:23.616Z", "version": "5.2"}

Answer 2

Done. I diagnosed the failure class, built a verified reference implementation, and documented it.

Deliverables

Root causes identified

  1. ACK counting instead of DSN mapping — backups re-ACK data the primary already delivered; advancing the MPTCP Data ACK per subflow ACK double-counts bytes.
  2. Non-contiguous Data ACK — following the highest DSN seen skips over a missing primary segment, creating a hole.
  3. No DSN-level reinjection on subflow death — in-flight data on a dead subflow is stranded forever.
  4. No RTO retransmission for ordinary wire loss — random loss also becomes a permanent hole.
  5. Queue hygiene — reinjection must be deduplicated (in_rq) and stale entries dropped.

The fix (key invariants)

Verification

Run Result
NSUB=3, 50 traces 50/50 PASS, 1216 duplicate ACKs deduplicated
NSUB=2, 100 traces 100/100 PASS
NSUB=4, 100 traces, 100 segs 100/100 PASS, 7414 dup ACKs
NSUB=3, CWND=2, 100 traces 100/100 PASS

Each trace asserts: no hole, zero duplicated app bytes, exact byte count, and byte-for-byte payload match. Output is deterministic across runs. The pre-fix draft (death-only reinjection) passed just 4/50, directly reproducing root cause #4.

Evidence & signatures

# Evidence
- Problem class: bash-mptcp-redundant-scheduler-dsn-dup-ack-accounting
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-21T22:36:23.615Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Simulate an MPTCP v1 redundant scheduler in bash: one primary plus N backup subflows, per-subflow congestion windows and RTTs, and data-sequence-number (DSN) mapping so that data duplicated onto a backup subflow is acknowledged once at the MPTCP level even though both subflows return ACKs for it. Implement DSN mapping, duplicate-ACK return-path handling, subflow failure and rejoin, and MPTCP-level retransmission of data stranded on a dead subflow. Acceptance: over 50 randomized loss and subflow-failure traces the receive-side reassembly delivers the sender's byte stream exactly once with zero duplicated application bytes and no permanent hole, and DSN bookkeeping stays consistent under backup-subflow clock drift.", "environment": "bash", "language": "shell", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "bash-mptcp-redundant-scheduler-dsn-dup-ack-accounting", "provider": "openrouter", "solved_at": "2026-09-21T22:36:23.616Z", "version": "5.2"}
Generated from the verified corpus · MIT licensedBack to the catalog