Skip to content
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

fix(s2n-quic-transport): wait until handshake is confirmed to start MTU probing #2305

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

WesleyRosenblum
Copy link
Contributor

@WesleyRosenblum WesleyRosenblum commented Aug 23, 2024

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:

An endpoint MUST NOT set its PTO timer for the Application Data packet number space until the handshake is confirmed.

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:

the TLS handshake is considered confirmed at the server when the handshake 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.

@WesleyRosenblum WesleyRosenblum merged commit b4ba62d into main Aug 26, 2024
130 checks passed
@WesleyRosenblum WesleyRosenblum deleted the WesleyRosenblum/mtumtls branch August 26, 2024 22:40
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.

2 participants