Future Generation Computer Systems 24 (2008) 621–630 www.elsevier.com/locate/fgcs
Optimizing the BitTorrent performance using an adaptive peer selection strategy Kun Huang a , Li’e Wang b , Dafang Zhang b,∗ , Yongwei Liu a a School of Computer and Communication, Hunan University, Changsha, Hunan Province 410082, PR China b School of Software, Hunan University, Changsha, Hunan Province 410082, PR China
Received 5 June 2007; received in revised form 12 October 2007; accepted 17 October 2007 Available online 1 November 2007
Abstract BitTorrent employs a static quota-based peer selection strategy to fixedly allocate upload quotas for the Tit-For-Tat (TFT) choke algorithm and Optimistic Unchoke (OU) algorithm. This static quota allocation scheme would incur a paradox of supply and demand between upload peers and request peers. The paradox of supply and demand means that many request peers stay in the starvation state while many upload quotas stay in the idleness state. We propose a dynamic quota-based peer selection strategy, where request peers are classified by the principle of investment return and each upload peer adaptively allocates upload quotas for the TFT and OU algorithms according to dynamically changed numbers of different request peers. Simulation experiments show that our dynamic quota allocation scheme can eliminate the paradox of supply and demand, increase the resource utility ratio of upload peers, and decrease the file download time, at the cost of uploading more a few file blocks for each upload peer. c 2007 Elsevier B.V. All rights reserved.
Keywords: Peer-to-Peer network; Content distribution; Peer selection; Dynamic quota; Paradox of supply and demand
1. Introduction In recent years, the BitTorrent Peer-to-Peer (P2P) content distribution system has become the most popular application in the Internet. According to a recent measurement study [1], BitTorrent traffic accounts for up to 35% of all Internet traffic and presents 53% of all P2P traffic in 2004. Unlike the early P2P content distribution systems such as Gnutella [2], Kazaa [3] and eMule [4], BitTorrent divides a shared file into a number of equal-sized independent blocks and organizes peers interested in the same file into a decentralized P2P overlay network, where each peer simultaneously downloads and uploads multiple blocks. Measurement studies [6–9] have verified the characteristics of scalability, efficiency and robustness of BitTorrent. The block and peer selection strategies are the two keys of a P2P content distribution system. BitTorrent adopts the local rarest first (LRF) algorithm [5,9] as the block selection ∗ Corresponding author. Tel.: +86 0731 8821980.
E-mail address:
[email protected] (D. Zhang). c 2007 Elsevier B.V. All rights reserved. 0167-739X/$ - see front matter doi:10.1016/j.future.2007.10.001
strategy, where each peer preferentially downloads the block that is least replicated among its neighbor peers. Since each peer knows about a list of neighbor peers, it maintains a list of the number of replicated blocks that it does not have among its neighbor peers. Let m be the number of the rarest replicated block, with which neighbor peers are requested preferentially. When the rarest block download is initiated, it removes the rarest block and selects the next rarest block to download. Thus the LRF algorithm is purposed to uniformly distribute blocks among all peers. BitTorrent adopts the Tit-For-Tat (TFT) choke algorithm [5,9] and Optimistic Unchoke (OU) algorithm [5, 9] as the peer selection strategy, where each peer needs to upload blocks to five request peers, then employs the TFT algorithm to preferentially upload to four request peers which upload blocks to it with the highest rates, and employs the OU algorithm to randomly upload to one of other request peers. When each peer receives a list of block requests from the interested neighbor peers, these request peers are ordered according to their download rate to the local peer and four fastest request peers are unchoked to reciprocate. So the TFT algorithm in BitTorrent is introduced to guarantee the upload
622
K. Huang et al. / Future Generation Computer Systems 24 (2008) 621–630
and download reciprocation. In addition, one interested request peer is unchoked at random every a given period, so that the OU algorithm allows new joining peers to receive some blocks to contribute back. Therefore, the TFT algorithm is purposed to fairly exchange blocks between peers, while the OU algorithm complements the TFT algorithm for new joining peers’ startup. Existing BitTorrent employs a static quota-based peer selection strategy to fixedly allocate upload quotas for the TFT and OU algorithms. Upload links are connections which each upload peer keeps with request peers to upload blocks, called upload quotas. To ensure the efficiency and fairness of file download, BitTorrent allows each peer to only upload to five request peers, so each peer has five upload quotas, among which each peer statically allocates four quotas for the TFT algorithm every 10 s and the fifth for the OU algorithm every 30 s [5,9]. When each upload peer receives several requests for downloading blocks, some request peers who have uploaded to it during the given past period would share in four upload quotas of the TFT algorithm, and others would share in one upload quota of the OU algorithm. However, the static quota allocation scheme would incur a paradox of supply and demand between upload peers and request peers in BitTorrent, where many request peers stay in the starvation state while many upload quotas stay in the idleness state. On the one hand, because there are too few upload quotas of the OU algorithm, each upload peer employs the OU algorithm to randomly choose only one request peer with equal probability, which results in many starving request peers who have to wait too long time for the upload quotas. On the other hand, because the TFT algorithm stiffly adheres to the fairness of block exchange, each upload peer does not employ the TFT algorithm to choose these starving request peers to occupy the idleness quotas. For example, when a large number of new peers flash crowd, all upload peers with blocks allocate only one upload quota of the OU algorithm for many request peers, and leave the upload quotas of the TFT algorithm unused although there are too many waiting request peers. Correspondingly, these waiting peers would choke each upload peer with high probability according to the principle of equivalent exchange. Therefore, the paradox of supply and demand would decrease the available resource utility ratio of upload peers, weaken the cooperation between peers, and delay the file download time of BitTorrent. To address the paradox, this paper proposes a dynamic quota-based peer selection strategy in BitTorrent, where request peers are classified by the principle of investment return and each upload peer adaptively allocates upload quotas for the TFT and OU algorithms according to dynamically changed numbers of different request peers. The dynamic quotabased peer selection strategy is an efficiency and fairness trade-off scheme, which sacrifices the fairness of upload quota allocation to improve the efficiency of file download. Simulation experiments show that our dynamic quota allocation scheme can eliminate the paradox of supply and demand, increase the resource utility ratio of upload peers, and decrease the file download time, at the cost of uploading more a few file blocks for each upload peer. Therefore, our main contributions
are twofold. First, to the best of our knowledge, we indicate the paradox of supply and demand in BitTorrent. Second, we propose an adaptive peer selection strategy and carry out experimental evaluation to verify the merits of our proposed solution. The rest of this paper is organized as follows. In Section 2, we present an overview of BitTorrent. Section 3 describes in detailed the paradox of supply and demand in BitTorrent. We present a dynamic quota-based peer selection strategy in Section 4 and give the experimental results in Section 5. Related work is introduced in Section 6 and Section 7 concludes. 2. BitTorrent overview BitTorrent has been widely used to distribute big files such as movies, software and service patches recently. The key idea of BitTorrent is that a shared file is divided into a number of equal-sized independent blocks (typically 256 kB in size) and peers download and upload blocks simultaneously [5]. A torrent is that all peers interested in the same shared file self-organize into a P2P overlay network. BitTorrent has a unique centralized component, called the tracker server, which keeps track of the global information of each torrent, including the IP addresses, ports and numbers of downloaded blocks of all participating peers. In BitTorrent, there are two types of peer, namely seeders and leechers. Seeders are peers who have all blocks of a shared file, while leechers, also called downloaders, are peers who only have a part (or none) of the blocks of a shared file. Thus, seeders do not download but only upload blocks while leechers both download and upload blocks. The file download process of BitTorrent is as follows. First, a user downloads a metadata file of a shared file from a Web site, and starts the BitTorrent client software to join as a new peer. Second, the new peer requests a part of active participating peers from the tracker server, which responds to the new peer with a list of randomly chosen 40 active peers possessing blocks, and then the new peer attempts to establish connection with these active peers as its neighbor peers. Third, the new peer begins to exchange blocks with its neighbor peers in a cooperative manner, and every 30 min reports to the tracker server its state information including downloaded and uploaded blocks. When the number of its neighbor peers dips below the threshold (typically 20 peers), the participating peer again contacts the tracker server to obtain a list of additional neighbor peers. Finally, when completing all the blocks, a leecher turns into a seeder and leaves the system. Generally, BitTorrent goes through three stages in its lifetime: flash crowd, steady state and winding down [7,8,11,12]. Among the three stages, the flash crowd stage is the most challenging for BitTorrent’s performance, so we only focus on the flash crowd stage of BitTorrent. To facilitate the cooperative download, BitTorrent adopts the LRF algorithm [5,9] as the block selection strategy, which is how to request which block from which peer. The LRF algorithm is that a request peer preferentially downloads the missing block that is least replicated among its neighbor peers. The aim of the LRF algorithm is to uniformly distribute all the
K. Huang et al. / Future Generation Computer Systems 24 (2008) 621–630
blocks in the system and avoid the last block problem [5,9], where the peer which has almost downloaded all the blocks has to wait too long time for the last rare blocks it lacks. In addition, the LRF algorithm is desirable to encourage each peer to download different blocks from different neighbor peers to improve the download rate. It is noted that each peer uses the random first strategy for the first four blocks, because it is more important to obtain one block as quickly as possible to start trading with its neighbor peers. After that, it uses the LRF algorithm throughout its remaining lifetime. To facilitate the cooperative upload, BitTorrent adopts the TFT [5,9] and OU algorithms [5,9] as the peer selection strategy, which is how to upload to which peer. Each upload peer employs the TFT algorithm to preferentially upload to four peers who upload blocks to it with the highest rates and employs the OU algorithm to randomly upload to one of other request peers. The aim of the TFT algorithm is to guarantee the fairness of block exchange between peers and deter the freeriding problem [10,15], where a peer only downloads blocks from others but does not contribute to others. Nevertheless, the TFT algorithm would cause the first block problem [5,9], where a new peer cannot obtain the first block to startup the whole file download because it does not have any block to exchange. So the OU algorithm is purposed to both avoid the first block problem to bootstrap new peers and allow each peer to explore other peers which potentially upload to it with the higher rates. In BitTorrent, the total upload quotas of each upload peer are five, among which four upload quotas are statically allocated for the TFT algorithm and the remaining one is allocated for the OU algorithm. Leechers employ the TFT algorithm to choose four request peers to occupy the upload quotas every 10 s and employ the OU algorithm to choose one request peer every 30 s [5,9]. Unlike leechers, seeders choose five request peers to occupy the upload quotas in terms of the available download bandwidth of request peers every 10 s, since seeders only upload blocks [5,9]. 3. Paradox of supply and demand Existing BitTorrent employs a static quota-based peer selection strategy to allocate upload quotas for the TFT and OU algorithms. Each peer is allowed to have only five upload quotas, among which four upload quotas are fixedly allocated for the TFT algorithm and the remaining one is fixedly allocated for the OU algorithm [5,9]. When an upload peer receives requests for downloading blocks, the request peers who have uploaded blocks to it during the given past period would share in four upload quotas of the TFT algorithm, and other request peers such as new peers would share in one upload quota of the OU algorithm. However, this static quota allocation scheme would incur a paradox of supply and demand between upload peers and request peers in BitTorrent, where many request peers stay in the starvation state while many upload quotas stay in the idleness state. The root cause of the paradox of supply and demand is that the OU algorithm has too few upload quotas of the OU algorithm and the TFT algorithm stiffly adheres to
623
the fairness of block exchange. On the one hand, an upload peer employs the OU algorithm to randomly choose only one request peer with the equal probability, which results in many starving request peers who have to wait too long time for the upload quotas. On the other hand, an upload peer does not employ the TFT algorithm to choose these starving request peers to occupy the idleness quotas. In BitTorrent, the TFT algorithm is the most important incentive mechanism, which ensures the fairness of block exchange and reflects the original design principle of titfor-tat, while the OU algorithm is an altruistic mechanism complementing the TFT algorithm. Therefore, to guarantee the fairness and encourage peers to upload more blocks each other, BitTorrent statically allocates more upload quotas for the TFT algorithm than those for the OU algorithm. Although BitTorrent benefits the fairness from the static quota allocation scheme, it gives rise to the paradox of supply and demand between upload peers and request peers, which results in the inefficiency of file download. The paradox of supply and demand exists during the whole download process of BitTorrent, especially in the first block scenario and last block scenario. (1) In the first block scenario, when a new shared file is distributed just now and a mass of new peers without any block join BitTorrent to download the shared file, each upload peer does not employ the TFT algorithm but employs the OU algorithm to randomly upload to one of these new peers with the equal probability 1/n (n is the number of new peers requesting for blocks), which causes many new peers to be starving. Moreover, since only a few request peers share in the upload quotas of the TFT algorithm, many upload quotas of the TFT algorithm are idle. As shown in Fig. 1, the upload peer 0 employs the TFT algorithm to choose the request peer 5 and 2, and employs the OU algorithm to randomly choose the request peer 7 with the probability 1/6, while there are two idle upload quotas and five starving request peers. (2) In the last block scenario, when an upload peer has almost all the blocks and needs a few missing blocks that are rare in the system, a large number of its neighbor peers are more willing to request the upload peer to download blocks. However, most of request peers without the missing blocks that the upload peer needs only share in one upload quota of the OU algorithm with the equal probability 1/m (m is the number of request peers without the missing blocks), while a few other request peers share in four upload quotas of the TFT algorithm. So it also causes many upload quotas of the TFT algorithm not to be utilized and many request peers have to wait too long time to occupy one upload quota of the OU algorithm. As shown in Fig. 2, the upload peer 0 employs the TFT algorithm to choose the request peers 6 and 1, and employs the OU algorithm to randomly choose the request peer 3 with the probability 1/6, while there are two idle upload quotas and five starving request peers. 4. Dynamic quota-based peer selection strategy To address the paradox of supply and demand in BitTorrent, we propose a dynamic quota-based peer selection strategy,
624
K. Huang et al. / Future Generation Computer Systems 24 (2008) 621–630
(a) Request scenario.
(b) Block distribution.
(c) Quota allocation.
Fig. 1. First block scenario.
(a) Request scenario.
(b) Block distribution.
(c) Quota allocation.
Fig. 2. Last block scenario.
where request peers are classified by the principle of investment return and each upload peer adaptively allocates upload quotas for the TFT and OU algorithms according to dynamically changed numbers of different request peers. This section details the dynamic quota allocation scheme, including classifying request peers and allocating dynamic upload quotas. 4.1. Classifying request peers It is assumed that a leecher d has received requests for downloading blocks from a set of request peers, named request peer set Nreq . Given that the leecher d is rational, the leecher preferentially uploads to the profitable request peers in order to maximize the investment return. In BitTorrent, the investment is that the leecher d uploads blocks to a request peer, and the return is that the leecher d downloads blocks from a request peer. When the investment is invariable, to maximize the return, the leecher d preferentially uploads to the request peers from which it downloads more blocks with the highest rates. According to the principle of investment return, there are two classes of request peer: one class is named the high return request peer set Nhigh-return , request peers who have uploaded to the leecher d in a given time; the other is named the low return request peer set Nlow-return , request peers who have not uploaded to the leecher d in a given time. Although the leecher d gives a higher priority to Nhigh-return than to Nlow-return , the
leecher d always ventures to invest Nlow-return , since there are some request peers with potential higher upload rates in Nlow-return . Thus it is satisfied that Nreturn ∪ Nunreturn = Nreq and Nreturn ∩ Nunreturn = ∅. Similarly, according to the principle of investment return, there are also two classes of request peer in Nlow-return : one class is named the urgent request peer set Nurg , consisting of new peers and urgent peers who have the missing blocks that the leecher d needs; the other is named the normal request peer set Nnorm , consisting of the remaining request peers. It is also satisfied that Nurg ∪ Nnorm = Nlow-return and Nurg ∩ Nnorm = ∅. For example, in Fig. 2, the upload peer 0 has the request peer set Nreq = {1, 2, 3, 4, 5, 6, 7, 8}, consisting of the high return request set Nhigh-return = {1, 6} and the low return request set Nlow-return = {2, 3, 4, 5, 7, 8}, which consists of the urgent request peer set Nurg = {2, 3, 8} and the normal request peer set Nnorm = {4, 5, 7}. 4.2. Allocating dynamic upload quotas The leecher d periodically monitors frequently changed different request peers, and then adopts a weight allocation scheme to adaptively allocate upload quotas for the TFT and OU algorithms. Given that the leecher d is allowed to have the total upload quotas Q, according to the number of high and low return request peers, the upload quotas Q tft for the TFT
K. Huang et al. / Future Generation Computer Systems 24 (2008) 621–630
(a) Static quota allocation.
625
(b) Dynamic quota allocation.
Fig. 3. Static vs. dynamic quota allocation in the first block scenario.
(a) Static quota allocation.
(b) Dynamic quota allocation.
Fig. 4. Static vs. dynamic quota allocation in the last block scenario.
algorithm and Q ou for the OU algorithm are allocated by the following formula: |Nhigh-return | · α Q tft = |Nhigh-return | · α + |Nlow-return | · (1 − α) · Q (1) |Nlow-return | · (1 − α) Q ou = ·Q |Nhigh-return | · α + |Nlow-return | · (1 − α) where |S| denotes the length of the set S and α denotes the weight of Nhigh-return . To maximize the investment return, we set α ≥ 0.5, which means Nhigh-return has a higher priority than Nlow-return . The leecher uploads to the preceding Q tft request peers from Nhigh-return , in which all request peers n 1 , n 2 , . . . are sorted descending in terms of the upload rate of blocks in a given time. Likewise, according to the number of urgent and normal request peers, the upload quotas Q urg for the urgent request peer set Nurg and Q norm for the normal request peer set Nnorm are allocated by the following formula: |Nurg | · β Q urg = |Nurg | · β + |Nnorm | · (1 − β) · Q ou (2) |Nnorm | · (1 − β) Q norm = · Q ou |Nurg | · β + |Nnorm | · (1 − β) where |S| denotes the length of the set S and β denotes the weight of Nurg . To maximize the investment return and to fast bootstrap new peers, we set β ≥ 0.5, which means that Nurg has a higher priority than Nnorm . The leecher randomly uploads to the Q urg request peers from Nurg and the Q norm request peers from Nnorm . In real BitTorrent, the leecher d employs the dynamic quotabased peer selection strategy to allocate the upload quotas for the TFT and OU algorithms every 30 s: it chooses the
Q tft request peers to occupy the upload quotas of the TFT algorithms every 10 s, and chooses the Q ou request peers consisting of the Q urg and Q norm request peers to occupy the upload quotas of the OU algorithm every 30 s. Figs. 3 and 4 depict the comparison between the static and dynamic quota-based peer selection strategies with α = 0.7 and β = 0.8 separately corresponding to Figs. 1 and 2. As shown in Fig. 3(b), the upload peer 0 adopts the dynamic quota-based peer selection strategy with formula (1) to allocate the upload quotas Q tft = 2 for TFT and Q ou = 3 for OU, and with formula (2) to allocate the upload quotas Q urg = Q ou = 3 for the urgent set Nurg . Similarly, Fig. 4(b) shows that the upload peer 0 uses formula (1) to dynamically allocate the upload quotas Q tft = 2 for TFT and Q ou = 3 for OU, and uses formula (2) to allocate the upload quotas Q urg = 2 for the urgent set Nurg and Q norm = 1 for the normal set Nnorm . As Figs. 3 and 4 show, the dynamic quota allocation scheme has 100% of the upload quota utility ratio while the static quota allocation scheme has only 60%; there are only three request peers lying in the pending queue in the dynamic quota allocation scheme while there are five request peers lying in the pending queue in the static scheme. 5. Experimental evaluation This section presents our simulation experiments. We first introduce the experimental methodology, and then analyze our experimental results to validate the effectiveness of our proposed dynamic quota allocation scheme. 5.1. Methodology The main metrics of BitTorrent’s performance are the download time, the upload quota utility ratio and the
626
K. Huang et al. / Future Generation Computer Systems 24 (2008) 621–630
(a) Cumulative distribution.
(b) Statistic histogram. Fig. 5. Download time of the first block.
upload/download ratio. The download time includes the download time of the first block, the last block and all blocks. The upload quota utility ratio is the ratio of really utilized upload quotas to theoretically allocated upload quotas. The upload/download ratio is the ratio of the number of uploaded blocks to the number of downloaded blocks. The download time and the upload quota utility ratio characterize the efficiency of BitTorrent, while the upload/download ratio characterizes the fairness of BitTorrent. Our proposed dynamic quota-based peer selection strategy is an efficiency and fairness trade-off scheme, which improves the download time and the upload quota utility ratio at the cost of reducing the upload/download ratio. We design and implement a discrete event driven simulator for BitTorrent, which primarily simulates the peer behavior such as peer joining/leaving, block downloading/uploading, and the main incentive mechanisms such LRF, TFT and OU algorithms in the flash crowd stage. It is noted that we neglect the simulation of the underlying physical network characteristics such as propagation delay, packet transfer and control strategy, and network congestion control strategy, etc. We simulate 1001 peers including 1 initial seeder and 1000 leechers, and each peer has the number of neighbors from 10 to 40 on average. The shared file with size of 100 MB is divided into 400 blocks with each block size 256 kB. The total upload quotas of each peer are five, among which the four and one upload quotas are statically allocated separately for the TFT and OU algorithms in the static quota allocation scheme, and we set the weight α from 0.5 to 1 and β from 0.5 to 1 in the dynamic quota allocation scheme. First, the BitTorrent simulator initializes a torrent with only 1 seeder who has the uplink bandwidth with 6000 KBps and permanently stays in the system until terminating the simulation. Second, 1000 new peers join BitTorrent in one hour’s time, following a Poisson distribution, and start the file download process. Finally, when completing all the blocks, a leecher turns into a seeder and stays a random period time (from 0 to 90 s) before leaving the system. We consider a heterogeneous setting in BitTorrent, where there are three kinds of uplink/downlink bandwidth for leechers: low-rate peer (128/784 KBps), mid-rate peer
(400/1500 KBps), and high-rate peer (3000/6000 KBps). In the following experimental results, the three kinds of leecher have equal numbers in the simulation, and randomly and disorderly join in a torrent to download the shared file. 5.2. Analyzing results We compare the static quota-based peer selection strategy to the dynamic quota-based peer selection strategy in terms of the download time of the first block, the last block and all blocks, the upload quota utility ratio, and the upload/download ratio. The experimental results only focus on the performance metrics of 1000 leechers in the simulation experiments. Fig. 5 depicts the download time of the first block including the cumulative distribution over time and the statistic histogram. As shown in Fig. 5, compared to the static quota allocation scheme, the dynamic scheme has smaller download time of the first block. For example, in 200 s, the dynamic scheme has 96%–97% peers completing the first block while the static scheme has only 83% peers, as seen in Fig. 5(a). Moreover, Fig. 5(b) shows that compared to the static scheme, the dynamic scheme decreases the mean download time of the first block by 59%–60%, and remarkably decreases both the standard deviation of the download time and the maximum download time, which indicates that the dynamic scheme has a smooth download time of the first block. Fig. 6 depicts the download time of the last block including the cumulative distribution over time and the statistic histogram. As shown in Fig. 6, the dynamic quota allocation scheme has a smaller download time of the last block than the static quota allocation scheme. Because new peers leave the system after completing the last block, other peers who have not completed the last block have to wait too long a time for the last block. For example, there is the slow increasing number of cumulative peers completing the last block after 800 s, as seen in Fig. 6(a). Moreover, Fig. 6(b) shows that compared to the static scheme, the dynamic scheme decreases the mean download time of the last block by 61%–63%, and remarkably decreases both the standard deviation of the download time and
K. Huang et al. / Future Generation Computer Systems 24 (2008) 621–630
(a) Cumulative distribution.
627
(b) Statistic histogram. Fig. 6. Download time of the last block.
(a) Cumulative distribution.
(b) Statistic histogram. Fig. 7. Download time of all blocks.
the maximum download time, which indicates that the dynamic scheme has a smooth download time of the last block. Fig. 7 depicts the download time of all blocks including the cumulative distribution over time and the statistic histogram. As shown in Fig. 7, the dynamic quota allocation scheme has a smaller download time of all blocks than the static quota allocation scheme. For example, in 6000 s, the dynamic scheme has 95%–97% peers completing all blocks while the static scheme has only 3% peers, as seen in Fig. 7(a). Moreover, Fig. 7(b) shows that compared to the static scheme, the dynamic scheme decreases the mean download time of all the blocks by 62%–63%, and remarkably decreases both the standard deviation of the download time and the maximum download time, which indicates that the dynamic scheme has a smooth download time of all the blocks. Also, Fig. 8 shows that in 8000 s, 936–951 leechers turn into seeders in the dynamic scheme, while only 591 leechers turn into seeds in the static scheme. Fig. 9 depicts the statistic histogram of the upload quota utility ratio. As shown in Fig. 9, compared to the static scheme, the dynamic quota allocation scheme has the mean, minimum, and maximum values of the upload quota utility ratio separately
Fig. 8. Distribution of seeders.
by about 3, 1.6, and 2.2 factors, which indicates that the dynamic scheme improves the resource utility ratio of upload peers to facilitate BitTorrent’s performance increased. Fig. 10 depicts the upload/download ratio including the ratio distribution and the statistic histogram. The selfish peers
628
K. Huang et al. / Future Generation Computer Systems 24 (2008) 621–630
α → 0.5 or β → 0.5, the heterogeneity between different peers such as the standard deviation of the download time would be weakened, while the homogeneity of all the peers such as the average download time would be strengthened. 6. Related work
Fig. 9. Upload quota utility ratio.
have an upload/download ratio with 0–0.5, the fair peers have an upload/download ratio with 0.5–1.5, and the selfless peers have an upload/download ratio with more than 1.5. As shown in Fig. 10(a), in the dynamic scheme, the fair peers occupy about 71% and the selfish and selfless peers occupy about 29%, while in the static scheme, the former occupies only about 52% and the latter occupies about 48%. However, Fig. 10(b) shows that compared to the static scheme, the dynamic scheme has each peer uploading more than 2–4 blocks on average and totally uploading more than 1990–4162 blocks during the file download process, which is an acceptable cost to improve the efficiency of file download in BitTorrent. Different values of the weights α and β impact on the performance of BitTorrent. When the weight α → 0.5, upload peers uniformly allocate upload quotas for the TFT and OU algorithms, which would decrease the average download time of the first block (seen in Fig. 5(b)) and increase the average download time of the last block (seen in Fig. 6(b)). Likewise, when the weight β → 0.5, upload peers uniformly allocate upload quotas for the urgent and normal request peer sets, which would also decrease the average download time of the first block (seen in Fig. 5(b)) and increase the average download time of the last block (seen in Fig. 6(b)). Therefore, when
(a) Ratio distribution.
BitTorrent has been one of the successfully deployed largescale P2P content distribution systems in the Internet, which has attracted many research communities. There are several analytical and measurement-based studies of the BitTorrent performance. Analytical models are proposed to understand the BitTorrent performance. Yang et al. [13] propose a branch process to analyze the service capacity of BitTorrent in the transient regime when a new shared file is distributed, and present a Markov chain model to study the BitTorrent performance during the steady state stage. Qiu and Srikant [6] propose a simple fluid model to study the BitTorrent performance during the steady state stage and conclude that when the uplink and downlink bandwidths are the bottleneck for the service capacity, BitTorrent achieves good efficiency and stability. Rai et al. [23] provide an analytical model of the BitTorrent protocol, split the download process of each peer into three phases, and indicate that the stability of the BitTorrent protocol depends heavily on the number of divided file blocks and the arrival rate of peers. Guo et al. [8] indicate the limitations of the BitTorrent performance such as instability and unfairness and build a graph-based multi-torrent model to study inter-torrent collaboration. Tian et al. [12] propose a mathematical model to explore the behavior of each peer and BitTorrent performance, find that the distribution of the download peers follows a Ushaped curve during the steady state stage, and analyze the file availability and the dying process of BitTorrent. Measurement studies are performed to characterize the BitTorrent traffic and behavior. Izal et al. [7] analyze a fivemonth workload of BitTorrent with thousands of participating peers from the tracker logs of real torrents and assess the performance of the algorithms used in BitTorrent during the
(b) Statistic histogram. Fig. 10. Upload/download ratio.
K. Huang et al. / Future Generation Computer Systems 24 (2008) 621–630
flash crowd stage. Pouwelse et al. [14] explore the availability, integrity, flash crowd handling and download performance of BitTorrent, and find that the arrival, abort and departure processes of downloading peers do not follow a Poisson distribution in an eight-month trace and that there exists a tension between the availability and data integrity. Guo et al. [8] also conduct a measurement to discover that BitTorrent suffers from poor availability, fluctuant quality of service, and a freeriding problem. Bharambe et al. [11] present a simulationbased study of BitTorrent to evaluate the impact of its core mechanisms on the BitTorrent performance, and confirm the near-optimal performance in terms of uplink bandwidth utilization and download time. Wei et al. [24] discuss the feasibility of a BitTorrent-based destop grid architecture, and measure the basic characteristics of BitTorrent in terms of latency and bandwidth to evaluate the scalability of BitTorrent for the delivery of large input files. Moreover, there are recent studies for enhancing the efficiency and fairness of BitTorrent. In [12], a new TFT algorithm is proposed to lengthen the system lifetime and improve the file availability and system stability in BitTorrent. In [11], a pairwise block-level TFT algorithm is proposed to eliminate the unfairness of the upload service, and a smartseed strategy is introduced to save the available bandwidths of seeders and decrease the duplications of blocks. In [16], a biased neighbor selection strategy is proposed to reduce the cross-ISP traffic and cost of BitTorrent. In [25,26], selfish BitTorrent client softwares are implemented and deployed in real public torrents, and experimental results indicate that altruistic peers dominate the performance of BitTorrent and selfish peers hurt the average per–swam performance. In [27], the peer selection strategy in BitTorrent is investigated experimentally to discover that an underprovisioned initial seed leads to absence of peer clustering and less effective sharing incentives. Also, the P2P content distribution systems that employ a BitTorrent-like swarming approach, such as SplitStream [17], Slurpie [18], Coupon [22], Bullet [19], Bullet’ [20] and Avalanche [21], are proposed to enhance the system performance and robustness under the heterogeneous settings. Compared to above related work, our contribution is to first indicate the paradox of supply and demand between upload peers and request peers in BitTorrent and to propose a dynamic quota-based peer selection strategy, which is an efficiency and fairness trade-off scheme to optimize the BitTorrent performance. 7. Conclusions This paper indicates the paradox of supply and demand between upload peers and request peers in BitTorrent, where many request peers stay in the starvation state while many upload quotas stay in the idleness state. To address the paradox problem, we propose a dynamic quota-based peer selection strategy, where request peers are classified by the principle of investment return and each upload peer adaptively allocates upload quotas for the TFT and OU algorithms according to
629
dynamically changed numbers of different request peers. The dynamic quota-based peer selection strategy is an efficiency and fairness trade-off scheme, which sacrifices the fairness of upload quota allocation to improve the efficiency of file download. Our simulation experiments show that compared to the static quota allocation scheme, our proposed dynamic quota allocation scheme decreases the mean download time of the first block by 59%–60%, the mean download time of the last block by 61%–63% and the mean download time of all blocks by 62%–63%, and has a smooth download time between different peers; moreover, compared to the static scheme, the dynamic scheme has increased the mean upload quota utility ratio by a factor of about 3; however, the dynamic quota allocation scheme needs each peer to upload more 2–4 blocks on average than the static scheme, which is the acceptable cost to improve the efficiency of file download of BitTorrent. Therefore, the dynamic quota-based peer selection strategy is an effective and efficient incentive mechanism for BitTorrent to both increase the resource utility ratio of upload peers and decrease the file download time, which may be applied to other P2P content distribution systems. Acknowledgments This work is supported by the National Science Foundation of China under grant 60473031 and grant 60673155, and the Eleventh Five-Year Plan of National Defense Basic Scientific Research of China under grant A1420060162. References [1] A. Parker, The true picture of Peer-to-Peer file sharing. http://www. cachelogic.com, 2004. [2] http://www.gnutelliums.com/. [3] http://www.kazaa.com/. [4] http://www.emule.org/. [5] B. Cohen, Incentives build robustness in BitTorrent, in: Proc. of Workshop on Economics of Peer-to-Peer Systems, Berkeley, CA, 2003. [6] D. Qiu, R. Srikant, Modeling and performance analysis of BitTorrentlike Peer-to-Peer networks, in: Proc. of ACM SIGCOMM 2004, Portland, Oregon, 2004. [7] M. Izal, G. Urvoy-Keller, E.W. Biersack, et al., Dissecting BitTorrent: Five months in a Torrent’s lifetime, in: Proc. of the 5th Passive and Active Measurements Workshop 2004, France, 2004. [8] L. Guo, S. Chen, Z. Xiao, et al., Measurements, analysis, and modeling of BitTorrent-like systems, in: Proc. of IMC 2005, Berkeley, CA, 2005. [9] A. Legout, G. Urvoy-Keller, P. Michiardi, Rarest first and choke algorithms are enough, in: Proc. of IMC 2006, Rio de Janeiro, Brazil, 2006. [10] M. Feldman, C. Papadimitriou, J. Chuang, et al., Free-riding and whitewashing in Peer-to-Peer systems, in: Proc. of the 3rd Annual Workshop on Economics and Information Security 2004, Minnesota, 2004. [11] A.R. Bharambe, C. Herley, V.N. Padmanabhan, Analyzing and improving a BitTorrent network’s performance mechanisms, in: Proc. of IEEE INFOCOM 2006, Barcelona, Spain, 2006. [12] Y. Tian, D. Wu, K.W. Ng, Modeling, analysis and improvement for BitTorrent-like file sharing networks, in: Proc. of IEEE INFOCOM 2006, Barcelona, Spain, 2006. [13] X. Yang, G. de Veciana, Service capacity of peer to peer networks, in: Proc. of IEEE INFOCOM 2004, Hong Kong, China, 2004.
630
K. Huang et al. / Future Generation Computer Systems 24 (2008) 621–630
[14] J. Pouwelse, P. Garbacki, D. Epema, et al., The BitTorrent P2P file-sharing system: Measurements and analysis, in: Proc. of IPTPS 2005, New York, 2005. [15] N. Liogkas, R. Nelson, E. Kohler, et al., Exploiting BitTorrent for fun (But Not Profit), in: Proc. of IPTPS 2006, Santa Barbara, CA, 2006. [16] R. Bindal, P. Cao, W. Chan, et al., Improving traffic locality in BitTorrent via biased neighbor selection, in: Proc. of IEEE ICDCS 2006, Lisboa, Portugal, 2006. [17] M. Castro, P. Druschel, A.M. Kermarrec, et al., SplitStream: Highbandwidth multicast in cooperative environments, in: Proc. of the 19th ACM SOSP. Bolton Landing, 2003. [18] R. Sherwood, R. Braud, B. Bhattacharjee, Slurpie: A cooperative bulk data transfer protocol, in: Proc. of IEEE INFOCOM 2004, Hong Kong, China, 2004. [19] D. Kostic, A. Rodriguez, J. Albrecht, et al., Bullet: High bandwidth data dissemination using an overlay mesh, in: Proc. of the 19th ACM SOSP, Bolton Landing, 2003. [20] D. Kostic, R. Braud, C. Killian, et al., Maintaining high bandwidth under dynamic network conditions, in: Proc. of USENIX 2005, Anaheim, CA, 2005. [21] C. Gkantsidis, P. Rodriguez, Network coding for large scale content distribution, in: Proc. of IEEE INFOCOM 2005, Miami, FL, 2005. [22] L. Massoulie, M. Vojnovic, Coupon replication systems, in: Proc. of ACM SIGMETRICS, New York, USA, 2005. [23] V. Rai, S. Sivasubramanian, S. Bhulai, et al., A multiphased approach for modeling and analysis of the BitTorrent protocol, in: Proc. of IEEE ICDCS 2007, Toronto, Canada, 2007. [24] B. Wei, G. Fedak, F. Cappello, Towards efficient data distribution on computational destop grids with BitTorrent, Future Generation Computer Systems 23 (8) (2007) 983–989. [25] M. Sirvianos, J.H. Park, R. Chen, et al., Free-riding in BitTorrent networks with the large view exploit, in: Proc. of IPTPS 2007, Bellevue, WA, 2007. [26] M. Piatek, T. Isdal, T. Anderson, et al., Do incentives build robustness in BitTorrent? in: Proc of NSDI 2007, Cambridge, MA, 2007. [27] A. Legout, N. Liogkas, E. Kohler, et al., Clustering and sharing incentives in BitTorrent systems, in: Proc. of SIGMETICS 2007, San Diego, CA, 2007.
Kun Huang received his B.S. and M.S. degrees in Computer Science from Hunan University, China, in 2001 and 2004, respectively. He is currently a Ph.D. student in School of Computer and Communication at Hunan University. His research interests include peerto-peer computing, intrusion detection, and survival systems. His email address is
[email protected].
Li’e Wang received her B.S. degree in Computer Science from Changsha University of Science & Technology, China, in 2003. She is currently a Master graduate student in School of Software at Hunan University. Her research interests include peer-to-peer computing and survival systems. Her email address is
[email protected].
Dafang Zhang is a Professor of Computer Science at Hunan University. He received the Ph.D. degree from Hunan University. He specializes in dependable systems and networks, fault-tolerant computing, network measurement, network security, and peer-to-peer computing. He has published over 200 original scientific papers and 11 popular books in these area. Presently, he leads 3 projects funded by the National Science Foundation of China and the Eleventh Five-Year Plan of National Defense Basic Scientific Research of China. Contact him at
[email protected]. Yongwei Liu received his B.S. degree in Computer Science from Xiangtan University, China, in 2005. He is currently a Master graduate student in School of Computer and Communication at Hunan University. His research interest is peer-to-peer computing. His email address is liu
[email protected].