fix(s2n-quic-transport): wait until handshake is confirmed to start MTU probing #2305
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.
Description of changes:
MTU probing currently begins as soon as the handshake completes and the path has been validated. This is normally OK, but can cause issues when mutual TLS has been configured.
When mTLS is used, MTU probes may be transmitted from the client prior to the handshake being confirmed (via receipt of
HANDSHAKE_DONE
). Prior to the handshake being confirmed, though, the client is not allowed to send PTO probes:From QUIC9002§6.2.1:
The consequence of this is that MTU probes may be sent which are never detected as lost, as the client cannot send a PTO probe to trigger loss detection. This may result in a connection being blocked by the congestion controller, in cases where particular large MTU probes are configured.
This change will wait for the handshake to be confirmed before transmitting MTU probes to avoid this situation.
Call-outs:
This will slightly delay MTU probing on the client until a
HANDSHAKE_DONE
frame is received, but generally this would only be 0 to 1 more RTTs before probing begins. MTU probing on the server should not be impacted, as the handshake is confirmed on the server as soon as it completes:I considered making this fix by only enabling the MTU controller when the handshake is confirmed (it is currently enabled when the path has been validated locally and by the peer). This ends up being more complicated, as new path created due to connection migration do not trigger the
on_handshake_confirmed
code paths, so we would need to wire through the handshake status to the path manager. It didn't seem worth it.Testing:
I've made the MTU integration tests parameterized over mTLS/one-way-auth to ensure coverage over both types of auth. I confirmed 2 of the tests fail without this fix in place.
Is this a refactor change? If so, how have you proved that the intended behavior hasn't changed? -->
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.