libp2p / go-libp2p-autonat

DEPRECATED: NAT Autodiscovery
MIT License
53 stars 12 forks source link

Use traceroute to determine if an AutoNAT server is acceptable #46

Open Stebalien opened 4 years ago

Stebalien commented 4 years ago

We should consider using some form of traceroute on IPv6 to determine if a potential AutoNAT server is viable. This should be very fast because we just want to verify that we hit some public IP on the route.

If we can get this working correctly, we can skip the other heuristics (although some of them may be a good initial check).

Stebalien commented 4 years ago

Yeah, it looks like we may be able to do a UDP simple UDP traceroute. We're not trying to get all the way to the target, just out of our network.

willscott commented 4 years ago

They'll all be "public" IPs, so we'll need some heuristic for deciding that we've hit some router along the way with an IP that diverges significantly from those of the endpoints.

Could we get away in many cases with just latency as an estimator of being in the same network?

Stebalien commented 4 years ago

Ah, because IPv6... Actually, we there's no reason not to try IPv4, right (if the peer has an IPv4 address)?

Stebalien commented 4 years ago

Could we get away in many cases with just latency as an estimator of being in the same network?

Maybe? But I'd want to set that limit to be really short (like 1-5ms).