Bandwidth trading in BitTorrent-like P2P networks for content distribution

Bandwidth trading in BitTorrent-like P2P networks for content distribution

Available online at www.sciencedirect.com Computer Communications 31 (2008) 201–211 www.elsevier.com/locate/comcom Bandwidth trading in BitTorrent-l...

614KB Sizes 1 Downloads 71 Views

Available online at www.sciencedirect.com

Computer Communications 31 (2008) 201–211 www.elsevier.com/locate/comcom

Bandwidth trading in BitTorrent-like P2P networks for content distribution q Kolja Eger *, Ulrich Killat Institute of Communication Networks, Hamburg University of Technology (TUHH), 21071 Hamburg, Germany Available online 14 August 2007

Abstract Bandwidth trading schemes give peers an incentive to provide upload bandwidth to other peers in a P2P network for fast file distribution. A popular example is the tit-for-tat strategy used in the BitTorrent protocol. Although this game theoretical scheme provides an incentive to peers to contribute resources to the network it does not prevent unfairness and the performances of peers vary considerably. Therefore, we propose two new trading schemes, which are based on pricing. One uses explicit price information whereas the other scheme uses the download rates from other peers as the price. For both distributed algorithms the stable point provides a fair resource allocation as well as a Nash equilibrium. Thus, fairness is preserved although peers behave selfishly and try to maximize their own download rates only. We compare both pricing schemes with BitTorrent in simulations of static and dynamic networks. In BitTorrent peers receive different download rates even if they provide the same upload bandwidth. Furthermore, peers with small upload capacities compared to others receive considerably more than what they contribute. The pricing algorithms outperform BitTorrent with respect to fairness. With both algorithms a peer receives a download performance proportional to its upload capacity. With explicit prices the download rates converge faster to the fair equilibrium than with implicit ones. Ó 2007 Elsevier B.V. All rights reserved. Keywords: Peer-to-Peer; Content distribution; Fairness; Incentive schemes; BitTorrent; Resource Pricing

1. Introduction The Peer-to-Peer (P2P) paradigm offers obvious advantages for the fast distribution of large content in the Internet. While in the client/server architecture the total load must be carried by the server(s), it is distributed across the users in a P2P network. But the cooperation of peers is not a matter of course. P2P faces the problem of free-riding [1] where peers consume resources solely without contributing anything to the network. Therefore, reputation systems and/or incentive mechanisms are implemented in P2P applications frequently.

q

Part of this work was presented at IEEE P2P 2006. Corresponding author. Tel.: +4940428783480. E-mail addresses: [email protected] (K. Eger), [email protected] (U. Killat). *

0140-3664/$ - see front matter Ó 2007 Elsevier B.V. All rights reserved. doi:10.1016/j.comcom.2007.08.005

A very interesting approach is the so-called swarming principle. Here, the file of interest is fragmented into blocks. When a peer completes the download of a single block, it offers it to other peers that so far have not downloaded this block. Thus, peers exchange blocks with each other although they did not finish the download of the complete file. Therefore, the resources in the P2P network are used more efficiently and the network depends not solely on the altruistic or cooperative behavior of the peers. The swarming principle rather exploits the two-way interest of peers in different blocks, which the other one provides. Since most of the peers behave selfishly and are interested in maximizing their own download rates, the mutual interest results in peers, which bargain for bandwidth with each other. Hence, the swarming principle supports also content distribution in a non-cooperative environment. A very popular example is the BitTorrent protocol [2] where a peer uploads to others from which it receives the

202

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211

highest download rates. This strategy is inspired by the titfor-tat principle that is well known from game theory. Here, a player adopts the strategy, which his opponent used in the previous round. By cooperating in the first step the tit-for-tat strategy proved very effective in the repeated prisoner’s dilemma [3]. Unfortunately, simulation-based studies for BitTorrent reveal a high variability in the download rates [4] and unfairness in terms of the ratio of uploaded to downloaded data [5]. This means that some peers are better off by using the tit-for-tat strategy than the others. These results raise two questions. Firstly, from the user perspective: Does another strategy exist which outperforms BitTorrent’s tit-for-tat strategy? This means with such kind of strategy a user can increase his download performance. Since the total capacity in the network is finite this happens at the expense of others. Secondly, from the angle of a protocol designer: Does a strategy exist which ensures fairness between peers although peers behave selfishly? This work tries to answer the second question. Thereby, we compare BitTorrent’s tit-for-tat mechanism with two bandwidth trading schemes. In both trading schemes we assume that a peer knows its upload capacity and can freely distribute this upload capacity over its connections to other peers. In the first proposed trading scheme each peer receives a (virtual) payment for uploading data to others. These payments control the sending rates in the future. Peers with higher price offers will receive higher rates whereas the rate will decrease for peers with lower price offers. Furthermore, the total payments a peer can afford is limited to its own upload capacity. We will show that such an algorithm converges to a fair distribution of the available upload bandwidth in the network weighted by the upload bandwidth of a peer. In the second trading scheme peers use their download rates from other peers as the payment information. Thus, no explicit pricing must be implemented in the protocol. It should be noted that a trading scheme is only one of the building blocks of a P2P protocol. Since every peer starts with no block at the beginning a good implementation has to ensure that new peers have a decent chance to finish their first block fast. Therefore, altruistic behavior of some peers is essential or further incentive mechanisms are needed in the network (e.g. based on the reputation of peers). Furthermore, the selection of blocks to download is important for the future exchange with other peers. The BitTorrent protocol implements a rarest-first strategy where each peer determines the rarest block of its neighbors and requests this block if available. Different papers show the efficiency of this model analytically [6] or by simulation [5]. Alternatively, [7] presents an approach where the uploading peer decides which block is uploaded and distributes the file in upload rounds. In different cases this scheme outperforms rarest-first. Furthermore, new coding schemes resolve the block selection problem [8]. By exchanging linear combinations of all the blocks a peer stores, the probability that two

