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

initialize the MTU discoverer when processing the transport parameters #4514

Merged
merged 1 commit into from
May 14, 2024

Conversation

marten-seemann
Copy link
Member

On the client side, we always use the configured packet size. This comes with the risk of failing the handshake if the path doesn't support this MTU. If the server sends a max_udp_payload_size that's smaller than this size, we can safely ignore this: Obviously, the server still processed the (fully padded) Initial packet, despite claiming that it wouldn't do so.

On the server side, there's no downside to using 1200 bytes until we received the client's transport parameters:

  • If the first packet didn't contain the entire ClientHello, all we can do is ACK that packet. We don't need a lot of bytes for that.
  • If it did, we will have processed the transport parameters and initialized the MTU discoverer.

@@ -153,7 +153,7 @@ type connection struct {
unpacker unpacker
frameParser wire.FrameParser
packer packer
mtuDiscoverer mtuDiscoverer // initialized when the handshake completes
mtuDiscoverer mtuDiscoverer // initialized when the transport parameters are received
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the original comment here was incorrect: We used to initialize the mtuDiscoverer with the connection, not on handshake completion.

On the client side, we always use the configured packet size. This comes
with the risk of failing the handshake if the path doesn't support this
MTU. If the server sends a max_udp_payload_size that's smaller than this
size, we can safely ignore this: Obviously, the server still processed
the (fully padded) Initial packet, despite claiming that it wouldn't do
so.

On the server side, there's no downside to using 1200 bytes until we
received the client's transport parameters:
* If the first packet didn't contain the entire ClientHello, all we can
do is ACK that packet. We don't need a lot of bytes for that.
* If it did, we will have processed the transport parameters and
initialized the MTU discoverer.
@marten-seemann marten-seemann force-pushed the initialize-mtu-discoverer-on-tp branch from 84a3aea to b4a6d66 Compare May 14, 2024 04:45
Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 72.72727% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 85.15%. Comparing base (508b402) to head (b4a6d66).

Files Patch % Lines
connection.go 80.77% 4 Missing and 1 partial ⚠️
mtu_discoverer.go 42.86% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4514      +/-   ##
==========================================
- Coverage   85.16%   85.15%   -0.01%     
==========================================
  Files         154      154              
  Lines       14768    14782      +14     
==========================================
+ Hits        12577    12587      +10     
- Misses       1686     1688       +2     
- Partials      505      507       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marten-seemann marten-seemann merged commit 2557fb9 into master May 14, 2024
34 checks passed
@marten-seemann marten-seemann deleted the initialize-mtu-discoverer-on-tp branch May 14, 2024 05:51
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.

max_udp_payload_size smaller than initial packet size makes PMTUD go backwards
1 participant