How BitTorrent Works

download
Who doesn't love when your files download in no time? Yuri_Arcurs / Getty Images

BitTorrent is a protocol that enables fast downloading of large files using minimum Internet bandwidth. It costs nothing to use and includes no spyware or pop-up advertising.

Unlike other download methods, BitTorrent maximizes transfer speed by gathering pieces of the file you want and downloading these pieces simultaneously from people who already have them. This process makes popular and very large files, such as videos and television programs, download much faster than is possible with other protocols.

Advertisement

In this article, we'll examine how BitTorrent works and how it is different from other file-distribution methods. In addition, you'll learn how to use BitTorrent and what the future might hold for this innovative approach to serving files over the Internet.

Traditional Client-Server Downloading

To understand how BitTorrent works and why it is different from other file-serving methods, let's examine what happens when you download a file from a Web site. It works something like this:

  • You open a Web page and click a link to download a file to your computer.
  • The Web browser software on your computer (the client) tells the server (a central computer that holds the Web page and the file you want to download) to transfer a copy of the file to your computer.
  • The transfer is handled by a protocol (a set of rules), such as FTP (File Transfer Protocol) or HTTP (HyperText Transfer Protocol).
Client-server download process

­The transfer speed is affected by a number of variables, including the type of protocol, the amount of traffic on the server and the number of other computers that are downloading the file. If the file is both large and popular, the demands on the server are great, and the download will be slow.

For more information about Web servers and the traditional client-server download, see How Web Servers Work.

Next, we'll look at how peer-to-peer sharing differs from this process.

Peer-to-peer File Sharing

Gnutella's peer-to-peer download proces

Peer-to-peer file sharing is different from traditional file downloading. In peer-to-peer sharing, you use a software program (rather than your Web browser) to locate computers that have the file you want. Because these are ordinary computers like yours, as opposed to servers, they are called peers. The process works like this:

  • You run peer-to-peer file-sharing software (for example, a Gnutella program) on your computer and send out a request for the file you want to download.
  • To locate the file, the software queries other computers that are connected to the Internet and running the file-sharing software.
  • When the software finds a computer that has the file you want on its hard drive, the download begins.
  • Others using the file-sharing software can obtain files they want from your computer's hard drive.

The file-transfer load is distributed between the computers exchanging files, but file searches and transfers from your computer to others can cause bottlenecks. Some people download files and immediately disconnect without allowing others to obtain files from their system, which is called leeching. This limits the number of computers the software can search for the requested file.

Advertisement

For more information about file sharing and the peer-to-peer download, see How Gnutella Works and How Kazaa Works.

What BitTorrent Does

BitTorrent's peer-to-peer download process

Unlike some other peer-to-peer downloading methods, BitTorrent is a protocol that offloads some of the file tracking work to a central server (called a tracker). Another difference is that it uses a principal called tit-for-tat. This means that in order to receive files, you have to give them. This solves the problem of leeching -- one of developer Bram Cohen's primary goals. With BitTorrent, the more files you share with others, the faster your downloads are. Finally, to make better use of available Internet bandwidth (the pipeline for data transmission), BitTorrent downloads different pieces of the file you want simultaneously from multiple computers.

Here's how it works:

Advertisement

  • You open a Web page and click on a link for the file you want.
  • BitTorrent client software communicates with a tracker to find other computers running BitTorrent that have the complete file (seed computers) and those with a portion of the file (peers that are usually in the process of downloading the file).
  • The tracker identifies the swarm, which is the connected computers that have all of or a portion of the file and are in the process of sending or receiving it.
  • The tracker helps the client software trade pieces of the file you want with other computers in the swarm. Your computer receives multiple pieces of the file simultaneously.
  • If you continue to run the BitTorrent client software after your download is complete, others can receive .torrent files from your computer; your future download rates improve because you are ranked higher in the "tit-for-tat" system.

Downloading pieces of the file at the same time helps solve a common problem with other peer-to-peer download methods: Peers upload at a much slower rate than they download. By downloading multiple pieces at the same time, the overall speed is greatly improved. The more computers involved in the swarm, the faster the file transfer occurs because there are more sources of each piece of the file. For this reason, BitTorrent is especially useful for large, popular files.

Installing and Configuring BitTorrent

To use BitTorrent for file downloads, you need to install the BitTorrent client software. You may also need to tweak your firewall and network router (if you use these) to accept BitTorrent files. We'll give you all the details to get started. But first, here's a synopsis of the steps:

  1. Download and install the BitTorrent client software.
  2. Check and configure firewall and/or router for BitTorrent (if applicable).
  3. Find files to download.
  4. Download and open the .torrent pointer file.
  5. Let BitTorrent give and receive pieces of the file.
  6. Stay connected after the download completes to share your .torrent files with others.
