Bittorrent – Understanding Connections During Downloading/Seeding

bittorrent

When I open a Bittorrent file, am I connected to ALL of the people who are currently downloading/seeding that Bittorrent file?

Or am I only connected to a subset of people who are currently downloading/seeding that Bittorrent file?

What I'm trying to say is that, let's say 1 million people are currently downloading/seeding this file, will Bittorrent select only 1000 of them (like say based on country, those with nearer locations compared to my IP) or will Bittorrent simply connect me to all of them?

Best Answer

Your client will use a number of methods (consulting a tracker, DHT, and peer exchange) in order to locate all of the peers sharing the file (or as many as possible). It does not, though, connect to all of them. Part of the locating process is determining which parts of the file each peer has. It then only contacts a peer if that peer has a part of the file that you do not have, and it only contacts one peer for each chunk. This limits the maximum number of downloading connections to the number of chunks in the file, although your client will rarely attempt more than say 30 connections simultaneously (your client will try to automatically optimize the number of connections based on your internet service and other factors). Likewise, other peers will contact you if you have a section of the file they do not. If too many peers request chunks at once, your client will start refusing until the connection count goes back down.

You can usually manually configure the maximum number of incoming and outgoing connections that your client will serve, or if you don't manually set a limit, your client will do the maximum possible in consideration of your bandwidth. For example, here are the bandwidth and connection settings in mutorrent: MuTorrent bandwidth settings