Computers 'n Stuff: Step by Step Howto on using BitTorrent to download files

I here share the resolutions for my Linux problems so they might safe somebody some time.

Saturday, April 30, 2005 parmanent link to this post

Step by Step Howto on using BitTorrent to download files

BitTorrent is a new peer to peer file sharing network protocol developed by Bram Cohen. If you lik it you should donate to him.

1. You will need a BitTorrent client to use BitTorrent.
Here are the most commonly used and probably the best:

  1. Azureus A Java Based Bittorent
  2. BitComet a powerful C++ client which is working automatically from behind NAT (Network Adress Translation, IP-masqherading) routers
Further not so commonly used yet very good stabele and fast BitTorrent clients which do not use much CPU power, though these are no eye catcher except may be ABC:
  1. BitTorrent The origianl BitTorrent Client from the developper of the BitTorrent protocol Bram Cohen Thanks a lot for the protocol.
  2. BitTornado A client extending the BitTorrent core thus supporting some experimental code for new sharing protocols.
  3. ABC [yet another Bittorent Client] A client based on the BitTornado client with an imporved front end supporting imporved queing capabilities.
More information on not so common clients here.

2. What you need next is to find the torrent.

Search for Torrent Files



A torrent is a small file containing the meta data of the file you actually want to download. It is used to feed the BitTorrent client with the information it needs to download the file you want. You can find the most torrents here:

Each WebSite offers a search option. When you find more thant one torrent for the file you need then choose the one with the most seeders in relation to the leechers. Seeds have the complete file and only upload it whereas leachers have only partially downloaded the file and will usually upload to those peers where they get the most downloadbandwitdth from. Then choose the torrent with most participants. Note, Though it is possible that the swarm of leechers holds the complete file it is also possible that you wont be able to complete the file if you download a torrent without as seeder. A seeder in other words proves that all files of the torrent are present among the peers perticipating in the torrent.

3. Download the *.torrent file
Next you use the File download capability of your Browser to download the "*.torrent" file where * denotes the name of the torrent file which is usually a discription of the file you want to download. The download of the *.torrent file is usually initiated when you klick on the download or start download button next to the discription of the torrent. Most BitTorrent Clients integrate seemless into you browser since the browser downloads the torrent file and opens it with its default application which happens to be your Torrent client and so the download should start right away. If not, open the torrent-file saved to your hard drive from within the torrent client (e.g. Azureus or BitComet).

4. What happens now, and what does the tracker.
With the information the Torrent Client finds in the *.torrent file it will handle the download of the file you actually want. It will connect to the tracker, a server knowing all the IP-adresses of the peers sharing the file of a torrent, that is handling your torrent. Your client finds the IP-adress of the handling tracker in the *.torrent file you loaded into the client.
The Client will transmit (announce) its own IP adress to the tracker and recieve ip adresses of other clients who have the same file to share. Your client will then attempt to establish connections to peers (other computers running a torrent client) he got to know from the tracker to download the files you want.
Furthermore since your IP-Adress is announced by the tracker to other peers they will try to establish a remote connection to your peer.

5. Open ports 6881-6889
Since it is important that remote connections to your computer can be established to optimize download speed you should make sure that your computer can be reached from the internet. Using a Firewall ports 6881 to 6889 have to be opened. Otherwise inbound traffic comming from the internet to your computer will be blocked.

If you are using NAT these ports have to be forwarded to the IP-Adress of the mashine your torrent Client is running on. If these ports are not forwarded peers from the internet will only reach you router. The NAT router decides depending upon the port the packets are adressed to what to do whith the IP-packets. If they are adressed to the port so and so (eg 6881) the router will send those IP-packets to the mashine you are running your Client on if you activated port forwarding. A port will always be forwarded to only one ip-Adress behind the router.

Today many Bittorrent client support Universal Plug & Play (UnPnP) protocol. If you also have a router with an UnPnP option , you can enable the option on both client and router and the ports specified in your client will be forwarded to your mashine automatically.

With most bittorent clients it is possible to configure the port the client should connect to, so you don't have to use 6881 all the time. Changing ports might be useful for two reasons:
1. Internet providers (ISP) use traffic fiters to block bittorent traffic by blocking the standard ports of this protocoll.
2. I you want to use more that 1 client behind a NAT router assign an individual port range to each client and forward it to them by the router accordingly.

6. Tweak your upload speed
If you want to downlaod using a TCP connection then for each packet you recieve will be acknowledged by your computer sending a ACK packet to the sender of the packet your computer just recieved. My experiance is that 10 kB/s downloads use aproximately 1 kB/s upstream bandwidth. Then you have to conisder the system overhead. The system uses also some upstream bandwidth to keep up the connections and so on. So ist usually not a good idea to use all your upoadbandwith to upload to the torrent swarm because this makes downloads almost impossible. But remember that using BitTorrent you trade in your uploads for downloads from other peers so if your decrease ur upload bandwith too much you will loose download bandwith as well. So you have to find the maximium upload bandwith, which is not decreasing download bandwith.

A good idea is to use traffic shaping. This will give your ACK packages a higher priority and make sure they get through even tough you have uploads. This way you can set upload speed close to maximum and the traffic shaper will automatically reduce upload bandwidth for clients dynamically if more bandwith is used to maintain download speed. The following tools can accoplish this task:

1. cFos: traffic shaping for windows
2. wondershaper: traffic shaping for linux
3. prioritizing interactive traffic for linux

An aditional benefit of traffic shaping is that applications using HTML and FTP get a higher priority. This means that Web pages load almost as quick as they would load without bittorrent. Since bittorent dowloads take forever this keeps your connection usable at all times. Yet, for onlinegames like Doom you can still feel the slower connection although it becmes playable again by the use of traffic shapers.

The drawback of traffic shapers certainly is that they limit the maximal bandwidth. Therfore, traffic shaping makes no sense if you have only one application which needs the full bandwidth in one direction only. But the improvement on responsiveness of interactive application outweigth the perforamnce loss by far if

1. multiple applications with different sevice types/prioritis acces your internet connection at the same time or
2. if you are downloading and uploading at the same time.

7. Share
"give and you shalt recieve". Remember to share your downloaded files as long as you can. Otherwise the a peer to peer network doesen't work. Share files at least until you reach a share ratio of 1. The share ratio represents the upload to download ratio of your BitTorrent client:
filesize uploaded divided by filesize downloaded eg. :
1MB ul /2 MB dl = share ratio of 0.5 (50%)



0 Comments:

Post a Comment

<< Home