How does BitTorrent work with only outbound connections?

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?

6 Answers

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.

4

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.

0

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.

The peers behind a NAT work through a technique called "Hole punching". There are two types of "Hole punching" for UDP and TCP, but essential idea is the same. But there is a third facilitator also sometimes called as rendezvous server which helps two peers make a connection. In case of BitTorrent a third peer may act as a rendezvous server to facilitate two other peers make a connection. From the perspective of peers intending to communicate there is only an outgoing connection from either side.

it is important to note that Hole punching may work for 60 - 70 % NATS but not necessarily all of them, because the technique depends on the NAT mapping between local and public end points made by the NAT server. if NAT server has a slightly different approach to make those mappings which are not easily predictable then hole punching does not work.

Yes, other peers help the parties to establish the connection. It's described in BEP 55:

In a nutshell, it's an implementation of adapted for the distributed nature of the BitTorrent protocol.

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like