Repository navigation
Conversation
…t RTT sample Before a path has an RTT sample, `smoothed_rtt` is the configured initial RTT (333 ms), so `optimal_capacity` limited the pacer's burst to one MTU and refilled it at about one datagram per 27 ms. A ClientHello that takes two datagrams (any with an ML-KEM key share) had its second held until the server's ACK or the pacing timer, and a server's handshake flight was split the same way. Until the first RTT sample, the burst may now be the congestion window (the initial window then, as RFC 9002 section 7.7 allows), bounded by MIN_BURST_SIZE and MAX_BURST_SIZE times the MTU. Once the path has a sample, capacity is computed as before, so MAX_BURST_INTERVAL still bounds window-paced flows. The pacer recomputes capacity when the path gets its first sample (`RttEstimator::has_sample`), as it does when the window or the MTU change. A controller that reports a pacing rate (BBRv3) never reaches this path. `sent_packets_stats_snapshot_test` counts one more server packet: the NEW_CONNECTION_IDs now leave as 0.5-RTT data right behind the Handshake flight instead of with HANDSHAKE_DONE. New test: `initial_window_bursts_before_an_rtt_sample`. Refs n0-computer#879
flub
left a comment
There was a problem hiding this comment.
Thanks for following up with this PR!
| /// section 7.7 allows. Limiting it by [`MAX_BURST_INTERVAL`] of the initial | ||
| /// RTT instead allowed a single datagram, and refilled at a datagram per | ||
| /// ~27 ms: a ClientHello that takes two datagrams (any with an ML-KEM key | ||
| /// share) had its second held until the server's acknowledgement or that | ||
| /// timer, and a server's first flight after its first datagram the same way. | ||
| /// (A controller that reports a pacing rate never comes here: BBRv3 starts | ||
| /// from a 1 ms nominal RTT, so its first flight leaves in one burst too.) |
There was a problem hiding this comment.
Let's not describe how this used to behave. And also the motivation is for the PR description.
| Ord::max(window, mtu), | ||
| ); | ||
| } | ||
| rate_capacity(rate, mtu) |
There was a problem hiding this comment.
Can you put this in an explicit else branch so that you don't need the return statement above? That makes the control flow more clear.
| let mtu = u64::from(mtu); | ||
| let target_capacity = | ||
| ((rate as u128 * TARGET_BURST_INTERVAL.as_nanos()) / 1_000_000_000) as u64; | ||
| return Ord::min( |
There was a problem hiding this comment.
Can you re-write the comparisons using use std::cmp; and cmp::min & cmp::max? The trait methods do read rather odd like this.
| self.smoothed.unwrap_or(self.latest) | ||
| } | ||
|
|
||
| /// Whether an RTT has been measured, or [`Self::get`] is still the initial RTT |
There was a problem hiding this comment.
| /// Whether an RTT has been measured, or [`Self::get`] is still the initial RTT | |
| /// Whether an RTT has been measured, or [`Self::get`] is still the initial RTT. |
We're writing new doc comments using the rustdoc style guide, which requires a full stop.
| // Before the first RTT sample the pacer lets the initial window go out in | ||
| // one burst (`pacing::optimal_capacity`), so the server's | ||
| // NEW_CONNECTION_IDs leave as 0.5-RTT data right behind its Handshake | ||
| // flight, instead of waiting for the packet that carries HANDSHAKE_DONE. |
There was a problem hiding this comment.
oh, this is a lovely improvement actually
|
Don't worry about the cargo-deny failure, we'll sort that out. |
…mp, shorter doc comment
|
Thanks! All four are in 16c73d7: the doc comment only says what the function does now, there's an explicit |
Refs #879 (the pacing part; you asked for this PR on 2 and 18 Nov).
Before a path has an RTT sample, the pacer uses the 333 ms initial RTT, so its burst is one datagram, and a ClientHello that needs two (any with an ML-KEM key share) waits about 27 ms for the second. Until the first sample, the burst may be the congestion window, the initial window RFC 9002 §7.7 allows, still bounded by MIN/MAX_BURST_SIZE. Once there's a sample nothing changes.
Test:
initial_window_bursts_before_an_rtt_sample.sent_packets_stats_snapshot_testcounts one more server packet, because the NEW_CONNECTION_IDs now go out right behind the Handshake flight.