• No results found

4.3 Uniform Distribution

4.3.6 Verifying the Model

To verify our model we chose a network of n = 200 peers. The upload capacities were selected in the range of [1, r]. We evaluated three different models with r varying between 10, 50 and 100.

We use the computational method described above to arrive at the appropriate values for N and H. Based on our observations and results from the simple distri-bution we begin by guessing the range for the values of N and H to be between n/2 and 3n. We select the values for N and H using small increments and end up with

the values that best fit the desired criteria. Table 4.1 shows the values for N and H computed by the model for each value of r.

Upload Capacities Range Computed: N Computed: H

[1, 10] 159 242

[1, 50] 173 228

[1, 100] 175 225

Table 4.1: Values computed by the model for the expected load: N , and the expected number of holes: H on a network with 200 nodes with upload capacities chosen from the uniform distribution.

Ei[s] =X

s

Πs(i) ∗ s (4.46)

To check the results produced by the model we wrote a program, SimFairTorrent, that simulates the FairTorrent behavior. SimFairTorrent allows peers’ upload capac-ities to be selected from a given distribution. It allows each peer to locally randomize its neighbor list. SimFairTorrent is a discrete time simulator that checks for state changes and necessary action every clock tick. We set the clock ticks to be 1/100th of a second. so that the peer with the highest rate of 100 would be sending at most 1 packet per clock tick. We set the duration of the experiments to be 1000 clock ticks.

We discovered in our simulation that the behavior of the FairTorrent network is quite cyclical: maximum peer loads and maximum peer deficits remain the same whether the simulation is run for 1,000 or 100,000 clock ticks, for instance. Instead of running each simulation instance for more clock ticks, we ran 200 simulation instances for each value of r. In each instance new upload capacities of peers were selected from the given range of: [1, r], and peers used different randomizations of their neighbors’

lists. For each value of r, we measured the average load of a peer with a given upload capacity over 200 simulations. We averaged the load of the peer during the duration of all the simulations. We could then compare these values with the expected load

1 2 3 4 5 6 7 8 9 10 0

0.5 1 1.5 2 2.5

Peer Upload Capacity

Expected Queue Size

model simulation

Figure 4.4: Expected Load on Peers with Upload Capacities between 1 and 10 values produced by our model.

Figures 4.4 to 4.6 compare the results of our model with the results of the sim-ulation. The curve produced by our model shows the computed expected load on a peer of a given upload capacity. The curve produced by the simulation shows the average measured load on a peer of a given upload capacity. We see that, overall, our model captures the curvature of the simulation results: the expected load decreases sub-linearly as the upload capacity of a peer increases. The model agrees with the simulations in that the expected load on any peer is under 2.5 packets, and the ex-pected load on the top half of the peers (i.e.those with higher capacity) is under 1 packet. The total expected load N is under 200 packets according to both the model and the simulations, implying that the expected load per node is also under 1 packet.

5 10 15 20 25 30 35 40 45 50 0

0.5 1 1.5 2 2.5

Peer Upload Capacity

Expected Queue Size

model simulation

Figure 4.5: Expected Load on Peers with Upload Capacities between 1 and 50 As the range of the upload capacities increases from 10 to 50 to 100, the model begins to over-predict the load on the higher capacity peers. The reason for this is the simple assumption made in our model that each peer is equally likely to occur in the active prefixes of the randomized list for all peers. We reasoned that because each peer is equally likely to be getting packets from other peers ki = k, ∀i. This is a good approximation that produced our model. However, there are second-order effects that skew ki to be higher for lower-capacity peers and lower for high-capacity peers, meaning that more packets are directed at the lower-capacity peers. The reason for this skew is as follows. Lower-capacity peers spend most of the time in the state of non-zero load, and do not send load packets themselves. Thus, their randomized lists are essentially inactive. Since a randomized list of a peer Li does not include Li itself,

10 20 30 40 50 60 70 80 90 100 0

0.5 1 1.5 2 2.5

Peer Upload Capacity

Expected Queue Size

model simulation

Figure 4.6: Expected Load on Peers with Upload Capacities between 1 and 100 the low-capacity peers’ randomized lists are more skewed towards including higher-capacity peers and vice-versa. Because the low-higher-capacity peers’ randomized lists are less active, or inactive, the higher-capacity peers have a smaller packet arrival rate.

Since our model does not take this second-order effect into account it tends to over-predict load on the higher-capacity peers. In fact, for a higher value of r there is a bigger disparity between low and high-capacity peers, with higher-capacity peers getting an even smaller arrival rate as compared to the low-capacity peer. Thus, as r increases our model tends to over-predict the load on higher-capacity peers more.