Repository navigation
fix(quic): send MTU probes only on a validated path - #7788
Conversation
When a peer migrates to a new address, the server restarts MTU discovery on the new path. The probe is built at the end of `transmit`, past the anti-amplification check that guards regular datagrams, so the server probed an address it had not validated beyond the 3x limit of RFC 9000 section 8. Each ACK of a probe released the next, larger one, and a lost PATH_CHALLENGE left the path amplification-blocked. Probe only a validated path. Both endpoints validate the handshake path before the connection is established, so this only defers MTU discovery on a migrated path until its PATH_RESPONSE arrives. Ports quinn-rs/quinn#2981 (aea1e538) with its regression test, and records it in the fork's README. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed head: 914237e
No actionable findings. Deferring MTU probes until path validation matches the upstream fix and preserves discovery after validation; the regression checks both the unvalidated and recovered paths.
Verification: GitHub-only static review of the port, path validation and fork test harness. I did not execute builds or tests. The byte assertion allows existing datagram slack, so it does not establish strict 3× compliance independently of the probe fix.
(Written by review, OpenAI)
|
No actionable comments were generated in the recent review. WalkthroughMTU discovery probes are now sent only when the connection is established and the current path is validated. A migration test checks probe behavior and the anti-amplification allowance before and after path validation. The README records the upstream fix and updates the sync checkpoint. Merge Risk:
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the single commit porting quinn aea1e538 (0.11.x 77a51bdc) to the fork.
- MTU probe gated on validation (
rs/moq-quic/src/connection/mod.rs:1163): the only MTU probe emission site now requiresself.path.validated, matching upstream exactly. This closes the anti-amplification bypass after a migration, and the initial handshake path is already validated beforestate.is_established(), so non-migrated connections are unaffected. - Regression test (
rs/moq-quic/src/tests/mod.rs:4386): ports upstream'smigration_mtu_probes_respect_anti_amplification_limit, including the 3x budget check and the assertion that no probe reaches an unvalidated address, then confirms MTU discovery resumes after validation. The localstep_losing_server_datagramshelper differs in implementation but has the same effective loss behavior:drive_serverdrops datagrams to any address other than the client's current one. - README sync markers (
rs/moq-quic/README.md:29): records the port and advances both checked-through markers. I verified against the upstream compare API thataea1e538and77a51bdcare the only commits after the previous markers.
cargo fmt --all -- --check passes. I could not run the new test here because libspa-sys fails to build without libpipewire-0.3 in this environment, the same limitation the author notes. The test semantics and the fix match upstream, so I have no concerns.
(Written by deepseek/deepseek-v4.1-flash-1017)
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Co-Authored-By: Claude Opus 5.5 <[email protected]>

Problem
After a peer migrates to a new address,
Connection::transmitrestarts MTU discovery on the new path. The MTU probe is built at the end oftransmit, after the loop that checksanti_amplification_blocked, so it is never counted against the 3x limit of RFC 9000 section 8. Every ACK of a probe from the unvalidated address releases the next, larger probe. If the PATH_CHALLENGE to that address is lost, the path stays amplification-blocked: the server can neither repeat the challenge nor keep its loss timer armed until the peer sends several times more data.The regression test reproduces it. Without the fix the server sends an MTU probe to the unvalidated address. With that probe check removed from the test, the same run also sends 5,115 bytes to an address it had received 766 bytes from, past 3x plus two datagrams of slack.
This is quinn-rs/quinn#2981 (commit
aea1e538, by Jacob Thrane Lund;0.11.xbackport quinn-rs/quinn#2984). The fork has the same code, andrs/moq-quic/README.mdsays upstream fixes are ported by hand with their regression tests.Approach
Send an MTU probe only when
self.path.validated. Both endpoints validate the handshake path before the connection is established, so only MTU discovery on a migrated path waits, until its PATH_RESPONSE arrives. The new testmigration_mtu_probes_respect_anti_amplification_limitports upstream's to the fork'sPairharness: it migrates the client to a new IP, loses every PATH_CHALLENGE, and checks the server's bytes against 3x what it received and that no probe goes out. Then it lets one through and checks that the path validates and MTU discovery runs back up to the full MTU. The README lists the port and moves the "checked through" markers to quinnaea1e538and0.11.x77a51bdc, the only commits since the previous markers.Impact
moq-quicis not onrelease, so there is nothing to backport.Alternatives
anti_amplification_blocked(probe_size)) instead of deferring it. A probe is a full-MTU datagram and the unvalidated budget is needed for the PATH_CHALLENGE, so deferring until validation is simpler and matches upstream.Follow-ups
None.
Testing
I ran these per crate, not through
just ci. This host has nopkg-config, so the build droppedpipewireandlibspafromrs/workspace-hack/Cargo.tomllocally; that edit is not in the diff.Review
Reviewed by a maintainer review agent at head
94585d4233(914237eeb3plus a merge ofmain, no conflicts).rs/moq-quic/README.md,src/connection/mod.rsandsrc/tests/mod.rs. No build scripts, CI or network-fetching code.transmitchange is identical to quinn-rs/quinnaea1e538(quinn-rs/quinn#2981). The test is upstream's, adapted to the fork's harness.step_losing_server_datagramsfilters withloseand then hands off todrive_server. Like upstream's inline loop,drive_serverdrops datagrams overpair.mtuand delivers only toclient.addr.cargo test -p moq-quic --libpasses (735 passed, 19 ignored). With theself.path.validatedcondition reverted,migration_mtu_probes_respect_anti_amplification_limitfails: "server sent an MTU probe to an unvalidated address" (5 vs 4).quest review --base origin/main(Codex gpt-6.1-sol, round 1): 0 findings.AI disclosure: Claude Code (an AI coding agent) ported this fix and its regression test, and drafted this description. The tests above were run locally.
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code