-
Notifications
You must be signed in to change notification settings - Fork 280
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
Proposal: AutoNAT v2 #503
Comments
Thanks for moving the discussion here @marten-seemann. |
How does rust-libp2p handle dial-back requests for the same TCP addressed received over a TCP connection? You won't be able to establish two TCP connections for the same 4-tuple when using SO_REUSEPORT. Do you special-case this? |
Can't speak for rust, but in Nim we only enable REUSEADDR for hole-punching. For regular connections, a random port is used |
For what it is worth, cross-referencing #389 here. |
@mxinden Is that what rust-libp2p does? If not, I'd expect high dial-back failure rates reported from rust-libp2p nodes (at least those that don't have QUIC enabled), namely for nodes that only have a single IP address. |
rust-libp2p does not implement #389, in other words rust-libp2p currently either reuses the same socket for all or none of the connections.
Good point. For AutoNAT 2 I would favor adding support for non-reuse-dial (similar to #389) in rust-libp2p, instead of spawning a new host (aka. Swarm in rust-libp2p) with a new identity.
Even if we require the identity of the remote AutoNAT server not to change, the nonce is still useful to make matching AutoNAT requests to incoming dials unambiguous. |
A question that often comes up in discussions about this proposal is the following: Why not use the AutoNAT protobuf and just send a single address?Unfortunately, this doesn't work for two reasons:
By now, (1) is not a big problem any more, since the fraction of old nodes has dropped to 10-15%. In addition, we could filter out old nodes by their reported agent version. I can't however think of any way to circumvent the false positives / negatives introduced by(2). |
instead of making this v2, it would be great if we could change the name of the protocol since people read "AutoNAT" and think "NAT hole punching implementation", which comes up in support threads over and over again. Since this is a breaking change, maybe it's a good opportunity? Something like:
|
I think that makes sense. Maybe we can come up with a fun acronym to follow the spirit of STUN, TURN, ICE, SIP |
This proposal has been around for the longest time, but it’s living inside this go-libp2p issue: libp2p/go-libp2p#1480 (comment).
Writing this up here now, so we have all the protocol improvements in one place.
Protocol Description
Compared to AutoNAT v1, AutoNAT v2 should provide the following features:
(2) definitely is a breaking a protocol change, and (1) in practice is as well, because old go-libp2p versions would return a DIAL_FAILED instead of a DIAL_REFUSED error if a transport was unsupported.
Rollout Strategy
AutoNAT v2 is only useful if a sufficient number of nodes support the protocol. During a transition period, nodes will need to support both versions (at least on the client side). Once a large enough fraction of the network (20%? tbd) supports AutoNAT v2, we can start disabling support for v1.
The text was updated successfully, but these errors were encountered: