Tcp – How TCP hole punching works

nat;tcpudp

Is TCP Hole Punching similar to UDP hole punching?How it is established between "Peer A" and "Peer B" when both the peers are behind NAT? You can use Peer A and Peer B as example to make it easy to understand.
UDP and TCP hole punching are the most common methods used by torrent, skype for P2P connection and VoIP when peers are behind some type of NAT. Torrent and skype use UDP hole punching for P2P. I'm aware how UDP hole punching works from here: http://www.h-online.com/security/features/How-Skype-Co-get-round-firewalls-747197.html but I find TCP hole punching quite confusing.

Best Answer

The only way to establish a connection between two hosts when they are both behind different NATs is to either configure port-forwarding on the NAT devices, or use a third-party server hosted on a public address externally (in which case there is no direct TCP connection between hosts).