peers have nothing of interest for the other one is reduced significantly. We concentrate in this work on the discussion and the detailed comparison of different trading schemes. Thereby, this work is an extended version of [9]. It discusses in more detail the different trading schemes and shows analytically the efficiency of the two proposed algorithms. It presents further simulation results, especially for dynamic networks. Additionally, results for static and dynamic simulations are compared with respect to the average number of connections per peer. The paper is structured as follows. Section 2 discusses the trading schemes and the Nash equilibria of them. In Section 3 the setup of the simulation is described. The results of the simulations are presented and discussed in Section 4. Section 5 concludes the paper. 2. Trading schemes We study bandwidth trading schemes which provide an incentive to contribute to the P2P content distribution network. Each peer tries to maximize its own download rate by appropriately allocating its upload bandwidth to other peers. The first scheme is a game theoretical approach and is used in the BitTorrent protocol. The other two schemes are based on pricing models. Thereby, both pricing algorithms use rate control at the application layer. In an real implementation this can be realized by the application putting different amounts of data into the socket buffers of the TCP connections. A more sophisticated approach is to schedule the traffic directly at the queue of the network interface card, e.g. with Linux Traffic Control [10]. 2.1. BitTorrent’s tit-for-tat In BitTorrent each peer controls to whom it uploads data. This is called unchoking. A peer uploads to a fixed number of other peers (the default value is four). Thereby, a peer chooses the upload candidates from which it has the highest download rates. This tit-for-tat strategy is run every 10 s by every peer, whereby the download rates are determined by a moving average over the last 20 s. To discover new peers with better performance a so-called optimistic unchoke is done additionally. Here, a peer is unchoked independently of its rate. The optimistic unchoke is changed every 30 s to provide enough time to be possibly unchoked by the remote peer in return. When a peer has completed the download of the file, unchoking is based on its upload rates to the connected peers. This unchoking algorithm gives peers an incentive to upload data to the network since it increases the chance to be unchoked by others with increasing upload capacity. Details about the BitTorrent protocol can be found in [2]. Furthermore, analytical models of BitTorrent’s incentive mechanism are presented in [6,11]. In their simplified models global information is assumed, i.e. the peers know the upload bandwidth of all other peers. In this case an opti-

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211

mistic unchoke is needless and the peer selection achieves an equilibrium [11]. Peers form groups with a group size equal to the number of unchokes plus one. Thereby, groups consist of peers with similar upload bandwidth depending on the descending order of the bandwidth (see [11] for details). Hence, the download rate of a peer depends not only on the upload bandwidth but also on its ratio to the bandwidth of other peers in the network. Thus, peers with the same upload bandwidth can be members in different groups and achieve different download rates. Further on, the peers with the lowest upload bandwidths form a group which can be smaller than the other groups. 2.2. Resource Pricing We proposed in [12] a distributed algorithm for a fair resource allocation. This algorithm can be applied to P2P content distribution networks for which the upload bandwidth is the scarce resource. In our model each peer pays a virtual price for using upload bandwidth at a remote peer. The sum of all prices a peer can afford to pay is bounded by its willingness-to-pay. For P2P file-sharing this willingness-to-pay is the upload bandwidth of a peer. This model gives an incentive to contribute to the network since a peer with a high upload capacity can offer higher prices than others and therefore receives a higher download rate. The distributed algorithm is explained in the following. Assume each peer allocates an upload capacity to the P2P application which is denoted as Cp at peer p. Furthermore, peer p can upload to a number of peers which are interested in a block which peer p offers. This set of peers is denoted as the service customers SC(p) of p. Each interested peer offers a price kc per unit of upload bandwidth. Based on these prices peer p sets the upload rate xpc to the remote peer c. Furthermore, the price offer of an interested peer is proportional to its upload capacity. Hence, the Resource Pricing algorithm is the set of differential equations Resource Pricing (RP): P   d d2SCðpÞ xpd ðtÞkd ðtÞ xpc ðtÞ ¼ cxpc ðtÞ kc ðtÞ  ; ð1Þ dt Cp Cc ; ð2Þ kc ðtÞ ¼ P p2SP ðcÞ xpc ðtÞ where SP(c) denotes the set of service providers of c, i.e. peers in which peer c is interested in. Thus, the denominator of (2) is the total download rate of peer c. (Furthermore, two exceptional cases have to be considered in a real implementation. When the total download rate of a peer is zero, we set kc(t) = Cc. And secondly, when kc(t) > 0 but xpc (t) = 0 we set xpc(t + 1) =  where  is a small positive constant.) Eqn. (1) can be interpreted as follows. Since kc is the price per unit of bandwidth, the product xpckc is the total price which is payed by peer c. According to this the sum in the numerator of (1) represents the total revenue of peer x p. Multiplying the total revenue by Cpcp specifies the average

203

revenue that peer p generates by allocating the rate xpc. If the total price of peer c is higher than the average price (i.e. the left term in the bracket of (1) is greater than the right one), then peer p increases its upload rate to c and decreases it otherwise. Further on, when we assume that two peers receive different download rates although they provide the same upload capacity to the network we see from (2) that the peer with the smaller download rate will offer a higher price per unit in the future than the other one. Hence, its download rate will increase. The stable point (y*, k*) of the system (1), (2) is [13] P X C c p2P C p  xpc ¼ P ; ð3Þ yc ¼ d2SC C d p2SP ðcÞ P Cd   ð4Þ kc ¼ k ¼ Pd2SC ; p2P C p where SC is the set of peers which currently download the file and P is the set of all peers in the network, i.e. also including the seeds, peers which stay altruistically in the network after completion of their download. It can be seen from (3) that the download rate of a peer is proportional to its upload capacity and the bandwidth allocation is fair weighted by the contribution of each peer. When no peer behaves altruistically (3) reduces to yc = Cc. The system (1), (2) also ensures the efficiency of the algorithm in equilibrium, because by setting (1) to zero and summing up over all upload rates of peer p we get P   X d2SCðpÞ xpd kd 0¼ cxpc kc  ; ð5Þ Cp c2SCðpÞ ! P X c2SCðpÞxpc xpc kc 1  ; ð6Þ 0¼ Cp c2SCðpÞ X xpc ¼ C p : ð7Þ ) c2SCðpÞ

Furthermore, we prove in the following that the proposed algorithm fully utilizes the upload capacity under the assumption that in the previous step all resources are used P (i.e. c2SCðpÞ xpc ðtÞ ¼ C p ). Therefore, we sum up over all upload rates of peer p X xpc ðt þ 1Þ ð8Þ c2SCðpÞ P     X d2SCðpÞ xpd ðtÞkd ðtÞ ð9Þ ¼ xpc ðtÞ þ cxpc ðtÞ kc ðtÞ  Cp c2SCðpÞ P X X c2SCðpÞ xpc ðtÞ ¼ xpc ðtÞ þ c xpc ðtÞkc ðtÞ  Cp c2SCðpÞ c2SCðpÞ ! X xpd ðtÞkd ðtÞ ð10Þ  ¼

X

d2SCðpÞ

xpc ðtÞ

ð11Þ

c2SCðpÞ

¼ Cp :

ð12Þ

204

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211

Hence, the distributed algorithm is also efficient in all rate allocations when the initial rate allocation is efficient, which can easily be realized by splitting the upload capacity evenly over all connections at the start.

this case. Thereby, an edge denotes a bandwidth allocation greater zero. If the bipartite graph is connected, it holds xcp ¼ xpc ; and

2.3. Reciprocal Rate Control

yp ¼

The Resource Pricing algorithm in Section 2.2 assumes the correct signaling of the price offers. Thus, an implementation must ensure that malicious users cannot forge their price offers to obtain higher download rates. When this is not possible in a specific application, an upload rate control algorithm can only be based on the download rates of the connected peers (like in BitTorrent). This means a peer is only willing to provide upload bandwidth to another peer when it receives in return bandwidth from it. In the context of pricing mechanisms the download rates can be interpreted as the price a remote peer is willing to pay for the upload bandwidth allocated to it. In the Resource Pricing algorithm in Section 2.2 the total price paid by the remote peer is the product xpckc. Hence, by replacing xpckc with the rate xcp in (1) we obtain the Reciprocal Rate Control algorithm using an implicit pricing signal Reciprocal Rate Control (RRC): P   d d2N ðpÞ xdp ðtÞ xpc ðtÞ ¼ c xcp ðtÞ  xpc ðtÞ ; ð13Þ dt Cp where N(p) denotes the set of neighbors of peer p. In the following we prove that the stable point of the differential equation in (13) provides an efficient and weighted fair resource allocation. By setting (13) to zero P   d2N ðpÞ xdp 0 ¼ c xcp  xpc ; ð14Þ Cp Cp xcp ð15Þ ) xpc ¼ P d2N ðpÞ xdp and by summing up over all upload rates of p X xpc ¼ C p :

ð16Þ

c2N ðpÞ

Eq. (16) implies that the total upload rate of a peer is equal its upload capacity. With (15) we can compute the total download rate yp of p by X xcp yp ¼ xcp ¼ C p ; 8c 2 N ðpÞ: ð17Þ xpc c2N ðpÞ Eq. (17) holds for all neighbors of p. Hence, the fraction of total download rate to upload capacity is equal for two y y peers, if they have a common neighbor. Hence, Cpp ¼ Cqq holds for peers p and q, if a peer c exists with c 2 N ðpÞ ^ c 2 N ðqÞ. Furthermore, for c 2 N ðpÞ also yp ¼ Cy c holds. Cp c Similar to the derivation of the stable point for Resource Pricing in [13] a bipartite graph can be composed of the sets of uploading and downloading peers, which are identical in

8c 2 N ðpÞ

X

ð18Þ

xcp ¼ C p :

ð19Þ

c2N ðpÞ

Thus, in equilibrium a peer uses its full upload bandwidth (cp. (16)) and downloads from a specific peer with the same rate as it is uploading (cp. (18)). Thus, the total download rate over all connections is equal to the upload capacity of the peer (cp. (19)). Additionally, it can be shown that the Reciprocal Rate Control algorithm fully utilizes the upload capacity under the assumption that in the previous step all resources are used. By summing up over all upload rates of peer p X

c2SCðpÞ

xpc ðt þ 1Þ 0

ð20Þ 0

P

11

xdp ðtÞ X B d2SCðpÞ B CC ¼ @xpc ðtÞ þ c@xcp ðtÞ  xpc ðtÞ AA C p c2SCðpÞ

