Module libp2p_autonat::v2
source · Available on crate feature
v2
only.Expand description
The second version of the autonat protocol.
The implementation follows the libp2p spec.
The new version fixes the issues of the first version:
- The server now always dials back over a newly allocated port. This greatly reduces the risk of false positives that often occured in the first version, when the clinet-server connection occured over a hole-punched port.
- The server protects against DoS attacks by requiring the client to send more data to the server then the dial back puts on the client, thus making the protocol unatractive for an attacker.
The protocol is seperated into two parts:
- The client part, which is implemented in the
client
module. (The client is the party that wants to check if it is reachable from the outside.) - The server part, which is implemented in the
server
module. (The server is the party performing reachability checks on behalf of the client.)
The two can be used together.