Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Why bittorrent needs as many ports?..Why not just one-2? I know that some of them are used for peer discovery, but dont exactly know how is this happening. Can you please provide more technical information about how bittorent works(deeper than its described in wikipedia)?

share|improve this question
    
[citation needed] –  Ignacio Vazquez-Abrams Nov 8 '11 at 6:22
add comment

closed as off topic by Joel Coel, Ward, sam, Iain, Scott Pack Nov 8 '11 at 13:29

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

Google says:

"A BitTorrent client normally associates the TCP port number 6881. However, if this port is busy for some reason, the client will instead try successively higher ports (6882, 6883, and so on up to a limit of 6999). In order for outside BitTorrent clients to reach this one, they must be able to connect to the correct port."

Here is the specification incase you were curious, http://wiki.theory.org/BitTorrentSpecification

share|improve this answer
    
My BitTorrent client doesn't. –  Ignacio Vazquez-Abrams Nov 8 '11 at 6:44
    
I don't think he's asking about the port the server is listening on. I think he's asking about the ports used by the connections. –  David Schwartz Nov 8 '11 at 7:18
    
@David Schwartz and you are right...Sorry for my bad question construction. –  0x49D1 Nov 8 '11 at 7:23
add comment

BitTorrent needs many ports because it makes many outbound connections. Typical operating systems (including Windows, Linux, and most others) only permit a single outbound connection per local port per IP address. All of your inbound connections will use the same local port. But each outbound connection will be assigned a random local port by the operating system.

Your outbound connections will have the remote port that the other client is listening on. Your inbound connections will have essentially random remote ports, since they are allocated by the remote operating system effectively randomly.

Typically, a TCP connection only has a well-known port on the receiving side. BitTorrent is not an exception to the usual rule. Most likely it only seems unusual to you because you're not used to having a large number of inbound connections. Also, some people specifically change their BitTorrent server port, and you have to connect to them on whatever port they happen to be using, whether it's the well-known normal port (6881) or not.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.