ð21Þ

P 1 xdp ðtÞ X X d2SCðpÞ B C ¼ xpc ðtÞ þ c@ xcp ðtÞ  xpc ðtÞ A ð22Þ C p c2SCðpÞ c2SCðpÞ c2SCðpÞ 0

X

P 1 xdp ðtÞ X d2SCðpÞ B C ¼ C p þ c@ xcp ðtÞ  C p A C p c2SCðpÞ 0

¼ Cp :

ð23Þ ð24Þ

Thus, when we start with an initial rate allocation which is efficient all following rate allocations are efficient as well. The Reciprocal Rate Control algorithm is restricted to peers that did not complete the download already. It ensures that a peer receives at least the rate, which it provides to the network. Seeds cannot run the algorithm and have to use other rules for their upload. (E.g. these peers can upload to peers, which have nothing at all.) Therefore, an advantage of explicit prices used in Section 2.2 compared to implicit prices is that fairness is preserved also over the altruistically contributed resources in the network. The authors of [14] describe in their paper an algorithm that is similar to Reciprocal Rate Control. Both algorithms converge to a pair-wise fair bandwidth allocation, where rates between peers are symmetric. However, [14] describes a P2P network, where users access remotely data from their home computer as well as from other peers. Thus, self allocations are possible in their system, but not in BitTorrentlike networks. Furthermore, [15] discusses pair-wise allocations for BitTorrent-like networks. They prove analytically that networks need not to be fully-connected to achieve symmetric allocations and thereby fairness. However, no algorithm is presented in [15], which finds these allocations. Since Reciprocal Rate Control ensures fairness and

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211

provides a symmetric bandwidth allocation in equilibrium, it represents an algorithm for this purpose. 2.4. Nash equilibrium Most peers in a P2P network behave selfishly and try to maximize their performance only. Therefore, we can interpret the trading of bandwidth as a non-cooperative game and study the Nash equilibrium. In a Nash equilibrium no peer gains by only changing its strategy while all other players keep their strategy unchanged. This means a Nash equilibrium corresponds to a set of strategies where every player has found the best response to the actions of the other players [3]. Ref. [6] studies the Nash equilibrium for the BitTorrent protocol. Thereby, each peer can choose its upload bandwidth between 0 and its physical upload capacity. Since a higher upload bandwidth is associated with a higher cost, a peer is interested primarily in maximizing its download rate while also minimizing its cost at the same time. Ref. [6] shows that a Nash equilibrium exists for networks consisting of groups (with a group size larger than the number of unchokes plus one) of peers where peers belonging to the same group have identical upload bandwidths. In this situation the best case for a peer is to upload to other peers in its group. The threshold to be unchoked is exactly the upload bandwidth divided by the number of unchokes (which is assumed to be equal for all peers). Therefore, a peer will be choked by the peers of its group when it reduces its upload bandwidth. This results in inferior performance. On the other hand a Nash equilibrium does not exist when peers have different upload capacities as it is demonstrated by an example in [6]. In the following we study the Nash equilibria for the two proposed pricing schemes in steady-state. Assume for Resource Pricing that a peer cannot forge its price offer k. It can be seen directly from (3) that any reduction of upload capacity will result in a decrease of the download rate. When maximizing the download rate has priority over minimizing the upload cost every peer will upload with its physical upload capacity. Thus, the steady-state of the system (1), (2) is a Nash equilibrium. Similarly, the existence of the Nash equilibrium for Reciprocal Rate Control can be shown for the steady-state with (18). Since a peer receives exactly the rate, which it provides to the other peer, it gains nothing by reducing its upload bandwidth. 3. Simulation setup Because of the computational complexity of the simulations at packet-level we restrict our analysis to the application layer. Therefore, the TCP behavior is omitted. We assume a user sets the maximal upload bandwidth of his P2P application between zero and his physical upload capacity. Furthermore, we assume this is the bottleneck

205

in the network. Since the utilization in the core of the network is low [16] and access lines are often asymmetric favoring the downlink we believe this is a reasonable assumption. The bandwidth trading schemes depend highly on the number of neighbors and especially on the number of connections where both sides are interested in data blocks of the other side. Thus, the schemes depend on the topology generated by the protocol and the implemented block selection algorithm. To concentrate on the trading schemes in the simulations we omit the block selection algorithm and assume connected peers are always interested in blocks of each other. The overlay topology is constructed in our simulations according the original BitTorrent implementation [2]. Here, a peer asks a so-called tracker, a centralized component that stores information about all peers, for a list of other peers in the network. The tracker returns a random subset of length NR to the requesting peer. Hence, a peer opens a new connection to a remote peer based on the list returned by the tracker or when a remote peer asks for it. In our simulations we consider static and dynamic P2P networks. In the static case all NP peers are registered at the tracker. Then each peer obtains a peer list of length NR from the tracker. If we assume that all peers accept every incoming connection request, a peer p iterates through its peer list and opens NR connections. Furthermore, one more connection is established when a remote peer which is unknown to p, i.e. not on the peer list of p, contacts it. The probability that x peers contact p is B(x) and follows the binomial distribution   NP  1 BðxÞ ¼ ð25Þ P x ð1  P ÞN P 1x ; x where P is the probability that peer p is on the peer list of a peer q under the assumption that q is not on the list of p. The probability that a specific peer id is returned by the tracker is based on the hypergeometric distribution and is   NP  2 1 NR NR  1   ¼ ; ð26Þ NP  1 NP  1 NR when we assume a tracker does not return the id of the requesting peer. Thus, we can compute P with   NR NR P¼ 1 : ð27Þ NP  1 NP  1 The expectation value E[NC] of the number of connections NC of a peer is the sum of NR and the expectation value E[X] of the random variable X which is distributed according (25). Therefore,

