• No results found

7.3 FairStream Properties

7.3.1 The Case of No Excess Bandwidth

Similar to the analysis in Chapter 4, we consider a completely-connected network of n peers with upload capacities selected from a given distribution D, exchanging data via FairStream. We assume that the peers always have useful data to exchange with one another. Let µi be the upload capacity of peer pi. (We assume that each peer has a download capacity di >> µi). We also assume, initially, that no peer uploads at above the rate of stream. Later, we relax some of these assumptions.

Let’s assume that the algorithm progresses in rounds. Let li(t) and ci(t) be the number of data blocks owed by pi to other peers, and the number of blocks owed to pi by other peers, respectively, in the end of round t. Let fi(t) be the rate at which pi receives data from other peers during round t. Then, we have:

ci(t) − li(t) =X

t

i− fi(t)) (7.1)

It follows that:

X

t

i− fi(t)) ≤ ci(t) (7.2)

Let cmax = maxi,t(ci(t)), that is the maximum number of blocks owed to any peer pi in the end of any round t. We want to show that cmax, the maximum number of blocks owed to any peer, is small and bounded with high probability. Based on the Equation 7.2, it follows that a bound on cmax would also imply a bound on the difference between the amount of data uploaded by and download by any peer pi. Because that different is bounded it also implies an asymptotic convergence between the upload and download rates of pi.

We can show a bound on cmax with high probability for a wide range of upload capacity distributions. As an example, consider a distribution with n/2 of capacity 1, (sending 1 block per round), and n/2 peers of capacity 2. Under the above simplifying assumptions we prove the following theorem:

Theorem 12 In an n-node FairStream network with n/2 peers of capacity 1, and n/2 peers of capacity 2, cmax, the maximum number of data blocks owed to a peer is O log(n) with probability at least 1 − n−Ω(1)

Proof:

pi always sends a data block to a peer with the smallest deficit, dij, and breaks ties based on its one-time randomization of its neighboring peers. Let Qi be the randomized list of pi, where pik = Qi[k] is the k + 1st element on pi’s list. If pi does not owe any blocks, i.e. li(t) = 0, pi sends blocks to peers ∈ Qi. Initially, when all dij = 0, pi begins by sending blocks in order to: Qi[0], Qi[1], etc. Let ri(t) be the rate at which peers ∈ Qi reciprocate data they owe to pi. (ri(t) ≤ fi(t) since part of the download rate may come from peers who do not owe pi) Observe that a peer pj who

owes lj(t) blocks to its neighbors, including pi, reciprocates to pi at a rate µj/lj(t).

The reciprocation rate ri(t) that pi observes from the peers who owe data to pi can be computed as follows:

Observe, that µi will only be sending data blocks to the first k peers on its list as long as the first k will reciprocate at a rate faster than µi. Thus, pi will never be owed more than ci(t) ≤ k data blocks. Therefore, we can bound cmax for all pi by number of owed blocks in the system. In fact we show that P rob[L(t) ≥ 4n] < 0.83n/4 We say that each peer pi either sends reciprocation blocks when it owes data, or it sends load blocks, when it does not owe data. Let R(t) =P

i(ri(t)), be the combined reciprocation rate in the system. Let U (t) = P

iµi be the total upload capacity, Observe, that the system reaches an equilibrium when the total reciprocation rate R(t) becomes greater than half the total capacity U/2 of the peers. At that point, L(t) does not grow as the blocks are reciprocated faster than the rate at which new load blocks are sent. It is easy to show that L(t) = O(n).

In our example, with n/2 peers with capacity 1 and n/2 peers with capacity 2, the total upload capacity per round is 3n/2 blocks. What is the maximum load,

L(t), at which point R(t) becomes greater than half of the total upload capacity or R(t) ≥ 3n/4? Consider a process A(t), according to which in FairStream new load blocks are distributed to n peers. Also, consider a related process N (t) that distributes load blocks randomly to the n peers. Let Ea, and En be the events that the load blocks are distributed to at least 3n/4 peers when L(t) = 4n under process A(t) and process N (t) respectively.

A simple counting argument will show that if 4n load blocks are distributed at random to n peers, using process N (t) then the probability that fewer than 3n/4 peers will receive load blocks is at most 3n/4n  ∗ (3/4)4n < 0.83n/4.

We argue, informally, that prob[Ea] ≥ prob[En]. We argue that A(t) is more balanced than random, and thus, is more likely to distribute 4n blocks across more peers, than N (t). The intuition is that, if a single peer is responsible for at least two load blocks, it will always send them to distinct peers on its list, resulting in overall more balanced distribution of blocks under A(t)), than under N(t). Thus, at least for some pairs of blocks under A(t), the probability that they will be sent to the same peer is zero.

