Ports that are always open? How does softwares like bittorrent manage to communicate even without port forwarding

bittorrentnetwork-protocolsnetworkingp2pport-forwarding

How come bittorrent clients manage to communicate to servers and other peers even if the user has not configured port forwarding on their routers?

Of course the speed will be reduced compared to when port forwarding is done, but still they manage to communicate? How???

Are there any inbound ports which are always open?

Best Answer

Inbound connections are accomplished by a third peer.

Say peer A wants to connect to peer F which is behind a firewall. Then peer A instructs peer B which is already connected to F that it wants to connect to F. F then gets the message and connects instead to A. I do not know the interna of the BT protocol, but B could be e.g. the tracker as it is well-known to both peers. For this scenario to work, A must accept incoming connections. AFAIK in Gnutella, F's ultrapeer played the role of B. This scenario generally works for TCP.

For UDP connections, check also UDP hole punching.