quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

proto: add a way to configure the minimum MTU change needed to stop the binary search used during the MTU discovery phase. #1702

Closed stormshield-damiend closed 10 months ago

stormshield-damiend commented 11 months ago

Previously the binary search algorithm used during the MTU discovery phase was stopping itself if the discovered MTU was within -20 / +20 of the previous detected one.

This could lead to finding a MTU 40 bytes smaller of the real one in the worst case.

This change allow changing the default minimum change value if more precision is needed.

djc commented 11 months ago

What value would you use for this in your project?

stormshield-damiend commented 10 months ago

What value would you use for this in your project?

Hi djc, as you know we do packet tunneling with Quic, thus the MTU is quite important for us as it is in direct link with the possible throughput of the tunnel. With the default value during a real-life test with someone in Spain connecting to an AWS VM, Quinn find the estimated MTU (40 lower than the real one) in 3 search phases. With a value of 1 (so -1 / +1 from real MTU), Quinn find the real MTU with 2 more iterations.

We think that 1 is too much aggressive for the default value, thus we propose this API, which allow changing the default value when needed.

djc commented 10 months ago

Okay, so you intend to configure this all the way to 1?

stormshield-damiend commented 10 months ago

Okay, so you intend to configure this all the way to 1?

Yes one or a small value, we need to run more real-life test to see how it goes in term of search convergence.