Skip to content

quinn-proto: avoid unnecessary PING when a DATAGRAM fits into a tail-loss probe - #2794

Open
hunterinvariants wants to merge 1 commit into
quinn-rs:mainfrom
hunterinvariants:tlp-datagram-ping
Open

quinn-proto: avoid unnecessary PING when a DATAGRAM fits into a tail-loss probe#2794
hunterinvariants wants to merge 1 commit into
quinn-rs:mainfrom
hunterinvariants:tlp-datagram-ping

Conversation

@hunterinvariants

Copy link
Copy Markdown

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

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.

When sending a tail-loss probe a PING frame can be added to a DATAGRAM frame

1 participant