Bittorent

Modeling and Performance
Analysis of Bitorrent-Like
Peer-to-Peer Networks
Dongyu Qiu and R. Srikant University of Illinois , 2004
Presented by : Ran Zivhon
Agenda








P2P characteristics
Bitorrent – characteristics , protocol
Optimistic unchoking , free-riding
Fluid model , steady state calculations and
Simulations
Lemmas
Peers strategy
Nash Equilibrium
Article evaluation
Previous Work



Bram Cohen, 2003
“Incentives Build Robustness in Bitorrent”
G. de Veciana and X. Yang , 2003
“Fairness, incentives and performance in peer-topeer networks”
G. de Veciana and X. Yang , 2004
“Service Capacity of Peer to Peer Networks”

Z. Ge, D. R. Figueiredo and D. Towsley , 2003
“Modeling peer-peer file sharing systems.”
P2P - Characteristics


A P2P computer network connects peers and relies
primarily on their computing resources
Decentralized - Little or no infrastructure – no central
server

Self-organizing

All or most communication is symmetric

The network connects Lots of nodes

Dynamic nodes : join leave failure – high “churn”

Communication between every pairs of nodes

Nodes don’t have much resources
Bitorrent - Description




Bitorrent is a P2P file-sharing application
The protocol was originally designed and created by
programmer Bram Cohen
Files are divided into pieces of size 256 KB and subpieces of size 16KB
The client Software is “save as” like software
Bitorrent – the protocol



A downloader first connects to a .torrent file (on the web)
,
finds the tracker of the file and get a list of all the peers
which have the file (referred as peer list , torrent).
The .torrent file contains meta information - length,
name, hash, URL of tracker etc.
After connection with the peers the downloader gets the
piece list of the other peers.
Bitorrent – the protocol

When downloading the peer uses the following Piece
selection schemes :
 Random First Piece
 The piece to download is selected at random
until the first complete piece is assembled
 Rarest First
 The piece to download is the most rare piece at
the other peers in the peer list
 Endgame Mode
 When all the remaining sub-pieces are requested
, the peer ask for the sub-pieces from all the
peers in the peer list .
Bitorrent – the protocol

The peer advertises its complete pieces to the peer
list and get a new peer list from the tracker .

when a peer joins , leaves , complete it’s download it
notifies the tracker.

The peer Periodically calculate data-receiving rates
and continuesly look for the fastest partners


Each peer is allowed to upload to a fixed number of
peers (default is 4) which provide it with the best
downloading rate
Peers divided to downloaders (leechs) and seeders
Seeders – peers that have the whole file and just upload it to
others
Bitorrent– Description Cont.
Tracker
Web Server
C
A
Peer
Peer
[Leech]
New
Downloader
B
Peer
[Leech]
[Seed]
Bitorrent – Description Cont.
Tracker
Web Server
C
A
Peer
Peer
[Leech]
New
Downloader
B
Peer
[Leech]
[Seed]
Bitorrent – Description Cont.
Tracker
Web Server
C
A
Peer
Peer
[Leech]
New
Downloader
B
Peer
[Leech]
[Seed]
Bitorrent – Description Cont.
Tracker
Web Server
C
A
Peer
Peer
[Leech]
New
Downloader
B
Peer
[Leech]
[Seed]
Bitorrent – Description Cont.
Tracker
Web Server
C
A
Peer
Peer
[Leech]
New
Downloader
B
Peer
[Leech]
[Seed]
Bitorrent – Description Cont.
Tracker
Web Server
C
A
Peer
Peer
[Leech]
New
Downloader
B
Peer
[Leech]
[Seed]
Bitorrent – Description Cont.
Tracker
Web Server
C
A
Peer
Peer
[Leech]
New
Downloader
B
Peer
[Leech]
[Seed]
Optimistic Unchocking

A peer uploads to nu (default 4) other peers which provide
it with the best downloading rate.

Optimistic Unchoking happens once every 30 seconds

The peer selects randomly another (fifth ) peer to
download to , for exploring other download rates.

Then the upload to the peer with the least downloading
rate is dropped.

The optimistic-unchocking gives opportunity to the freeriders.
Free-Riding




A peer which only downloads from others and not
upload called a free-rider.
Peer i which is a free-rider get selected 1/(N-nu) of
the time by any other peer (optimistic unchocking).
Download rate : N = number of peers , u = upload
rate
The free-riders problem is not yet solved in Bitorrent.
Bitorrent - software
Fluid Model

