-
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
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
|
cc7e359
to
6459ddb
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.
Some minor comments. It is fine to merge for me. This is a significant improvement over the current testing of the holepunch package! 🚀
p2p/transport/quicreuse/connmgr.go
Outdated
overrideListenUDP listenUDP | ||
overrideSourceIPSelectorFn func() (SourceIPSelector, error) |
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.
Should we make the ConnManager an interface so that we have a simple implementation to use simulated conns.
Admittedly, it'll not test the full holepunching stack. But the current system feels a bit too complex.
I don't have a strong opinion on fixing this right now.
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.
I don't think I follow, can you explain a bit more?
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.
Oh, I think I understand. You're suggesting having quicreuse implement some new interface that we could then implement some simpler mock thing that returns the simulated packet conns.
If that's it, I think I'd prefer to have these options in quic resuse for the following reasons:
- This doesn't change any of the real logic of the quicreuse package.
- It keeps the simulated environment closer to the real environment.
- We could test how QUIC and WebTransport interact in quicreuse with holepunching.
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.
This reverts commit dbb45b1.
0803336
to
e0a57d7
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 #3171 by coming up with a migration strategy and use these tests to verify the strategy.