Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the mechanism behind allowing BitTorrent to work with only outbound connections?

That is, without port forwarding.

Brian's BitTorrent FAQ and Guide says:

BitTorrent will usually work fine in a NAT (network address translation) environment, since it can function with only outbound connections.

Do other peers work as rendezvous servers in this case?

share|improve this question

As far as I know, It works using reverse connections - basically, your client does an outgoing connection which is kept open by the remote machine and they pump data through that same connection.

If everyone used this and no one had ports setup, it would most likely fail. When I have used Bittorent with ports disabled, I get horrendous speeds, but it does work which is why I think it works like this.

share|improve this answer
Why would this method result in lower speeds than if the ports were forwarded? – gsingh2011 May 25 '15 at 3:45
@gsingh2011 there are many reasons... the most common with BT is that it may relay you through other people, so, your download speed can be limited by other people's upload speed. – William Hilsum May 25 '15 at 4:18
For tracker this is right and not a problem. but for download this is not true. because bit torrent download mechanism needs download from other peers. other peers may be behind a NAT (like you). So how bit torrent works behind a NAT? – S.M.Mousavi Dec 13 '15 at 8:03
This is a partial answer regarding general NAT traversal techniques. True question is: How do you know that someone wants to download some file blocks from you, since you don't accept any unsollicited connection? So there only limited possibilities: either the tracker warns you, or you actively connect to several tracker clients to initiate peering sessions (so they could ask for downloads at some point in time), or you only accept requests from peers that you are actively downloading from, or these peers acts as Rendez-Vous points. So, what proposal is implemented in torrent client? – KrisWebDev Feb 27 at 15:41

Normally, people will connect to you to ask for data from you, and you will connect to people asking for data from them.

If incoming connections is impossible, your client will also go out and actively ask to give data to other people (and may do this if incoming connections are possible as well).

You do not upload as much this way, but it's not much of a concern on public trackers.

share|improve this answer

There was a recent podcast on IT Conversations titled How Your ISP Plans to "Help" You, and Break the Internet where Dr. Cullen Jennings talked about various mechanisms for NAT traversals. It's only 15 minutes long and worth a listen.

share|improve this answer

BitTorrent works using P2P connection. Therefore there must be a way to direct connecting to peer. As you know, NAT breaks P2P to working. But there is some solution for this to works. Most (as I know all) is based on STUN protocol.

Each client get its public IP and temporary port number (UDP) using STUN server. STUN server helps client to detect presence of NAT and detecting public ip + temporary port number (assigned by NAT). Then client tries to establish a direct connection to other peer using punching hole technique (see wikipedia).

If you enabled UPnP also there is another solution too.

For more information see NAT Traversal on wikipedia.

share|improve this answer
Thanks for information and correction. – S.M.Mousavi Dec 19 '15 at 16:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .