BitTorrent Technology How and why it works SE4C03: Computer Networks and Computer Security Last revised: April 03 2005 Name: Nicholas Lake Student Number: 0046314 For: S. Kartik Krishnan
1 Abstract BitTorrent Technology How and why it works The BitTorrent (Torrent) file distribution system is a P2P (peer 2 peer) network that has swept over the internet within the last year. It is so popular that at the moment BitTorrent accounts for almost 35% of all internet traffic and more then 50% of all P2P network traffic. These are staggering numbers considering BitTorrent was developed by Bram Cohen and debut at CodeCon in 2002! However, aside from its popularity BitTorrent has its enemies and rather large enemies at that. They stem from the fact that although BitTorrent was developed essentially to distribute legitimate content, it enables the users to distribute copyrighted material on a massive scale. Thus, with the type of traffic the BitTorrent technology produces you can see why its adversaries include the likes of music and movie industries. Justly, BitTorrent technology and websites that host.torrent files and Trackers are being sued faster then the technology's download rates! BitTorrent Technology The BitTorrent client works by seeking to find Pareto efficiency 1. This according to BitTorrents inventor Bram Cohen, essentially means that the software is trying to create a local optimization algorithm. Pairs of counterparties see if they can improve their lot together, which tend to lead to global optima. The BitTorrent clients main difference from other P2P technologies is that it actively tracks a list of peers that are sharing or downloading a specific file, while other clients work by finding a user with the desired file on their computer. There are four critical elements in a BitTorrent network (Torrent); Trackers.torrent file Seeds Leechers The Tracker is the only part that is not shared in the Torrent node, rather it actively keeps track of all seeders and leechers downloading a given.torrent file. This group of seed and leechers is called the peer set. There is only one.torrent file for each shared content. The.torrent file holds all information about the file to be downloaded; name, size, checksum, and IP address of the Tracker. Seeds are nodes in the Torrent that have complete copies of the desired content. This number starts at 1 and grows exponentially as the file gets more popular and more people have finished downloading. Leechers are nodes in the Torrent ring that have incomplete copies. To download a file, one simply downloads the.torrent file and loads it into a BitTorrent application. If the file is a newly shared, there is only 1one seed and the cost of this is born solely on the original host. But as the file gets more popular and is distributed among a growing amount of connected leechers, the cost is shifted from the host and is distributed among the lechers. This 1 An economic allocation is inefficient if there is an alternative allocation in which all agents are better off in terms of their own objective functions (utilities, profits, payoffs); it is said to be Pareto efficient if there is none such alternative allocation
2 makes hosting a file, with unlimited number of downloads, affordable. Once a leecher is complete they are promoted to seeds and will remain on the network solely as an uploading node until they have closed there connection. A prime example of how this works is described in Jeremy Reyes paper, Cutting Edge Peer-to-Peer File Sharing: BitTorrent " Host A seeds a file that can be arbitrarily divided into 10 data "chunks." Leecher X joins the Torrent and downloads chunks [1,2,3]. Leecher Y then joins the Torrent and instead of connecting to A to get chunks [1,2,3], Y will connect to X and download the chunks from him, while X continues to download from A receiving chunk [4]. While downloading content from X, Y may download a single chunk [5] from A that X does have yet. Y would then share this chunk to X, and X would respond by sharing new chunks it downloaded from A, to Y. Further along in the lifetime of this Torrent yet another leecher may come along and download from the current leechers who have partial datasets before attempting to retrieve non-replicated data from the original seed." The first picture below shows what a normal P2P network looks like (direct download, ftp ect). While the seconds shows what a BitTorrent network would look like. *Normal Network *BitTorrent Network Key feature From the example above this inter-leeching sharing is a key feature to BitTorrent success. It thrives on the algorithm that choose who to download from and which files(parts) to start with when downloading.torrent file. Since order does not matter, files (parts) are downloaded from different sections of a file and are placed in order to create a working file (The BitTorrents actually breaks down piece into sub-piece as to improve the downloading rate). How BitTorrent does this is called, "piece selection" which has four main parts: Strict Priority is a BitTorrent policy that once a sub-piece is selected the remaining sub-pieces from a particular piece are downloaded before any other subpieces can be requested. Next Random First Piece entails that once a user connects to the.torrent, it chooses a random piece in order to get the user into the Torrent ring as soon as possible. Rarest First, is implemented after the user has one completed piece of the file, this allows a user to have a piece that other peers want so uploading can be done
3 to as many peers as possible. Endgame Mode is implemented because when a user request a sub-piece it may transfer very slow, which in the middle of a download is not a problem, but at the end of a download can be a burden. Thus, nearing the end of a download sub-pieces of the file are actively being requested to ensure fast download rates. Once a sub-piece connection is made, the request is cancelled. Finally since Endgame Mode is usually a very short period at the end of the download, very little bandwidth is wasted this way. Reason for its popularity One of the best reasons for its popularity is the fact that for a host, the cost is considerably low. A host is usually in a metered bandwidth environment, in which there are charges for bandwidth use, server crashes and other problems that arise from a file being downloaded by many peers at the same time from their website. BitTorrent changes this by allotting the cost to the users who usually download from a non-metered bandwidth environment. Basically, BitTorrent allows peers to cooperate in order for the success of scalable and robust distribution of files. It allows those who get a host's file to tap into their upload capacity to give the file to others at the same time. Those that provide the most to others get the best treatment in return. On the user side, one sees the benefit of helping others. As you download a file you are instantly uploading to others so instead of only downloading from peers that have a complete file, you are downloading from everyone in the Torrent ring. This conceivably is a utopian world. This cooperative distribution grows almost without limits, since each new participant brings not only demand but also supply. And since each user brings a new resource to the Torrent ring, you get a limitless scalability for a nearly fixed cost. There are numerous website that host Trackers and.torrent files so users can find each other and start the Torrent ring. This makes finding the BitTorrent file you seek quite easy, and with the abundance of BitTorrent applications that organize your torrent files, the technology has never been easier to use. But with great power come great responsibility, and many of these websites are falling under fire from those that feel their utopian society cause more harm then good. Conclusion In December the Motion Picture Association of America (MPAA) filed a suit against websites that served as a hub for BitTorrent seekers. The reason being that a lot of the BitTorrent content is copyrighted DVD s. The MMPA feels that by targeting major BitTorrent website they can stifle the BitTorrent community. But once again this falls into a grey area, because MPAA want to get rid of BitTorrent technology all together. Many believe that this suit is reminiscent to those filed against the VCR in which the VCR was allowed to continue since its initial purpose was not for illegal use. Thus one could argue that BitTorrent initial purpose was not for copyrighted material distribution, but considering more than half of the BitTorrent files are illegal it may be hard to keep this seed growing.
4 References Cohen, Bram. BitTorrent Economics Paper. World Wide Web, http://www.bittorrent.com/documentation.html, May 22 2003. Dessent, Brian. Brian's BitTorrent FAQ and Guide, World Wide Web, http://dessent.net/btfaq/, May 10 2003. Mennecke,Thomas. BitTorrent Remains Powerhouse Network. World Wide Web, http://www.slyck.com/news.php?story=649, January 31 2005. Ryes,Jeremy. Cutting Edge Peer-to-Peer File Sharing: BitTorrent. World Wide Web, http://www.cse.scu.edu/~jholliday/coen150w05/projects/, February 22 2005.