-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
sendQueue: ignore "datagram too large" error #3328
Conversation
Hooking into
On a connection via WireGuard that causes MTU to be reduced (Windows):
On vanilla connection (Windows):
|
ba9563a
to
a1fb28a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very clean. Thank you @zllovesuki!
Just a few nits.
Codecov Report
@@ Coverage Diff @@
## master #3328 +/- ##
==========================================
- Coverage 85.63% 85.61% -0.02%
==========================================
Files 133 136 +3
Lines 9792 9808 +16
==========================================
+ Hits 8385 8397 +12
- Misses 1032 1036 +4
Partials 375 375
Continue to review full report at Codecov.
|
a1fb28a
to
f5b6364
Compare
This commit introduces additional platform-dependent checking when the kernel returns an error. Previously, the session is terminated when PingFrame sends a discovery packet larger than the limit. With this commit, the error is checked, and if it is "datagram too large", the error is ignored. Additionally, 1. This commit re-enables MTU discovery on Windows unless it is disabled explicitly by user (Undo quic-go#3276), 2. Set IP_DONTFRAGMENT and IPV6_DONTFRAG with error checking on Windows, and 3. Set IP_MTU_DISCOVERY to PMTUDISC_DO for both IPv4 and IPv6 on Linux so that the kernel will return "message too long". Fixes quic-go#3273 quic-go#3327
f5b6364
to
b255d7d
Compare
Unfortunately I couldn't properly test the commit on Linux or FreeBSD as they are running in Hyper-V. If someone can help with testing those (e.g. vanilla vs via VPN so reduced MTU) that would be greatly appreciated! On illumos/amd64 it produces no regression (good). |
Perhaps we should disable PMTUD for all platforms, except for those that have a working |
That is certainly an idea, however I wold really prefer if we can add more support for those OSes. MTU of 1300 vs 1400, that's extra 10 packets to send for 1000 bytes of data (!). Literally making the internet a better place if we can make it more efficient. |
@marten-seemann care to comment on this? I can confirm that this works fine on Linux & Windows. |
https://gist.github.com/tobyxdd/1964cc8d559fb367010c80c1dafee1b1 This patch (based on the code of current PR) moves the set DF implementation to a separate file for each platform & the passed-in This is useful when the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you @zllovesuki!
Do you think we should abstract this part out? @marten-seemann |
Yes, but let's do that in a follow-up PR. Makes reviewing easier. |
/unrelated I got my hands on an ppc64le machine to test (courtesy of folks at https://openpower.ic.unicamp.br/minicloud/), and it seems like quic-go works quite well on ppc64le as well (on Debian/ppc64el at least). |
@tobyxdd would you mind submitting a new PR with your patch after this PR has been merged? |
If we are going to ignore the ICMP PTB message anyway, why not just set
|
According to MS docs, neither |
@tobyxdd The link you referenced directly contradicts what you said. Just press Ctrl + F and search If you have any Windows device around, open I suggested using |
My bad. I did see |
This commit introduces additional platform-dependent checking when the kernel returns an error. Previously, the session is terminated when PingFrame sends a discovery packet larger than the limit. With this commit, the error is checked, and if it is "datagram too large", the error is ignored. Additionally, 1. This commit re-enables MTU discovery on Windows unless it is disabled explicitly by user (Undo quic-go#3276), 2. Set IP_DONTFRAGMENT and IPV6_DONTFRAG with error checking on Windows, and 3. Set IP_MTU_DISCOVERY to PMTUDISC_DO for both IPv4 and IPv6 on Linux so that the kernel will return "message too long". Fixes quic-go#3273 quic-go#3327
This commit introduces additional platform-dependent checking when the
kernel returns an error. Previously, the session is terminated when
PingFrame sends a discovery packet larger than the limit. With this
commit, the error is checked, and if it is "datagram too large", the
error is ignored.
Additionally,
is disabled explicitly by user (Undo disable Path MTU Discovery on Windows #3276),
and
so that the kernel will return "message too long".
Fixes #3273 #3327