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
use IP_PMTUDISC_PROBE for setting the DF bit on Linux & Windows, add support for darwin & FreeBSD #3378
base: master
Are you sure you want to change the base?
Conversation
…support for darwin & FreeBSD
Codecov Report
@@ Coverage Diff @@
## master #3378 +/- ##
==========================================
- Coverage 85.58% 85.37% -0.20%
==========================================
Files 135 135
Lines 9872 9928 +56
==========================================
+ Hits 8448 8476 +28
- Misses 1047 1067 +20
- Partials 377 385 +8
Continue to review full report at Codecov.
|
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.
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.
But we probably need to have someone test it under macOS and FreeBSD.
What exactly do we need to do to test this? Is it sufficient to run a localhost <-> localhost transfer and run Wireshark to see if the DF bit is set?
sys_conn_df_windows.go
Outdated
// https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Networking/WinSock/constant.IP_MTU_DISCOVER.html | ||
// https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Networking/WinSock/constant.IPV6_MTU_DISCOVER.html | ||
IP_MTU_DISCOVER = 14 | ||
IPV6_MTU_DISCOVER = 14 |
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.
From ws2ipdef.h
:
#define IP_MTU_DISCOVER 71 // Set/get path MTU discover state.
#define IPV6_MTU_DISCOVER 71 // Set/get path MTU discover state.
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.
Oof. Sorry for the mistake
(cherry picked from commit b6bf9c8)
I'm not sure if localhost works the same as real ones. I think the best way is to set up 2 machines (at least one of them should have a path MTU < MaxPacketBufferSize) and run some transfers. Use Wireshark to see the DF bit & packet size. |
Or we can just assume that it works, and deal with it in the future if someone found a problem and opened an issue. After all, the worst case scenario for macOS and FreeBSD is only like: These new socket options didn't work, and quic-go behaves exactly the same as before. |
Just tested this PR between a OSX and an Ubuntu. None of the QUIC packets originating from OSX hat DF set, only the packets from Ubuntu did. |
@database64128 @tobyxdd What shall we do with this PR? |
I think it's better than nothing. At least merging this PR makes it easier for someone with macOS or FreeBSD experience to fix this in the future. |
According to my test on OSX, it doesn't work on OSX. What does this PR achieve then? |
It also fixes the behavior on Linux and Windows by setting the correct |
I'll try to fix it on macOS. If it's not possible, I can drop macOS support, and at least we still added it for FreeBSD. |
|
@tobyxdd Any updates? |
I'm still alive. Will test it on a Mac within a few days |
I don't think the return value matters that much when we have Compatibility is a real concern as I got some feedback immediately after switching to IP_MTU_DISCOVER in my fork. |
Thank @database64128
I can confirm that this (still) works on Linux & Windows. But we probably need to have someone test it under macOS and FreeBSD.