-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(dcutr): Fix end to end tests and add legacy behavior flag (default=true) #3044
base: master
Are you sure you want to change the base?
Conversation
On the side that in the new code will be the Server, can we add a random wait time after which the server will switch the role to Client and initiate the security negotiation? |
Does it need to be random? Could the server wait 3 RTT (it has the estimate) for the client and switch after? |
Unfortunately simple timeouts wont work. This is trickier. We need to always start as a Server. Then switch roles after a random wait. This is because when old go nodes and new go nodes interact, they may both assume the Client role, in which case, conn establishment will fail as both the sides assume the Client role. In the new code, if we always assume the role of Server, there will be 3 cases: old go node vs new go node
new go node vs new go node
|
97cc0b3
to
3a951e1
Compare
We did the opposite thing of what the spec says to do. This meant that we would fail to hole-punch with rust nodes because both sides we attempt to be the dialer.
cc7e359
to
6459ddb
Compare
Previously this PR sought to migrate away from the legacy behavior. Now it just tests the hole punching behavior using a simulated network. It also adds a flag to control the legacy behavior, but this is set to default to the current behavior.
Most of the code introduced here is related to the new
simconn
package which lets us create simulated UDP connections for use with the QUIC transport. This lets us set up arbitrary networks to test holepunching. The End to End test now places hosts A and B behind a firewall that requires holepunching for a direct connection.The plan is to merge this PR to actually test holepunching, then fix #3171 by coming up with a migration strategy and use these tests to verify the strategy.