7

Are there any open source cross platform NAT punch throughs?

GEOCHET
  • 21,119
  • 15
  • 74
  • 98

3 Answers3

2

I haven't seen one, but you'll find more information than you require here:

http://www.enchantedage.com/node/8

It's not terribly hard to implement, just a bit of work.

There is code on the page that demonstrates this that builds on unix and windows, including both the server portion (the introducer) and the client portions. It doesn't list a license, but the author indicates in the readme that the technique is free, and re-implementing it from the information on the page and the source code example appears to be relatively easy.

The author appears to be the owner of the website enchantedage, so you can probably contact them directly for more information.

Adam Davis
  • 91,931
  • 60
  • 264
  • 330
  • The link doesn't work. I'm guessing this is the same page http://www.mindcontrol.org/~hplus/nat-punch.html – scoopr Sep 28 '11 at 11:28
  • @scoopr Thanks, that's an older copy. It looks like the original moved to http://www.enchantedage.com/node/8 but if it goes away again, archive.org has a copy that includes the source code here: http://web.archive.org/web/20100911100603/http://www.enchantedage.com/node/8 – Adam Davis Sep 28 '11 at 13:29
  • Incidentally, the author of that article and code is on Stack Overflow: http://stackoverflow.com/users/89233/jon-watte – Adam Davis Sep 28 '11 at 13:36
2

The best I've seen is UDT, which is a reliable UDP library that also includes a "rendezvous" connect mode that helps take care of the NAT punching. All you have to do is figure out the external IP address and port and somehow get it to the other client (and vice versa). Once you know that information, you both connect and bind at the same time (with rendezvous mode set) and it'll do its best to figure out the rest.

tghw
  • 25,208
  • 13
  • 70
  • 96
  • " All you have to do is figure out the external IP address and port and somehow get it to the other client (and vice versa)." That _is_ natpunching. Sounds to me like UDT provides support to allow you to write your own nat punching, it doesn't provide any (which would require a server) – pjcard Apr 12 '18 at 10:15
0

I haven't got an answer here I'm afraid, but I do know that a couple of years ago there was some research done in area that ended up spawning some IETF documents. The curious reader might already be familiar with these:

Community
  • 1
  • 1
conny
  • 9,973
  • 6
  • 38
  • 47