How Skype gets round firewalls
h-online.com
h-online.com
Now, Skype's technique is quite interesting and clearly well executed. But it underlines a fundamental problem with trying to glean protocol information from port numbers and SYN packets. Similarly you can "reverse" SSH connections to bypass incoming connection blockers on firewalls.
Besides, philosophically speaking, trying to allow one form of communication but not another is a losing battle. Any communication channel can be used for any purpose. People have been hiding small messages in bigger ones through steganography for a long time. As long as I have friendly server on the outside to reroute my traffic, there's very little you can actually do (Tor anyone?).
Don't even get me started on NATs. Those things make IPv6 look like god's gift to network engineers.
It exploits common default rules in firewalls. ie. to allow web surfing, a firewall will allow port 80, but most of the time it will allow both outbound and inbound 80, rather than just outbound. Skype will listen on a bunch of common ports (80, 25, 110, 443, etc.) and blast out connection requests, and then wait to see which port it actually receives a response on. It will also fall back on using UPnP to find a way through - a protocol that is often overlooked by network admins.
If you netstat while running skype, you will see it listening on a bunch of ports. It often prevents a local web server from starting up. The way it does this is a lot more interesting than the actual NAT punching - skype and kazaa will almost always find a way in and out of a network and they are a pain to block. Joost is also using the same tech stack.
Got HTTP access? Tunnel a command to the server over HTTP and punch the ports
Of course if someone simply disallows access to the skype servers it breaks this approach, Or having a special NAT setup.
All and all hole punching is a cool subject.