206

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211

E½N C  ¼ N R þ E½X 

  NR NR 1 ¼ N R þ ðN P  1Þ NP  1 NP  1   NR ¼ NR þ NR 1  NP  1

 2N R :

ð28Þ ð29Þ ð30Þ ð31Þ

The approximation in (31) holds if NR > NP. For the simulations with dynamics we model the peer behavior as a Poisson process, where the interarrival times between peers and the session times of peers are exponentially distributed. The expectation value of the number of peers in the network is E½N P  ¼ lk which depends on the mean arrival rate k and the mean session time l1. We assume the tracker returns valid information of online peers only. Since the Poisson process is memoryless a peer which is asked to open a new connection by a remote peer has a remaining session time distributed with mean l1. Therefore, the rate of closing connections for a peer is NR Æ l. On the other hand new peers will open a connection to peer p. The probability that peer p is chosen by a new peer is given by (26) and can be estimated with E[NP]. New peers enter with the rate of k. Therefore, the rate of opening new connections is k E½NNPR1. Hence, the expectation value of the number of connections is k  NR NR ðE½N P   1ÞN R  l k  NR k NR  NR  l l

E½N C  ¼

¼ N R:

ð32Þ ð33Þ ð34Þ

The results of the expected number of connections in the static and the dynamic network in (31) and (34), respectively, are different and deviate by a factor of 2. This has to be taken into account for the simulations where fairness is studied for different values of NR. 4. Simulation results 4.1. Static networks One major difference of the two pricing schemes to BitTorrent’s tit-for-tat strategy is their convergence to a steady-state. To demonstrate the basic functionality of all algorithms we run a simulation for a small network of 10 peers with homogeneous upload capacities of C = 1. The superposition of the download rates of the peers is depicted in Fig. 1. Whereas the download rates of the peers oscillate between 0.4 and 1.6 for BitTorrent, the rates converge fast to a fair allocation for the Resource Pricing and the Reciprocal Rate Control algorithm where each peer receives exactly its upload capacity. The oscillations with BitTorrent are caused by the optimistic unchoke. For the ideal case where peers have global

information about the upload bandwidth of other peers analytical studies [6,11] show that the tit-for-tat strategy has an equilibrium point. Since the optimistic unchoke is a random process the mean values of the download rates are closer together. In this example the mean download rates of the ten peers lie between 0.77 and 1.23. Especially the performance of BitTorrent depends on the number of neighbors. To study the influence of the topology on the download performance simulations are run with varying parameter NR. The network population was 1000 peers, each peer starting with a small random offset to avoid synchronization effects. The simulation consisted of 1000 iterations of the respective algorithm and was repeated 5 times. We set c = 0.1 for RP and RRC and  = 0.1C/NC. The empirical cumulative distribution function (CDF) of the mean download rate over the 1000 iterations is depicted over all runs in Fig. 2. To compare the three algorithms Fig. 2(a), (c) and (d), show the results for download rates between 0.95 and 1.05. With BitTorrent’s tit-for-tat algorithm peers receive highly different download rates while providing the same upload capacity. To see its performance on a larger scale the CDF for download rates between 0.5 and 2 is depicted in Fig. 2(b). Tit-for-tat depends on the number of neighbors. With NR = 2 a peer has on average four connections only and therefore no choice in selecting peers. This results in a poor performance where 10% of the peers receive half or less of what they provide. Download rates are distributed more equitably with increasing NR. For NR = 10 all peers receive a mean download rate of ±20% of their upload capacity, whereas this percentage decreases to ±10% for NR = 50. Nonetheless, the distribution of download rates with BitTorrent is not as uniformly distributed as with the two proposed pricing algorithms. Nearly all peers receive download rates between 0.98 and 1.02 with both algorithms and values of NR > 2. Furthermore, the download rates at the end of each simulation were equal to one for every peer. This means the pricing algorithms converged. Thus, the differences of the CDFs for different values of NR in Figs. 2(c) and (d) are due to differences in the rate of convergence. Because of the slight differences observed in the results we analyze the convergence properties for the case of heterogeneous peers. For the next simulation we consider heterogeneous peers with upload capacities of integers between 1 and 10. The capacity is determined randomly at the start of the simulation. With a total of 1000 peers there are on average 100 peers with the same capacity in the network. The download performance of each peer is measured by the ratio of mean download rate to upload capacity. The CDFs of the download performances are depicted in Figs. 3–5(a) for the different algorithms and a download performance between 0.9 and 1.1. As expected the download performances of the peers vary more as compared to the simulation results with

1.6

1.6

1.4

1.4

1.4

1.2

1.2

1.2

1 0.8 0.6

1 0.8 0.6

0.4

0.4

0.2

0.2

0

0 0

50 100 150 200 250 300 350 400 450 500

Download Rate

1.6

Download Rate

Download Rate

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211

207

1 0.8 0.6 0.4 0.2

0

0 0

50 100 150 200 250 300 350 400 450 500

50 100 150 200 250 300 350 400 450 500

Round

Round

Round

1

1

0.9

0.9

0.8

0.8

0.7

0.7

0.6

Empirical CDF

Empirical CDF

Fig. 1. Superposition of the download rates of 10 peers for different trading schemes.

