Does the current go-libp2p holepunch implementation work in situations where two peers who are both behind symmetric NATs wish to connect directly? I don’t think so, but maybe I’m mistaken.
This is an older paper that describes a method of holepunching that claims to achieve 97% success rate, including symmetric NATs, using port prediction. Just wanted to bring it to your attention if you haven’t seen it yet, or something similar. I think it would require the use of two seperate autonat servers.
Thanks for the article, it’s a good read. They mention symmetric NAT briefly:
There are situations in which hole punching will not work, most notably when one of the nodes is behind a symmetric NAT. In such cases, nodes can instead explicitly add port mappings, either manually or by using UPnP (opens new window). As a last resort, nodes can leverage external relay (opens new window)nodes.
Symmetric NATs are difficult because they map each outbound address to a different source port while only allowing replies from those specific IPs on their specific ports. The port allocation can be somewhat predictable or it can be random, depending on the NAT implementation.
I have had a basic idea for a while now, been looking for a place to share it (haven’t done any coding yet) to use a public UDP port, the same port for both client and server peer operations, and start listening, then send UDP packets to the other peers to connect, once each peer has sent a packet out through it’s NAT router to the other peers, there should be an open port already translated ready to receive packets from the public ip address it was sent to, of course the peer client app would have to attempt multiple different UDP ports numerically close to the initial port the peer servers all listen on, and perhaps even do a portscan of sorts of the peer public ip until it finds the correct port on the NAT router but it seems like this is technically possible.
Also there would need to be some sort of addressing? connection setup server so peers can find other peers public ip addresses and or dns domain names.
I’m interested in this myself but I’ll be honest: it would be hard for me personally to write the code for this simply because I don’t have access to enough devices that are behind different symmetric NATs. The research paper you link to (if it is the one I’m thinking about) the researchers ended up buying tons of different SIM cards for 4G carriers then had cheap phones for all of them. From that they had a platform to test on. So you can see its even difficult being in a position to test this kind of code.
As far as home Internet routers are concerned – going to say I’ve not seen any symmetric NATs yet. This is more an enterprise thing and more common on mobile networks. I think its important to have high quality algorithms that can do this though. Just need for someone to organize the resources.