A Selfishness Prevention File Swap Scheme for Bittorrent
Total Page:16
File Type:pdf, Size:1020Kb
This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the IEEE Globecom 2010 proceedings. Odd for Even: A Selfishness Prevention File Swap Scheme for BitTorrent Wang, Miao1, 2 Zhang, Yujun1 Li, Guojie1 1 Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100190, China 2 Graduate School of Chinese Academy of Sciences, Beijing 100049, China {wangm, zhmj, lig}@ict.ac.cn Abstract—The current BitTorrent-like file sharing systems volume of the free-riders etc. suffer from peer selfish behaviors. The uncooperative peers can freeload the compliant peers by various methods. To prevent the Being complementary to the current BitTorrent system, this selfishness, this paper presents a file swap scheme, also known as paper presents odd for even: a selfishness prevention file swap Odd for Even (OFE), as an enhancement to the current scheme for BitTorrent (OFE). OFE designs a file piece swap BitTorrent. With OFE, the file is segmented into odd and even policy between leechers: the initial file distributor divides the pieces; the peers swap the pieces according to “odd first, even file into odd and even pieces; leechers barter these pieces later” rule. To study the performance of OFE against the selfish consistent with “odd first, even later” rule. Specifically, a peer behaviors, a modeling for the related factors is established. We must upload an odd piece to its neighbor for its desired even suggest that by using an appropriate file segmentation policy, the piece; any leecher who receives an odd piece but refuses to free-riders who don’t make any contribution will undergo a give the even one will be chocked forever by its neighbor. As longer download time; the semi-free-riders who only upload odd a result, leechers are motivated to exchange file pieces with pieces, deliberately refuse to provide the even ones to save up half each other and deceivers would be penalized by a longer upload volume will not get their burden lessened. The complete time. We also analyze the correlation among the experimental results show that OFE can punish these selfish download time, the saved upload volume of selfish leechers peers effectively. and other variables including the peer arrival rate, the number of file pieces etc. The experiments show that OFE can Keywords-BitTorrent; file swap;incentive; selfish effectively strike selfish peers and incentive peers to share more resources. I. INTRODUCTION P2P system is designed based on the hypothesis that all II. BITTORRENT OVERVIEW peers in the community would act unselfishly and collaboratively. All participants service each other with their In BitTorrent, a file is divided into multiple pieces. Peers contents and bandwidth. However, without any incentives in download, meanwhile upload the file pieces, and ultimately the system, all peers would tend to be rational and selfish. The own the file. As shown in Fig.1, BitTorrent is composed of selfishness phenomenon has been observed in recent literature. five parts: a group of seeders, a group of torrent files, a web Adar and Huberman [1] report in Gnutella, 66% peers are server, a tracker, and a great number of leechers. free-riders; 73% peers share less than 10 files. Another − The seeder is a peer who has all the pieces of the file but popular P2P file sharing system, eDonkey is also experiencing stays in the system to allow other peers to download 80% free-riders [2]. Study has shown that the selfishness can severely undermine the P2P overall performance [3]. − The torrent file contains meta-data information of the file to BitTorrent [4] is a P2P file distribution protocol whose be downloaded, which includes IP addresses of the tracker, traffic accounts for 27-55% of all Internet traffic [5]. It was the file name and size, and the hash values of individual file usually believed that BitTorrent’s built-in mechanisms pieces for verification including tit-for-fat (TFT) and Optimistic Unchoking strategies would be able to address the selfishness [6][7]. But recent studies reveal that the protection is not enough especially in transfer file fragments fragments front of some vulnerabilities, for example, large view exploit[8][9][10] and Sybil[11] etc. With these attacks, the selfish peers can still freeload leechers and seeders, and then achieve the bandwidth equal to or better than the common peers. Currently some optimized incentive approaches for BitTorrent are documented. However most of them only focus on the algorithm, and miss the corresponding modeling for the involved factors, such as the download time, the saved upload Figure 1. BitTorrent overview This work was supported by the National Natural Science Foundation of China, No. 60803139 and the Key Technology R&D Program of China, No. 2008BAH37B02. 978-1-4244-5637-6/10/$26.00 ©2010 IEEE This full text paper was peer reviewed at the direction of IEEE Communications Society subject matter experts for publication in the IEEE Globecom 2010 proceedings. − The web server provides a website for the torrent files to be IV. OFE MECHANISM published OFE targets the piece exchange between leechers, thus is − The tracker keeps track of all participating peers and helps compatible with other seeder bandwidth allocation or leecher the peers find each other to swap the file pieces selection algorithms to protect from free-riding. This section first specifies the basic principles of OFE, then explains the − The leecher is a peer who only has a portion (or none) of anti-selfish-behaviors nature of OFE, last builds a modeling to the file and does downloading and uploading depict the selfish behaviors in OFE. The torrent file, tracker, leechers, and seeders constitute a BitTorrent swarm. Initially, the seeder segments the file into A. Basic Principles pieces of fixed size (typically 256KB), creates a torrent file, OFE only changes the file piece swap protocol between posts it on a web server and registers to the corresponding leechers, and leaves other parts of BitTorrent unchanged. tracker. Leechers can still employ TFT and optimistic unchoking To download a file, a leecher first retrieves the torrent file strategies to pick the download candidates. from the web server and queries the tracker of the file for a In OFE, the first distributor divides the file into n M-sized partial swarm view. The tracker returns a random list of peers odd pieces and n m-sized even pieces ( M ≥ m ). During the in the swarm. Next the newcomer attempts to establish a piece exchange, peers comply with the “odd first, even later”, connection to each peer in that list; and becomes one neighbor that is, if one leecher wants an even piece from one of its of the peer if the request is accepted. Then the leecher finds neighbors, it needs to upload an odd piece first, then the out the file pieces in each of its neighbors by exchanging a bit- neighbor repays with the even piece that the sender expects. A field message. The leecher picks pieces from its neighbors leecher who delivers an invalid odd piece or who receives the based on the piece selection algorithm such as Local Rarest odd piece, but rejects (beyond a timeout) to upload in return First policy. will be choked eventually. Initially, all neighbor connections are choked (no data transition). For effectiveness and fairness, BitTorrent adopts B. Analysis TFT (tit-for-fat) policy and optimistic unchoking policy to 1) Countering Selfishness Behaviors unchoke a neighbor. In order to encourage users to upload and Free-riding is a typical selfish behavior in BitTorrent. Free- guard against free-riding, BitTorrent utilizes TFT strategy: each riders only download file pieces without uploading. Because peer only opens its outbound bandwidth to a fixed number of of “odd first, even later” rule, a free-rider can’t get the even the peers (4 by default) of the highest downloading rate. On the pieces from any peers except seeders. However since a seeder other hand, to allow each peer to explore the downloading rates is arbitrarily returned in the peer list from the tracker and the of other peers and bootstrap newcomers, the optimistic total number of seeders is always minor, the selfish peer unchoking strategy is used: each peer randomly chooses a doesn’t likely usually come across a seeder. As to the odd requesting leecher to upload regardless of its downloading rate. pieces, the selfish peer can free-ride compliant peers only once Typically, TFT is performed every 10 seconds while optimistic according to the piece swap strategy. If all current neighbors unchoking is attempted once every 30 seconds. are already fooled, it has to wait for new neighbors or new participants. With large view exploit, the uncooperative peer can repeatedly request peer list to expand its neighborhood, III. RELATED WORK thus increase the likelihood of discovering seeders, existing To tackle selfish behaviors, Jun and Ahamad [12] suggest to and new users, and then accelerate the download process. But replace optimistic unchoking by k-TFT scheme with which as long as we determine a large piece number, we argue in the peers continue uploading to others until the deficit (the upload next section that this method can’t help free-riders to shorten amount minus the download amount) exceeds some niceness the download time. number k. Reference [13] develops an auction-based model which enables a proportional-share unchoker to yield faster A selfish peer can be more strategic and compromised downloads against the original BitTorrent. Reference [14] where there are few seeders or limited bandwidth from proposes a seed bandwidth allocation strategy based strictly on seeders. To receive the even file pieces, it may act faithfully to the uploading rate of peers to prevent free-riders from getting upload odd pieces.