So if L(t) = 4n, at least 3n/4 peers, all of whom have capacity at least 1, will have at least one load block to reciprocate in the end of round t. Therefore, the total reciprocation rate will be at least 3n/4 in that round with probability at least 1 − 0.83n/4. Therefore, when L(t) reaches 4n, the total load in the system stops growing with high probability.

Since L(t) ≤ 4n with high probability, then it follows that at most n/2 peers will have a load, li(t) ≥ 8. Conversely, a given peer pj on pi’s randomized list will have a load of at most 8 with probability at least 1/2.

Now if pi, which has at most capacity 2, sent a packet to the first k1log n peers on its list, (for some constant k1), as long as 16 of these peers have load ≤ 8, and

reciprocate at a rate at least 1/8, pi receives a reciprocation greater than µi, and is not able to send packets beyond the first k1log n peers on its list. The probability that there are at least 16 peers among the first k1log n peers with load ≤ 8 is at least 1 − k2k116log n ∗ (1/2)k1logn = 1 − n−Ω(k1−1), for some constant k2. Using a union bound we have that cmax, the maximum number of packets owed to any peer pi, is at most O(k1log n) with probability at least 1 − n−Ω(k1−2) = 1 − n−Ω(1).

Expected Number of Owed Packets. We can also show that the expected number of packets owed to a peer ci(t) = O(1). Consider a peer pj that owes a packet to peer pi. E[µj] = 1.5. Expected reciprocation rate of pj, E[gj(t)] = µj/lj(t) ≥ 1/2 ∗ (1.5/8) = 3/32. Thus, if 22 peers owe a packet to pi, their total expected reciprocation rate to pi will be 22∗3/32 > 2, thus greater than the maximum capacity of pi in our network.

Relaxing The Data Availability Assumption. One of the assumptions be-hind the theorem was that the peers always have data to exchange with one another.

We can relax this assumption, by assuming a factor η < 1, where the effective recipro-cation rate of the peers is multiplied by this factor, since the peers may not always be able to reciprocate. The bound of O(n) on the total load, and the bound of O(log n) on cmax still follows from the above steps.

Using the same methodology, we can similarly bound cmax for a wide range of upload capacity distributions, such as the distributions with multiple upload classes.

Assuming the O(log n) bound on cmax in n-node network, we can also show the following theorem:

Theorem 13 Assuming there is no excess capacity in an n-node FairStream network, the expected number of free data blocks that a free-riding or a strategic peer can receive is at most cmax.

Proof: A strategic peer sj, such as a free-rider, may receive a free data block from a peer pi only if sj occurs among the first cmax= O(log n) peers on the randomized peer list of pi. Thus, the probability that sj gets a free block from pi is at most cmax/n. It follows that the expected number of free blocks that a strategic peer can obtain from all of the n peers in the network is bounded by n ∗ cmax/n = cmax.

It also follows:

Theorem 14 In an n-node FairStream network, the average download rate of a peer over the duration of the stream asymptotically converges to the peer’s upload capacity.

Proof: Since the amount of data downloaded by a peer only lags by cmax = O(log n) data blocks behind the amount the peer uploads, as the peer uploads more and more data, the average download rate asymptotically converges to the peer’s upload rate.

7.3.2 Assuming Excess Capacity

We now comment on the excess capacity in the system. If there is excess capacity in the system, we can abstractly view the upload rate µi of a high-uploading peer pi, that uploads above the stream rate R, as composed of two parts: µi = R + ei, where ei is excess capacity. FairStream clients with upload capacity above the stream rate effectively use their upload capacity to assist under-provisioned peers. This requires no change to the algorithm. As long as the client has pending requests, it will use its capacity to upload data blocks. This feature of FairStream is in contrast to FlightPath [33] and Bar Gossip [34] that implement a very precise bandwidth-matching algorithm, and do not allow peers that are under-provisioned to view the stream even when excess capacity is available.

Given nk under-provisioned peers in the system, meaning peers with limited up-load capacity, each such peer will receive roughly E(t)/nk fraction of the total excess capacity, E(t). However, the system still encourages peers to upload at a higher rate.

If R = d + E(t)/nk, an under-provisioned peer still needs to upload at least at a rate d to obtain a matching d download rate in addition to the excess capacity component in order to view the full stream.

Observe, that one side-effect of the excess capacity feature is that the deficit counter dij of pi with an under-provisioned peer sj may become inflated. This does not hurt performance of high-uploading peers as deficits between high-uploaders re-main close to 0. Thus, when new stream updates become available again, and high-uploaders have data to upload to one another, they immediately revert to exchanging data with one another since their peer-wise deficits are lower.

Phasing out inflated deficits over time may be helpful in making sure that both old and newly-arriving under-provisioned peers receive even fractions of excess capacity (because their deficits would be closer together). However, these inflated deficits do not hurt the high-uploading peers in both static and dynamic scenarios as we show in the evaluation.

7.3.3 Resilience to Strategic peers assuming Excess