### Modeling and Performance Analysis of BitTorrent-Like Peer-to

```Modelling and Performance Analysis
of BitTorrent-Like
Peer-to-Peer Networks
Contents
 Simple deterministic fluid model – to calculate average file
transfer delay in BitTorrent
 Stochstic fluid model – characterizes number of peers
around equilibrium
 Model to study efficiency of BitTorrent
 Incentive mechanism in BitTorrent and its effect on n/w
performance
Brief Introduction to BitTorrent
 Single large file is divided into pieces of 256 KB each
 Each peer uploads to fixed number of users (Default 4)
 Optimistic unchoking
Deterministic fluid model
 x(t) number of downloaders (also known as leechers) in the system at






time t.
y(t) number of seeds in the system at time t.
λ the arrival rate of new requests( Poisson process)
γ the rate at which seeds leave the system.
η indicates the effectiveness of the file sharing
 dx/dt= λ − θx(t) − min{cx(t), μ(ηx(t) + y(t))},
 dy/dt= min{cx(t), μ(ηx(t) + y(t))} − γy(t),
dx(t)/dt=dy(t)/dt= 0 and obtain equilibrium values x and y
By using Little’s law
 ((λ − θx)/λ)x = (λ − θx)T,

T =1/(θ + β)
where 1/β = max{1/c , 1/η ( 1/μ− 1/γ )}.
Remarks
p2p system scales very well
 When η increases, T decreases
 When γ increases, T increases because a larger γ means that
there are fewer seeds in the system
 Initially, when c increases, T decreases. However, once c is
large enough, increasing c further will not decrease T,
bottleneck. A similar observation can be made regarding the
Importance of η
 When η = 0 and γ > μ
dy(t)/dt ≤ (μ − γ)y(t)
number of seeds will
exponentially decrease to zero and the system dies
 When η > 0, the system reaches a steady state no matter what
γ is.
η is close to 1 in BitTorrent
Stability around equilibrium
 Eigenvalues of matrix obtained from differential equations
have strict negative real parts in all cases hence system is
stable around equilibrium
 Stochastic fluid model :
From the solution of stochastic differential equation it can be
seen that in steady-state, the number of seeds and
 it involves showing that the original stochastic process
converges to the deterministic and stochastic differential
equation limits when the arrival rate goes to ∞
Incentive Mechanism in BitTorrent
 In BitTorrent a peer decides to upload to peers from which it can




Here optimistic unchoking is ignored and assumed that each peer
Stepwise peer selection algorithm
given game rules (peer selection algorithm)
In a general n/w setting, nash equilibrium point exists with
Optimistic unchoking and free riding
 In Bittorrent n/w peer has the rate information about peers
 Hence optimistic unchoking is used to explore the network
and obtain information about other peers and this gives
opportunity to free-ride.
 In a network with group of peers having same b/w μ,free
 In Bittorrent , nu = 4 (default),hence free rider gets 20% of the
Fairness, incentives and performance in
peer-to-peer
networks
Contents
 To study sensitivity of service capacity of P2P networks,
following models are proposed
1.Branching process model in transient regime
2.Markov chain model in stationary regime
 Fairness and incentives in P2P system
Throughput in BitTorrent N/w
Transient regime
 Deterministic model to understand file sharing mechanism
 Assumptions : Initially only one copy of file available
n= 2^k demands,
bandwidth,
file size = s
 A peer can only serve a document once it has been fully
 Then average delay per peer = t log2 n where t= s/b
• Average delay seen by peers scales as log2 n which is favorable
relative to the linear scaling of n in case of fixed set of servers
• Delay is further reduced by a factor of 1/m in case of
Branching process model
Following model takes care of randomness of service times and
abnormal departures of peers
Observations :
1. Variability in generation times improves the growth exponent
2. Increased parallelism typically may decrease the growth exponent