Monday, February 06, 2006

BitTorrent - Download and play files of all types

If you are using Kazaa or any other p2p network like that, please do a clean install of your PC right now.

Here I will discuss on using Torrent for Sharing Files among your peers.

What is BitTorrent ?

BitTorrent
is the name of a client application for the torrent peer-to-peer (P2P) file distribution protocol created by programmer Bram Cohen using Python Language.

Unlike protocols such as FTP, BitTorrent groups multiple files into a single package called a torrent.

Like other P2P systems, BitTorrent does not use a dedicated server. Instead, the functions of a server are performed by the tracker, peers, and seeds.

The tracker allows clients to communicate with each other. A client -- called a peer when it has downloaded part of the torrent and a seed once it has downloaded the entire torrent -- acts as an additional source for the torrent.

There are many other clients available but BitTorrent is the fastest
and easiest to get you running.

For your Information even "NASA uses BitTorrent".

You can download the Linux vesrion from here

You can install the rpm package (BitTorrent-4.0.1-1.noarch.rpm)

noarch - No Architecture

How do I get started ?

The official BitTorrent distribution includes three client applications. You can use any of these applications to download BitTorrent files:

  • btdownloadheadless.py -- A text-based client that writes the status to standard output. Good for unattended downloads where the output is redirected to a file.
  • btdownloadcurses.py -- A text-based client that provides a pseudographical interface. Good for attended downloads to machines not running a GUI.
  • btdownloadgui.py -- A graphical client.
First thing you do after installing the BitTorrent client software
is search for a .torrent file that you need, say you are searching
for bryan adams songs.

Note : There are many torrent sites available you need to search the net

I go to bittorrents.com and search for Bryan Adams

This will list many sites that has Bryan Adams songs...

I click on link to download the .torrent file.

Usually .torrent files are not more than 25kb in size.

The torrent file contains metadata about all the files it
makes downloadable, including their names and sizes
and checksums of all pieces.

Now say I have downloaded the .torrent file which contains
the information about the things that I need to download
in /home/sriram/Torrent.

Now to dowload the songs I do,

#btdownloadheadless.py --responsefile /home/sriram/Torrent/filename.torrent

Thats it, the songs will now be downloaded.

Once you have downloaded a torrent, it is good manners to allow BitTorrent to continue to run so other clients can upload at least as much information as you have downloaded.

$ btdownloadheadless.py --max_upload_rate 8 --url http://torrent.dulug.duke.edu/heidelberg-binary-i386.torrent

This command uses a URL to specify a .torrent file and saves the downloaded files in a directory named heidelberg (the name of the Fedora release) as specified by the .torrent file.

The --max_upload_rate 8 option prevents BitTorrent from using more than 8 kilobytes per second of upstream bandwidth. BitTorrent usually gives higher download rates to clients that upload more, so feel free to increase this value if you have spare bandwidth. You need to leave enough free upstream bandwidth for the acknowledgment packets from your download to get through or your download will be very slow.

By default the client uploads to a maximum of seven other clients at once. You can change this value by specifying the --max_uploads argument, followed by the maximum number of concurrent uploads you wish to permit. The default value of 7 is usually appropriate for typical broadband connections.

After you give the preceding command, the screen quickly fills with output that looks similar to the following:

saving:        heidelberg-binary-i386
percent done: 0.0
time left: finishing in 27:09:04
download to: /home/max/heidelberg-binary-i386
download rate: 32.9 KB/s
upload rate: 0.0 KB/s
share rating: 0.000 (0.0 MB up / 1.2 MB down)
seed status: 30 seen now, plus 1 distributed copies (2:81.5%, 3:23.0%, 4:2.1%)
peer status: 5 seen now

The file size is that of all the files you are downloading: four ISO images and several smaller files. To abort the download, press Ctrl-C. The download will automatically resume from where it left off when you download the same torrent to the same location again.

Use the following command to perform the same download as in the previous example, this time throttling the rate and number of uploads to values sensible for modem users.

$ btdownloadcurses.py --max_upload_rate 3 --max_uploads 2 --url http://torrent.dulug.duke.edu/heidelberg-binary-i386.torrent

The preceding command displays output similar to the following:

file:     heidelberg-binary-i386
size: 2,467,681,047 (2 GiB)
dest: /home/max/heidelberg-binary-i386
progress: _________________________________________
status: finishing in 6:40:42 (1.0%)
dl speed: 285.6 KB/s
ul speed: 2.6 KB/s
sharing: 0.009 (0.1 MB up / 15.1 MB down)
seeds: 29 seen now, plus 0 distributed copies (1:0.8%, 2:0.0%, 3:0.0%)
peers: 1 seen now

Firewall

BitTorrent uses common ports 6881 to 6889. These should be forwarded to your local IP. In fact, you don't need to open more ports than 6881, since BT listens on that one by default and then goes higher until it stops at 6889. However, if you're running multiple torrents at once, you need to open one port per torrent.

To understand the Terminolgy and Technicalities of
BitTorrent in detail click here

Also check http://www.torrentflux.com, a Torrent Manager.