NR= 2

0.5 0.4 NR= 50

0.3

0.6 N =5

0.5

R

N =2 R

0.4 0.3 NR= 50

NR= 10

0.2

0.2

NR= 5

NR= 10

0.1

0.1 0 0.95 0.96 0.97 0.98 0.99

1

0 0.5

1.01 1.02 1.03 1.04 1.05

0.75

1 0.9

0.8

0.8

0.7

0.7

Empirical CDF

Empirical CDF

1

0.5 0.4 0.3 0.2 0.1

NR= 50

NR= 5

NR= 10

0 0.95 0.96 0.97 0.98 0.99

1

1.01 1.02 1.03 1.04 1.05

Mean Download Rate

1.75

2

0.6 0.5 0.4 0.3

0.1

NR= 50

NR= 5

0.2

NR= 2

1.5

Mean Download Rate

0.9

0.6

1.25

1

Mean Download Rate

NR= 10

NR= 2

0 0.95 0.96 0.97 0.98 0.99

1

1.01 1.02 1.03 1.04 1.05

Mean Download Rate

Fig. 2. Empirical CDF for varying parameter NR.

homogeneous peers. The CDF for BitTorrent in Fig. 3(a) shows only with NR = 50 a good performance, because only around 1% of the peers receive a download to upload ratio of less than 0.9. But this proportion rises to about 15% for NR = 10 and 31% for NR = 5. The CDFs for the two pricing schemes in Figs. 4(a) and 5(a) outperform BitTorrent with respect to fairness. The ratio of the mean download rate to the upload capacity is over 0.98 for all peers for NR > 2. Only for NR = 2 fairness deteriorates and around 12% and 20% of the peers have a ratio of less than 0.95 using Resource Pricing and Reciprocal Rate Control, respectively.

Another metric to study fairness is Jain’s Fairness Index [17]. In [12] we extended this metric to weighted fairness and defined the Weighted Fairness Index with  Pn  2 i¼1 y i fw ðy; wÞ ¼ P ð35Þ Pn y 2i : n i¼1 wi  i¼1 wi Thereby, wi is the weight of peer i. In this work, we associate the upload capacity of a peer with its weight. Like Jain’s Fairness Index the metric in (35) lies between 0 and 1 and higher values indicate better fairness. To study the convergence of the algorithms we measured the

208

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211 1 0.95

Weighted Fairness Index

1 0.9

Empirical CDF

0.8 0.7 0.6

NR = 2

0.5 0.4 N = 50 R

0.3

N = 10 R

0.2

NR=50

0.9 0.85 0.8 N =10 R

0.75

NR=5

0.7 0.65 NR=2

0.6

N =5 R

0.1

0.55

0 0.9 0.92 0.94 0.96 0.98

1

0.5

1.02 1.04 1.06 1.08 1.1

10

20

30

40

50

60

70

80

90

100

70

80

90

100

70

80

90

100

Iteration

Mean Download Rate

Fig. 3. BitTorrent (heterogeneous peers).

1

1 NR = 50

0.9

0.95

NR = 10

Weighted Fairness Index

Empirical CDF

0.8 0.7 0.6 0.5 0.4 0.3

NR = 5

0.2

NR = 2

0.9

NR=50

0.85

NR=10

0.8

NR=5

0.75 NR=2

0.7 0.65 0.6 0.55

0.1 0 0.9 0.92 0.94 0.96 0.98

1

0.5

1.02 1.04 1.06 1.08 1.1

10

20

30

40

Mean Download Rate

50

60

Iteration

(b) WFI Fig. 4. Resource Pricing (heterogeneous peers).

1

1 NR = 50

0.9

Weighted Fairness Index

Empirical CDF

0.8 0.7 0.6 0.5 0.4 0.3

N =2 R

0.2

0.95

NR = 10

NR = 5

0.1

0.9 N =50

0.85

R

0.8

NR=10

0.75 NR=5

0.7 NR=2

0.65 0.6 0.55

0 0.9 0.92 0.94 0.96 0.98

0.5 1

1.02 1.04 1.06 1.08 1.1

10

20

30

40

50

60

Iteration

Mean Download Rate

(b) WFI

(a) CDF Fig. 5. Reciprocal Rate Control (heterogeneous peers).

Weighted Fairness Index over simulation time. The results in Figs. 4(b) and 5(b) show for NR > 2 the convergence to a fair resource allocation for both proposed algorithms in less than 70 iterations. The convergence is better with increasing NR and better for Resource Pricing than with Reciprocal Rate Control. When NR = 2 we observed no convergence even for a larger number of iterations. In this case some peers

receive an unfair download rate because its small neighborhood cannot raise the adequate rate with their upload capacity. The weighted fairness index of BitTorrent in Fig. 3(b) is below 0.9 for all studied values of NR. (It should be noted that a fairness index of 0.9 corresponds for example to an allocation where 10% of the peers receive nothing at all and the remaining 90% receive equal rates.)

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211

We also measured the download performance of the peers depending on their upload capacity. Fig. 6 shows the median and the 2.5–97.5 percentile range of the mean download rates for peers with the same upload capacity. By using BitTorrent the median for peers with a upload capacity of C = 1 is much larger as the fair share of one whereas the peers with C = 10 receive mostly a rate lower than their contribution. One reason for this is the optimistic unchoke since a low capacity peer gains more than it invests compared to a high capacity peer. Another reason is the incapability to find the right match which also explains the different performances between peers with the same capacity. For Resource Pricing and Reciprocal Rate Control the median of the download performance is very close to the upload capacities of the peers. Additionally, the small percentile range indicates that peers with the same upload capacity receive nearly the same download performance.

