Title: Improving BitTorrent
1ImprovingBitTorrent
- Designing a new BitTorrent Client
2Overview
- How BitTorrent Works
- Experimental Analyses
- Modeling Gittins Indices
- Our New Algorithms
- Proposed Evaluation
- HELP!
3File Organization
File
4
2
3
1
Piece256KB
Block16KB
Incomplete Piece
4Initialization
webserver
user
5On the Wire Protocol
Non-keepalive messages
0 choke 1 unchoke 2 interested 3 not
interested 4 have 5 bitfield 6 request 7
piece 8 cancel
ID/Infohash Handshake
BitField
BitField
Local Peer
Remote Peer
Interested 0choked 1
Interested 0choked 1
6Piece Selection
- Pipelining (5 requests)
- Strict Priority
- 3 stages
- Random first piece
- Rarest First
- Endgame mode
7Peer Selection
- Focus on Rate
- Upload to at most 4 peers
- Random Unchoke
- Global rate cap only
8Analyses
- N. Liogkas et al., Exploiting BitTorrent For Fun
(But Not Profit), IPTPS 2006. - A. Legout et al., Rarest First and Choke
Algorithms Are Enough, June 2006 - A. R. Bharambe et al. Analyzing and Improving
BitTorrent Performance, Feb 2005.
9Exploitation Liogkas et al.
- PlanetLab Real Torrent
- Exploits
- Download only from seeds
- Median improvement of 7-20
- Download only from fastest peers
- Contradictory results
- good in PlanetLab (22)
- bad in the wild(-1 to -30)
- Advertise false pieces
- 22 better download rates
10Piece Selection Legout et al.
11Piece Selection Legout et al.
a local peer interested in remote
peer b time peers are connected c
remote peer interested in local peer
12Piece Selection Legout et al.
- Limitations
- In 25 of the torrents the local peer is not
interested. - Who is interested in me?
13Gittins Indices
- The Two-armed bandit problem
- Same prize
- Unknown winning probabilities
- Known discount factor
- Limitation
- Infinitely discounted or fixed horizon
- Projects remain dormant
- One project at a time
- P. Whittle 1988
- Restless bandits
- m projects on average
- Asymptotically optimal for large m and n
14Piece Selection
- Key ideas
- We dont care about piece selection
- Keep download pipes full
- Peer Queues
- Assume
- We receive pieces at a rate of 1 per second
15Piece Selection
Local Peer
Remote Peer
16Piece Selection
Q1
Peer 1
Q2
Remote Peer
Local Peer
Peer 2
Q3
Peer 3
17Piece Selection
- Cost of empty queue Ci per unit time
- Discount factor d lt1
- Piece consumption rate li (Poison Process)
- Queue has length li(t)
18Piece Selection
We can Solve this with Gittins Indices!
19Piece Selection Algorithm(alpha version)
- Calculate Gittins Index for each queue
- Feed the queue with the highest index.
- Two Problems
- 1 piece goes into many queues
- it takes a while to get the pieces
20Piece Selection Algorithm(beta version)
- Calculate Gittins Index for each queue
- Calculate Gittins index for each piece.
- n(piece) SA
- Get piece with highest index possible.
21Piece Selection Algorithm
highest index
Peer 1
Peer 2
lowest index
Peer 3
time
22Piece Selection Algorithm(Final Release)
- Calculate Gittins Index for each queue.
- Calculate Gittins index for each piece.
- Extrapolate piece download finishing time.
- Order finishing times (earliest first).
- Order pieces (highest index first).
- Match best piece with earliest finishing time.
23Peer Selection
- Key Ideas
- upload rate is a perishable good
- Throttle each connection individually
- Do not limit number of downloaders to 4
24Peer Selection Our Model
- Series of rounds
- Edownload rate f(upload rate)
- Estimate download rates with have.
25Peer Selection Algorithm
- Keep clients with best ratios.
- Throttle to estimated safe bound.
- Solve Knapsack problem
- Total upload bandwidth max weight
- Item value download rate we are getting
- Item weight estimated upload bound
- If download/upload rate ratio is lt 1
- Random unchoke
26Evaluation
- Simultaneously
- Identical machines and network.
- Repeat experiment and swap clients.
- Different torrents
vs.
27HELP!
- What we need
- An awesome python programmer 0)
- Whats in it for you
- We are cool! 0)
- Publications
- Open Source Real Estate
28- Thank you!
- defigued_at_cs.ucdavis.edu