Download the BitTorrent Client Software

BitTorrent is open-source software, which means the program is available to you and to software developers for free (see What does "open source" mean?). Therefore, some developers have created their own versions of BitTorrent software, and you can choose from a number of client programs. (Note: This article assumes you are using the official version. If you want to experiment with different clients, see Brian's BitTorrent FAQ and Guide for a list.)

Advertisement

To start off, go to BitTorrent.com and click the link for the client software that matches your operating system. After you download the client software, double-click on the desktop icon to install it. The installation program is quick, and it displays this window when it is complete:

You'll also see Bram Cohen's Web page, where you can send donations to support development of BitTorrent. Mr. Cohen develops and distributes BitTorrent as open-source software at no cost to users or other developers.

Check and Configure Firewall

If you have a firewall installed on your computer, you will obtain faster download rates if you configure it to have an open pathway for BitTorrent file transfers. A firewall protects your system from intruders by disallowing unauthorized access to your computer's ports. A port is a way for Internet communications to travel into and out of your computer. Ports are numbered, and each communication type has a standard port number. See How Web Servers Work to learn more.

BitTorrent also uses specific port numbers, normally ports 6881 through 6889. Because firewalls block these ports by default, you'll need to configure your firewall to accept this incoming traffic in order to receive .torrent files. You may also have to enable port forwarding of your computer's IP address for ports 6881 through 6889 so that other BitTorrent computers can find you. Because every product is unique, check the documentation or product Web site for your firewall/router for specific instructions on how to accomplish these tasks. You can also check out PortForward.com for help.

Once you have everything set up, you'll probably want to find some files to download. Next, we'll discuss where to look and the legal ramifications of downloading what you find.

Finding and Downloading Torrent Files

After you set up your computer, you're ready to download .torrent files. You can search for the term ".torrent" using an Internet search engine to find sites that offer BitTorrent files. There are also a number of sites dedicated to BitTorrent file searching. These include isoHunt and TorrentSpy. Other sites that offer BitTorrent files directly include bt.etree.org for shareable music, Legal Torrents for music, videos and books, and BT on EFnet for recent television shows.

When you find the file you want, right-click the .torrent link, choose "save target as" and save the file in a convenient place on your computer, such as the Windows desktop. The .torrent file, which is a pointer to the actual file you want, will download quickly. Next, double-click the .torrent file you saved to your computer. The BitTorrent client software displays and starts the download process:

Advertisement

As we mentioned before, the more computers in the sending/receiving swarm, the quicker the download process. If you are downloading a file with only a few other computers in the swarm, the transfer speed will be relatively slow.

After the download is complete, leave the BitTorrent client software open so that other peers can download .torrent files from your computer.*

­Peers using BitTorrent can download only .torrent files from your computer. Once you have a complete copy of a file, your computer becomes a potential seed for that file -- as long as you're still running the software. Sharing what you have causes speedier BitTorrent downloads for you in the future. You can leave the client software running for a few hours or overnight.* Simply close the software when you're done.

Legal Ramifications Similar to other peer-to-peer software, BitTorrent can be used to download copyrighted material. Because BitTorrent handles large files remarkably well, it is especially popular for downloading video files. The Motion Picture Association of America has filed countless lawsuits, causing at least many high-traffic .torrent download sites to shut down.

­ BitTorrent itself is perfectly legal to use. When you select a file to download, however, it is your responsibility to make sure the file not copyrighted. BitTorrent downloads are not anonymous information about your computer's IP address and the files you download can be traced back to you.

Despite its improper use by distributors of copyrighted material, the BitTorrent program itself both legal and innovative. With additions such as tit-for-tat and an open-source philosophy, BitTorrent will likely build a legacy of its own while serving as a bridge to the next generation of file-serving software.

For more information on BitTorrent and related topics, check out the links on the next page.

Lots More Information

Related HowStuffWorks Articles
More Great Links

Sources

  • Bram Cohen's BitTorrent Site http://www.bittorrent.com
  • Brian's BitTorrent FAQ and Guide http://dessent.net/btfaq/
  • How Gnutella Works
  • BitTorrent Tweaks http://userpages.umbc.edu/~hamilton/btclientconfig.html
  • etree http://bt.etree.org
  • BitTorrent 101, About.com. http://netforbeginners.about.com/od/peersharing/a/torrenthandbook.htm
  • "File Sharing's New Face." The New York Times, February 12, 2004.
  • "The BitTorrent Effect." Wired Magazine, January 2005.