-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connections initially have a bad RTT, take too long to settle down. #2176
Comments
Can RTT estimator be trusted? Then calculated by Maybe extract On a first glance looks like simple exponential averaging, but I have not looked into where |
But generally if you see 600 ms delay it means raw |
I have checked out [patch.crates-io]
quinn-proto = { path = "../quinn/quinn-proto" } Then patched quinn with this: diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs
index 7e93d9d1..7d7693f4 100644
--- a/quinn-proto/src/connection/mod.rs
+++ b/quinn-proto/src/connection/mod.rs
@@ -1258,6 +1258,7 @@ impl Connection {
)
};
let rtt = instant_saturating_sub(now, self.spaces[space].largest_acked_packet_sent);
+ println!("RAW RTT: {:?}", rtt);
self.path.rtt.update(ack_delay, rtt);
if self.path.first_packet_after_rtt_sample.is_none() {
self.path.first_packet_after_rtt_sample = On the accept side
On the connect side raw values look like this:
Note the first raw value of 399 ms.
|
Maybe
Delay indeed seems to be large, but encoded ack delay is exactly zero (zero microseconds!). Accepter should measure the time it took to ack first frame and encode it into ack delay so connecting side can subtract it from RTT measurement. Here |
Ok, apparently on 0.10.x ack delay is simply not implemented: It was only implemented in quinn-rs/quinn#1553 that is not part of the 0.10.x branch. 400 ms of TLS crypto also does not sound good, here is a blog post claiming the whole TLS handshake took 220 ms in 2009: https://www.moserware.com/2009/06/first-few-milliseconds-of-https.html |
From what I understand it is normal that initially the RTTs are rather large in QUIC. There is something about the crypto not yet being setup and the ACKs having to wait before they can be sent. IIRC there's even something about ignoring ack_delay for some of the very early RTT estimates during the handshake. So I don't think this is of particular concern. |
I have hacked something together which allowed me to reset the congestion controller and rtt estimator state every time the magic socket switches path (on the I'll now try to figure out how to do this in a nice and reasonable way that supports more than one connection. In any case we'll end up with a forked Quinn I think. |
There is this quote from RFC 9002: It means that before handshake peer may report large "ack_delay" and it should be subtracted from RTT measurement as is without capping it to
But currently used quinn 0.10 does always report exactly 0 in |
Closed by #2234 |
On high-latency connections we have observed a pretty bad initial round-trip time (RTT) time, as estimated by Quinn. This appears not to happen (as much) on connections with low latency. It also appears to mostly affect the connecting side, likely the side with the longest distance to the relay server.
This is likely affected by and made worse by #2169. Though going into mixed sending does not affect the RTT much, probably only gets worse when switching fully back to the relayed connection.
The text was updated successfully, but these errors were encountered: