Home » Bittorrent
Bittorrent Introduction
Comments (0) 12.08.2007. 04:29
BitTorrent is a peer-to-peer file sharing (P2P) communications protocol. BitTorrent is a method of distributing large amounts of data widely without the original distributor incurring the entire costs of hardware, hosting and bandwidth resources. Instead, when data is distributed using the BitTorrent protocol, recipients each supply data to newer recipients, reducing the cost and burden on any given individual source, providing redundancy against system problems, and reducing dependence upon the original distributor.
The protocol was designed in April 2001, implemented and first released 2 July 2001 by programmer Bram Cohen, and is now maintained by BitTorrent, Inc.
Usage of the protocol accounts for significant traffic on the Internet, but the precise amount has proven difficult to measure.
There are numerous compatible BitTorrent clients, written in a variety of programming languages, and running on a variety of computing platforms.
A BitTorrent client is any program which implements the BitTorrent protocol. Each client is capable of preparing, requesting, and transmitting any type of computer file over a network, using the protocol. A peer is any computer running an instance of a client.
To share a file or group of files, a peer first creates a torrent. This is a small file which contains metadata about the files to be shared, and about the tracker, the computer that coordinates the file distribution. Peers that want to download the file first obtain a torrent file for it, and connect to the specified tracker which tells them from which other peers to download the pieces of the file.
Though both ultimately transfer files over a network, a BitTorrent download differs from a classic full-file HTTP request in several fundamental ways:
- BitTorrent makes many small P2P requests over different TCP sockets, while web-browsers typically make a single HTTP GET request over a single TCP socket.
- BitTorrent downloads in a random or rarest-first approach that ensures high availability, while HTTP downloads in a contiguous manner.
Taken together, BitTorrent achieves much lower cost, much higher redundancy, and much greater resistance to abuse or flash crowds than a regular HTTP server. However, this protection comes at a cost: downloads take time to ramp up to full speed because these many peer connections take time to establish, and it takes time for a node to get sufficient data to become an effective uploader. As such, a typical BitTorrent download will gradually ramp up to very high speeds, and then slowly ramp back down toward the end of the download. This contrasts with an HTTP server that, while more vulnerable to overload and abuse, ramps up to full speed very quickly and maintains this speed throughout.
In general, BitTorrents non-contiguous download methods prevented it from supporting progressive downloads or streaming playback. But recent comments by Bram Cohen and new developments by Red Swoosh suggest that streaming torrent downloads will soon be commonplace.
Downloading torrents and sharing files
Users browse the web to find a torrent of interest, download it, and open it with a BitTorrent client. The client connects to the tracker(s) specified in the torrent file, from which it receives a list of peers currently transferring pieces of the file(s) specified in the torrent. The client connects to those peers to obtain the various pieces. Such a group of peers connected to each other to share a torrent is called a swarm. If the swarm contains only the initial seeder, the client connects directly to it and begins to request pieces. As peers enter the swarm, they begin to trade pieces with one another, instead of downloading directly from the seeder.
Clients incorporate mechanisms to optimize their download and upload rates; for example they download pieces in a random order, to increase the opportunity to exchange data, which is only possible if two peers have different pieces of the file.
The effectiveness of this data exchange depends largely on the policies that clients use to determine to whom to send data. Clients may prefer to send data to peers that send data back to them (a tit for tat scheme), which encourages fair trading. But strict policies often result in suboptimal situations, where newly joined peers are unable to receive any data (because they dont have any pieces yet to trade themselves) and two peers with a good connection between them do not exchange data simply because neither of them wants to take the initiative. To counter these effects, the official BitTorrent client program uses a mechanism called “optimistic unchoking, where the client reserves a portion of its available bandwidth for sending pieces to random peers (not necessarily known-good partners, so called preferred peers), in hopes of discovering even better partners and to ensure that newcomers get a chance to join the swarm.