quinn-proto: avoid unnecessary PING when a DATAGRAM fits into a tail-loss probe - #2794
Open
hunterinvariants wants to merge 1 commit into
Open
quinn-proto: avoid unnecessary PING when a DATAGRAM fits into a tail-loss probe#2794hunterinvariants wants to merge 1 commit into
hunterinvariants wants to merge 1 commit into
Conversation
hunterinvariants
requested review from
Ralith,
djc and
gretchenfrage
as code owners
August 19, 2026 05:59
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.
When the peer does not support ACK Frequency, the loss-probe logic falls back to a PING frame to make the probe ack-eliciting. If a DATAGRAM is already queued and actually fits into that probe, the extra PING is redundant – DATAGRAM frames are ack-eliciting on their own.
The catch is that loss probes are always capped at INITIAL_MTU (1200 bytes), which can be smaller than the current path MTU. A DATAGRAM that comfortably fits a normal-sized packet might not fit into the smaller probe packet. So we cannot just check whether a DATAGRAM is pending; we have to check whether it physically fits into that constrained probe space.
The change does exactly that: for the 1-RTT space it computes the available frame space inside an INITIAL_MTU-sized probe and only avoids queueing the fallback PING if can_send_1rtt() confirms that the pending ACK-eliciting 1-RTT data can actually be placed there.
The new regression test (tail_loss_probe_keeps_ping_when_datagram_does_not_fit) sets the path MTU to 1452, queues a DATAGRAM that fits 1452 but not 1200, and verifies that the fallback PING is queued. The existing tail_loss_small_segment_size test was adjusted to confirm that the fallback PING is not queued when the DATAGRAM does fit. All local checks – formatting, clippy, and the full quinn-proto test suite with default and all features enabled – are green.
Closes #2173
Related context: #2169 and #2172