11 10

Mean Download Rate

9 8 7 6 5 4 3 2 BitTorrent Resource Pricing Reciprocal Rate Control

1 0

Upload Capacity

4.2. Dynamic networks We conducted simulations also for dynamic networks where interarrival times between peers and session times of peers are negative exponentially distributed random variables. We set NR = 10 and compare the performance for two cases with the same average peer population of 1000. We assume the respective algorithm is run per unit time. The resulting CDFs are depicted in Fig. 7(a) and (b). With an arrival process of peers with a rate 1/k = 10, i.e. on average 10 iterations of the algorithm before a new peer enters, the two pricing schemes achieve nearly uniformly distributed download performances for heterogeneous peers. For 1/k = 1 in Fig. 7(b) the CDF shows higher variability in the achieved download performance for the two proposed algorithms. Thereby, the results for Reciprocal Rate Control deteriorate more than for Resource Pricing comparing it with the results in Fig. 7(a). Especially for 1/k = 1,1/l = 1000 some peers stay only a very short time in the network and merely run the trading algorithm a few times. This results in poor download performance as it can be seen from Fig. 8. Here, the minima of the download performances of peers with similar session times are measured for time intervals of 25 time units. For all schemes the minimal download performance increases with the session time of the peers, but the increase is more pronounced for the two trading schemes. After around 500 time units the minimal download performance in the network is above 0.9. As discussed in Section 3 the average number of connections for the same value of NR is different in static and dynamic simulations. To ensure a fair comparison between both cases we run simulations for dynamic networks with NR = 4, 10, 20, 100. Thus, the average number of connections is equal to the static simulations with NR = 2, 5, 10, 50, respectively. Table 1 summarizes the results for the mean value of the Weighted Fairness Index. We measured the Weighted Fairness Index in the P2P network per time unit and averaged it over a simulation time of 100000 s.

1

1

0.9

0.9

0.8

0.8

0.7

0.7

Empirical CDF

Empirical CDF

Fig. 6. Median and the 2.5–97.5 percentile range of the mean download rates for heterogeneous peers (NR = 10).

0.6 0.5 BitTorrent

0.4 0.3

209

0.6 0.5

BitTorrent

0.4 Resource Pricing

0.3 Resource Pricing

0.2

0.2 Reciprocal Rate Control

Reciprocal Rate Control

0.1

0.1

0 0.9 0.92 0.94 0.96 0.98

1

1.02 1.04 1.06 1.08 1.1

Mean Download Rate / Upload Capacity

0 0.9

0.92 0.94 0.96 0.98

1

1.02 1.04 1.06 1.08 1.1

Mean Download Rate / Upload Capacity

Fig. 7. CDFs for dynamic networks (NR = 10).

210

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211

5. Conclusion

MIN( Mean Download Rate / Upload Capacity)

1.1

1

0.9

0.8

0.7

0.6

0.5

BitTorrent Resource Pricing Reciprocal Rate Control

0.4 0

1000

2000

3000

4000

5000

6000

7000

8000

9000

Peer Session Time

Fig. 8. Minimal download performance (1/k = 1,1/l = 1000).

Table 1 Mean of WFI in dynamic networks NR 4 10 20 100

1/k

1/l

BitTorrent

Resource Pricing

Reciprocal Rate Control

1 10 1 10 1 10 1 10

1000 10000 1000 10000 1000 10000 1000 10000

0.5644 0.5774 0.8415 0.85 0.8872 0.8924 0.8961 0.9002

0.9272 0.9571 0.9946 0.999 0.9971 0.9996 0.9981 0.9997

0.9021 0.9526 0.9872 0.9985 0.9916 0.9992 0.9935 0.9993

By comparing the results of BitTorrent in Table 1 with the values of the static simulations in Fig. 3(b) we see that the results with the same average number of connections agree with each other. Thus, for the conducted simulations the dynamics of the peers hardly influence the fairness in the network. Also the results for the two proposed algorithms in the dynamic case are similar to the static case. With an average of 10 or more connections the Weighted Fairness Index is close to the optimal value of one. The differences between Resource Pricing and Reciprocal Rate Control are small, especially for larger values of NR, but Resource Pricing produces slightly better results throughout all simulations. With higher churn rates (i.e. for 1/k = 1, 1/l = 1000) the Weighted Fairness Index decreases for all three algorithms with NR = 4. For larger vales of NR the differences to the simulations with 1/k = 10, 1/l = 10000 are small. Also the results for Reciprocal Rate Control with NR = 10 are close together for both runs. This does not disagree with the results in Figs. 7 and 8, because peers with short session times contribute less to the Weighted Fairness Index as compared to peers, that stay longer in the network. In conclusion, all simulation results indicate that the two proposed algorithms show improved fairness between peers in static and dynamic networks as compared to BitTorrent.

