• No results found

4.3 Uniform Distribution

4.3.2 Modeling the Arrival Rate

In this section, we model the probabilistic arrival of packets at a given peer. In our model, peers that owe fewer packets are likely to receive load packets at a higher rate than peers who already owe more packets. We justify this model through our observation of the system behavior.

0 1 2 3

!

0

(i) !

1

(i) !

2

(i)

"

i

"

i

"

i

Figure 4.1: Markov chain modeling the size of the load queue for peer Li If the peer Li has no load packets to reciprocate it will send load packets based on its locally randomized permutation. Figure 4.2 shows a potential sequence of actions taken by Li (ordered from top to bottom in the figure). The prefix of the Li’s randomized list consists of peers Lj, Lk, Ll, Lm, Ln, Lo. Leecher Li begins by sending packets to its neighbors in the order of their appearance on the list. At some point during the process some peers will reciprocate to Li. In Figure 4.2 peers Lk and Lm reciprocate in step (f ). These reciprocations form what we refer to as holes, i.e. or empty slots in the sequence of packets sent by Li towards its neighbors. Since DFik and DFim come down to 0, once Lk, and Lm reciprocate, leecher Li will naturally send the next packet to Lk (step (g) in the figure). In other words, Li acts to fill the holes before sending a packet further down the list.

A key observation about the system that we use to model its probabilistic behavior is that peers send new load packets to plug holes formed in the load list. Moreover, peers that are responsible for creating more holes by reciprocating load packets are likely to receive load packets at a higher rate. For example, Figure 4.3 captures the state of the randomized lists of several peers at a given moment in time. The figure, that shows randomized lists of five peers, annotates holes with the identities of the peers who are responsible for creating these holes. Lm has four corresponding holes, while Lj, for example only has one. The state captured in the figure suggests that in

L j L k L l L m L n L o

L i

L j L k L l L m L n L o L i

L j L k L l L m L n L o

L i

L j L k L l L m L n L o

L i

L j L k L l L m L n L o L i

L j L k L l L m L n L o

L i

L j L k L l L m L n L o L i

(a)

(f) (e) (d) (c) (b)

(g)

Figure 4.2: Progress made by peer Li in sending load packets to the peers on its randomized list. The figure captures a possible progression in time from top to bottom

L k L m

L i

L m L u

L j L v

L m L p

L w

L m L x

L t

Figure 4.3: Deficit lists of several peers: Li, Lu, Lv, Lw, Lx captured at a point in time. Existing holes are annotated with peers they correspond to. Lm is responsible for the largest number of holes

total the peers Lj, Lu, Lv, Lw and Lx are more likely to send the next packet to Lm than to Lj.

We use these observations about hole-plugging behavior to model the arrival rates at each peer, by assigning a higher probability of arrival to a peer that is responsible for creating more holes. Intuitively, this approach is logical. A peer that has a higher

upload capacity will reciprocate at a higher rate and will create more holes. The neighbors who send load packets to this peer will then more frequently send load packets to this peer than to a peer who reciprocates at a slower rate.

More specifically we model this behavior as follows: If hi represents the current number of holes corresponding to peer Lion the list, and α represents the total arrival rate of load packets in the system, we model the current arrival rate of load packets at the peer Li, as λ(i):

λ(i) = α ∗ hi P

jhj (4.34)

This model, which is an approximation of the system behavior, stipulates that the fraction of the total arrival rate α of load packets that goes to Li is proportional to the current fraction of holes due to Li’s reciprocation.

It remains to figure out how to estimate hi and α, and how to relate these values to the current state s of the queue length of the peer. We need to introduce more variables and make more observations about the system.

We observe that each peer only sends packets to the neighbors that appear close to the beginning of its local randomized list. Let ki be the number of peers who will send a load packet to Li during the experiment. We can form the following relationship between hi and ki:

qi = ki− hi (4.35)

In other words, the size of the queue, qi, of peer Li is exactly the difference between the number of peers that are likely to be sending packets to Li and the number of holes, hi formed by reciprocation of Li. Alternatively: hi = ki− qi.

Thus, we can restate equation 4.34 to define the arrival rate in terms of the load

state s = qi of Li:

λ(i, s) = α ∗ ki− s P

jhj (4.36)

To further parametrize the arrival rate we turn to some observations of the system in the steady-state.

4.3.3 Steady-State Behavior

Let α be the total arrival rate of load packets, and αR be the total rate at which packets are reciprocated. We have:

α + αR=X

i

µi (4.37)

That is the sum of the arrival rate of load and reciprocation packets equals the total upload capacity of all peers.

We make the following key observation about the behavior of a FairTorrent system in steady state:

Observation 1 In steady state in a FairTorrent system the rate, at which load pack-ets arrive, equals the rate at which load packpack-ets are reciprocated: α = αR

Assuming that N (t), the total number of load packets in the system is bounded, then the observation is obvious: as time t grows we always have the following inequal-ity:

(α − αR) ∗ t ≤ N (t) (4.38)

and thus α and αR move asymptotically close to each other.

In the later sections we argue more formally about the bound on N (t) for general capacity distributions. We have, however seen that N (t) is bounded by 3n/2 with

high probability for a simple distribution.

In general, we can give the following informal argument that supports the Obser-vation 1:

If at some time we have that α > αR, then the number of load packets in the system increases during that time. This means that peers can move further down their randomized lists and send packets to more peers eventually reaching peers that do not have any load. Once more peers turn from zero to non-zero load, they begin to reciprocate instead of sending load packets, and thus αR becomes bigger while α becomes smaller. On the other hand, if for some time αR > α, the number of load packets in the system grows smaller. Eventually some peers that have non-zero load process their load and begin sending load packets instead of reciprocation packets.

Thus α will grow and αR will decrease, reestablishing the balance.

Our simulations further support the fact that for a wide range of upload capacities distributions the system very quickly convergence to the steady state where α = αR.