One thing that I find hard to understand is how you're able to connect to a random peer online with just an IP and port combination. The peer is likely behind a NAT proxy, and never communicated with you to begin with. In my head, NAT shouldn't allow this connection through, or be able to associate the port with the individual peer machine since the connection source (you) is arbitrary. This is possible with port for…
However there is a built-in hole punching mechanism in BitTorrent where peers ask for a third peer to assist in hole punching.
It's implemented in my client. It was very painful to implement. I think someone privately funded the feature which was very nice.