Hi there,
I'm trying to understand NAT hole punching. I've already read
[1] "Peer-to-Peer Communication Across Network Address Translators"
http://www.bford.info/pub/net/p2pnat/
[2] "TCP Connections for P2P Apps: A Software Approach to Solving the
NAT Problem"
http://citeseerx.ist.psu.edu/viewdoc...=rep1&type=pdf
I'd like to reproduce the sequential approach in [2] (or short 4.5 [1]).
To do that I played around with netcat.
On the broker B I listened with `nc -v -v -l -p 3456` (or just `nc -v
-v -l 3456` with more recent netcats). Then I successively connected to
the port. First from X with `nc -p 5678 B 3456`. Then from Y with
`nc -p 5679 B 3456`. So in this step I gathered the IP addresses and the
mapping from X's port 5678 on X's NAT router (let the router be X*) and
Y's port mapping respectively (let Y's router be Y*).
I learned that both NAT routers follow the port preservation design¹, so
the sockets were created from 5678 on X* and from 5679 on Y*
respectively.
I did the hole punching (or better: tried to do) on X with
`nc -p 5678 Y* 5679` and on Y with `nc -p 5679 X* 5678` (two holes
better than one :-) I have repeated this step a few times, but whenever
I created a listening socket on X with `nc -l -p 5678` and tried to
connect from Y with `nc -p 5679 X* 5678` it didn't work. The other way
(from Y to X) didn't work either.
I know I didn't strictly follow the procedure in [2], but I'd still
like to know why it didn't work. Could someone enlighten me?
Regards,
Tobias
¹ see
http://en.wikipedia.org/wiki/Network...ss_translation
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAktkO/gACgkQ5jrP7hWxSO8kbgCeIbaDJqq+d8CTW5HbqmdZC9EF
Zx4An3uco8ewxouWecgXqKtxy8QF+b9E
=7hw5
-----END PGP SIGNATURE-----