UDP and NAT

lizard lizard at furcon.de
Wed Apr 1 13:57:41 CEST 2009


i know - that is not a simple solution, but that is the way skype do it:
- client1 connects to a server (1.1.1.1)
- client2 connects to a server (1.1.1.2)
- client1 say to server "i want to connect to client2"
- server to client2, client1 from ip 1.1.1.1 will connect you at sport
10001 and dport 10002
- client2 sends a udp-packet from sport 10002 to 1.1.1.1:10001, this
packet will fail because client1 is behind a nat to. baut now the
nat-router knows 1.1.1.1:10002 to port 10001 is for my nat-client xy
- client1 tries to send a packet to 1.1.1.2:10002 from sport 100001. 
- nat router at client2-side still remember the first packet and think
that this new packet belongs to the connection client2 tried to
establish.
- both clients are talking. yipi ;)

i know know if it is possible to implement in tinc.

see small undetailed wikipedia-article
http://en.wikipedia.com/wiki/UDP_hole_punching


On Wed, 2009-04-01 at 13:06 +0200, Guus Sliepen wrote:
> The problem with NATs is that you don't know what port number will be assigned
> to which connection.




More information about the tinc mailing list