x(t) - number of downloaders 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 uploading bandwidth of a given peer (normalized by file size)

C - the downloading bandwidth of a given peer (normalized by file size).

θ - the rate at which downloaders abort the download (Poisson process)

γ- the rate at which seeds leave the system (Poisson process)

η - indicates the effectiveness of the file sharing , takes values in [0, 1].

Is this model realistic ?
Fluid Model




Total Upload rate - min{cx(t), µ(η x(t)+ y(t))}
- c and µ dimensions are file/sec
The probability that some downloader becomes a seed in
a small interval δ - min{cx, µ(η x+ y)}δ.
Is this proposition realistic ?
The rate of departures of downloaders min{cx(t), µ(η x(t) + y(t))} + θx(t)
Steady-State Performance


X¯ , Y ¯ are equilibrium values
β is determined by the bottleneck
between download rate and upload rate
Average Download Time




Little Law : (λ- θx) - average rate
downloads complete
The average downloading time T
is not related to λ, even very popular
files can be downloaded same time
as less popular .
When η increases , T decreases. This
is because the peers share the fille
more efficiently.
When γ increases , T increases
because a larger γ means that there
are fewer seeds in the system.
η
- Effectiveness
of the File Sharing




A given downloader i, is
connected to k = {x- 1, K} other
downloaders
N – number of pieces in a file
ni – number of pieces at
downloader i
Even if k=1 , η very close to 1
Local Stability and Markov
model

eigenvalues of A1 and A2 have
negative real parts – system is
stable.

x^,y^ are the variance values
around the fluid model values

Orenstein-Uhlenbeck process :

When λ is large – how large?

W are independent standard
Wiener processes
With this model the system is simulated
X / λ – downloaders (3 days)
Y/ λ – seeds (3 days)
Histogram of Variation of
x^,y^ around X,Y
Gaussian nature , the values look the same for all λ
X,Y – real scenario (3 days)
95% confidence intervals , the fluid model
resembles real life scenario results.
Peer Selection Algorithm



Peer i selects the nu (default 4) peers that give it the best upload to
download to
Assumptions :
Global information,No optimistic unchocking ,No download limit
sort the peers according to their uploading bandwidth (physical or
determined)

first peer has the highest uploading bandwidth.

peer i choosing peers to upload at step i.

N total number of peers

µi the uploading bandwidth of peer i.
Peer Selection Algorithm rules



Using these rules does the system converges?
Rule number 1 , is this rule realistic ?
Does the arrangement of peers according to physical upload is necessary
true ?
Lemmas

Lemma 1. With the peer selection algorithm, when peer i

Lemma 2. Suppose that peers i, i+1, · · · , j have the

selects uploading peers, nii ≤ nu and for any k2 > k1 ≥ i,
nik2 ≤ nik1 ≤ nu
same uploading bandwidth µ.If j –i+1 > nu ≥ 2, then for
any k > j, we have
1. di ≥ di+1 ≥ · · · ≥ dj ≥ dk,
2. di > dk,
3. d(µ) > dk.
This lemma gives the Optimal selfish behavior , and that is
what encourage peers to upload.
Peer Strategy

peer i chooses µi such that :

Or more realistic

Where ε is the difference between two
rates that a peer can differentiate.
Nash Equilibrium Point



Divide the network to sub-groups . In each group j, all peers
have the same physical uploading bandwidth pj.
if the number of peers in a group ||gj|| > nu + 1 for all
groups, a Nash equilibrium exists in the system, when µi =
pj.
What if every group is Nu + 2 size - can the nu+2’th peer lower it’s
uplink to the sub-group below ?
Strengths of Bitorrent

Very high throughput of the network

tit-for-tat – encouraging cooperation

Ability to resume a download

Average download time doesn’t depends on
popularity
Drawbacks of Bitorrent




Small files – latency, overhead
Tracker :
 Millions of peers – Tracker behavior (uses 1/1000
of bandwidth)
 Single point of failure
Seeds have no benefit for cooperating
Fairness: those who do not contribute should not be
able to receive good service (free – riding)
Article Evaluation

Novelty ? – much of the ideas are from previous work
Realistic ? – many of the assumptions aren’t real-life (many

constants are not constant , peer selection algorithm, BT unique piece
selection)
Missing –







how the upload bandwidth divided among downloaders
Byzantine and selfish behavior
how does the peer selection resembles real life scenarios.
Technically Sound
Evaluated – simulations with real-life scenarios.
Clear and self-contained