A P2P file distribution system - PowerPoint PPT Presentation

About This Presentation
Title:

A P2P file distribution system

Description:

2 The .torrent file. Static metainfo' file to contain necessary ... To verify data, Hash codes are used for all the pieces, included in .torrent files. ... – PowerPoint PPT presentation

Number of Views:140
Avg rating:3.0/5.0
Slides: 23
Provided by: cseCu
Category:

less

Transcript and Presenter's Notes

Title: A P2P file distribution system


1
A P2P file distribution system BitTorrent
  • Fan Bin
  • bfan_at_cse.cuhk.edu.hk
  • Sep,25,2004

2
Outline
  • 1 Why do we need BitTorrent
  • 2 Whats it
  • 3 How does it work
  • 4 Why does it work so well

3
Problems
  • Traditional Client/Server Sharing
  • Performance deteriorates rapidly as the number of
    clients increases
  • Free-riding in P2P network
  • Free riders only download without contributing
    to the network.

4
BitTorrent
  • Scalability of BitTorrent is very good. Even
    more peers means better performance.
  • Strong incentives to prevent free-riding.

5
Outline
  • 1 Why do we need BitTorrent
  • 2 Whats it
  • 3 How does it work
  • 4 Why does it work so well

6
Critical Elements
  • 1 A web server
  • To provide the metainfo file by HTTP
  • For example
  • http//bt.btchina.net
  • http//bt.ydy.com/

Web Server
The Lord of Ring.torrent
Troy.torrent
7
Critical Elements
  • 2 The .torrent file
  • Static metainfo file to contain necessary
    information
  • Name
  • Size
  • Checksum
  • IP address of the Tracker

8
Critical Elements
  • 3 A BitTorrent tracker
  • Non-content-sharing node
  • Track peers
  • For example
  • http//bt.cnxp.com8080/announce
  • http//btfans.3322.org6969/announce

9
Critical Elements
  • 4 An end user (peer)
  • Guys who want to use BitTorrent must install
    corresponding software or plug-in for web
    browsers.
  • Downloader (leecher) Peer has only a part ( or
    none ) of the file.
  • Seeder Peer has the complete file, and chooses
    to stay in the system to allow other peers to
    download

10
Outline
  • 1 Why do we need BitTorrent
  • 2 Whats it
  • 3 How does it work
  • 4 Why does it work so well

11
Connectivity
Web Server
Fan Bin
Tracker
Downloader Joe
Seeder John
Downloader Haibin
12
Piece
  • A file is cut into pieces of fixed size,
    typically 256Kb
  • Each downloader reports to all of its peers what
    pieces it has.
  • To verify data, Hash codes are used for all the
    pieces, included in .torrent files.

13
A trivial example
1,2,3,4,5,6,7,8,9,10
Seeder John

1,2,3
1,2,3,5

1,2,3
1,2,3,4
1,2,3,4,5
Downloader Joe
Downloader Fan Bin
14
Outline
  • 1 Why do we need BitTorrent
  • 2 Whats it
  • 3 How does it work
  • 4 Why does it work so well

15
Piece Selection
  • Strict Priority
  • First Priority
  • Rarest First
  • General rules
  • Random First Piece
  • Special case, at the beginning
  • Endgame Mode
  • Special case, in the end

16
Peer Selection
  • Built-in incentive mechanism (where all the magic
    happens)
  • Choking Algorithm
  • Optimistic Unchoking
  • Anti-snubbing

17
Choking Algorithm
  • Choking is a temporal refusal to upload
  • Choking evaluation is performed every 10 seconds.
  • Each peer unchokes a fixed number of peers
    (default 4)
  • The decision on which peers to un/choke is based
    solely on download rate, which is evaluated on a
    rolling, 20-second average

18
Reasons for Choking
  • TCP congestion control.
  • To ensure the peers to get a consistent download
    rate.

Joe
Choked
Choked
Fan Bin
19
Optimistic Unchoking
  • a BitTorrent peer has a single optimistic
    unchoke which is uploaded regardless of the
    current download rate from it. This peer rotates
    severy 30s
  • Reason
  • To discover currently unused connections are
    better than the ones being used

20
Anti-snubbing
  • When a peer received no data in 60s, we assume it
    is choked by all other peers, and refuse to
    upload to it except for the optimistic unchoking.
  • Reason
  • It may cause several concurrent optimistic
    unchokes.

21
Example
Fan Bin
40kb/s
70kb/s
70kb/s
10kb/s
110kb/s
Downloader Joe
10kb/s
30kb/s
5kb/s
Downloader Haibin
Downloader Wang Hui
Downloader Gao yan
Downloader Zhang Yu
22
Conclusion
  • BitTorrent is a well thought-out protocol that
    embraces aspects of cooperation and
    self-optimizing mechanisms.
  • BitTorrent propose solutions for current
    optimization and scalability problems
Write a Comment
User Comments (0)
About PowerShow.com