BitTorrent’s tit-for-tat strategy gives peers an incentive to contribute upload bandwidth to the network. But it cannot avoid unfairness between peers with respect to the experienced download performance. Especially when peers have a small number of connections download rates vary considerably. Furthermore, peers with small upload capacities compared to others receive considerably more than what they contribute to the network. This paper presents two alternatives to improve fairness. Both use price information to control the upload rates at the application layer. We derive that the proposed distributed algorithms achieve in equilibrium a fair and efficient allocation of the total upload bandwidth contributed by the peers in the network. Furthermore, the steady-states of the two schemes provide Nash equilibria. In simulations both algorithms show good convergence and better fairness as the tit-for-tat strategy used in BitTorrent. Each of the two proposed algorithms has its advantages. Reciprocal Rate Control is robust against malicious users since it uses the download rates from other peers as the price information. These cannot be forged. On the other hand Resource Pricing, which uses explicit prices, preserves fairness also for the allocation of the altruistically contributed resources offered by the peers that completed their download already. Additionally, it shows slightly better convergence than Reciprocal Rate Control in the simulations. In this paper we assume peers have always parts of the file which are of interest for the remote peers. This simplification enables to study the incentive schemes without discussing a specific block selection algorithm. When network coding is not used, block and peer selection depend on each other. Besides finding the peers, which provide good download rates, a peer should download rare blocks to ensure that it has something of interest for others in the future. Furthermore, requesting rare blocks increases the availability of a full copy of the file in the network. [18] studies BitTorrent networks, in which the availability of a full copy is comprised. The authors propose a new tit-for-tat strategy to prolong the file integrity in BitTorrent networks. It is also part of our future work to take the block selection into account. Thereby, one idea is to incorporate the rareness of a block in the distributed algorithms. This means for Resource Pricing the offered price k depends also on the rareness of a block. References [1] E. Adar, B.A. Huberman, Free riding on Gnutella, First Monday 5 (10). [2] B. Cohen, Incentives build robustness in BitTorrent, in: Proc. 1st Workshop on Economics of Peer-to-Peer Systems, Berkeley, 2003. [3] M.J. Osborne, An Introduction to Game Theory, Oxford University Press, 2004. [4] M. Izal, G. Urvoy-Keller, E.W. Biersack, P. Felber, A.A. Hamra, L. Garce´s-Erice, Dissecting BitTorrent: five months in a torrent’s lifetime, in: Passive and Active Measurements, 2004, pp. 1–11.

K. Eger, U. Killat / Computer Communications 31 (2008) 201–211 [5] A.R. Bharambe, C. Herley, V.N. Padmanabhan, Analyzing and improving BitTorrent performance, Tech. Rep. MSR-TR-2005-03, Microsoft Research, 2005. [6] R. Qiu, D. Srikant, Modeling and performance analysis of BitTorrent-like peer-to-peer networks, Computer Communication Review 34 (4) (2004) 367–378. [7] D. Schlosser, T. Hoßfeld, K. Tutschku, Comparison of robust cooperation strategies for p2p content distribution networks with multiple source download, in: Proc. IEEE International Conference on Peer-to-Peer Computing (P2P2006), Cambridge, UK, 2006, pp. 31–38. [8] C. Gkantsidis, P. Rodriguez, Network coding for large scale content distribution, in: Proc. IEEE INFOCOM, Miami, 2005. [9] K. Eger, U. Killat, Bandwidth trading in unstructured P2P content distribution networks, in: Proc. IEEE International Conference on Peer-to-Peer Computing (P2P2006), Cambridge, UK, 2006, pp. 39–46. [10] B. Hubert, T. Graf, G. Maxwell, R. van Mook, M. van Oosterhout, P. Schroeder, J. Spaans, P. Larroy, Linux Advanced Routing & Traffic Control HOWTO, Documentation from . [11] R. Thommes, M. Coates, Bittorrent fairness: analysis and improvements, in: Proc. Workshop Internet, Telecom. and Signal Proc., Noosa, Australia, 2005. [12] K. Eger, U. Killat, Fair resource allocation in Peer-to-Peer networks, in: Proc. International Symposium on Performance Evaluation of Computer and Telecommunication Systems (SPECTS’06), Calgary, Canada, 2006, pp. 39–45. [13] K. Eger, U. Killat, Resource pricing in peer-to-peer networks, IEEE Communications Letters 11 (1) (2007) 82–84. [14] S. Agarwal, M. Laifenfeld, A. Trachtenberg, M. Alanyali, Fast data access over asymmetric channels using fair and secure bandwidth sharing, in: Proc. of the 26th IEEE International Conference on Distributed Computing Systems (ICDCS’06), Washington, DC, USA, 2006, pp. 58–62. [15] X. Yang, G. de Veciana, Performance of peer-to-peer networks: service capacity and role of resource sharing policies, Performance Evaluation 63 (3) (2006) 175–194.

211

[16] A. Odlyzko, Data networks are lightly utilized, and will stay that way, Review of Network Economics 2 (3) (2003) 210–237. [17] R. Jain, The Art of Computer Systems Performance Analysis, Techniques for Experimental Design, Measurement, Simulation, and Modeling, John Wiley & Sons, 1991. [18] Y. Tian, D. Wu, K.W. Ng, Modeling, analysis and improvement for BitTorrent-like file sharing networks, in: Proc. IEEE INFOCOM, Barcelona, Spain, 2006.

Kolja Eger studied Computer Science and Communications Engineering at the University of Duisburg-Essen, Germany and the University of Queensland, Australia. Currently he is a Ph.D. candidate at the Hamburg University of Technology (TUHH). His research interests include the resource allocation in IP and peer-to-peer networks, with specific interest in congestion pricing.

Ulrich Killat studied Physics in Hamburg and Heidelberg. After completion of his thesis he worked in the research laboratories of Philips in Hamburg and Aachen. Since 1991 he is professor and head of the department Communication Networks at the Hamburg University of Technology (TUHH). His research interests include traffic theory, coding theory and modeling and simulation of communication networks.