BitTorrent
BitTorrent
Prof. Dah Ming Chiu, Chinese University of Hong Kong, Hong Kong
Dr. Iqbal Mohomed, University of Toronto, Canada
IP multicast
CDN (Content Distribution Network)
Application layer multicast
Overlay structures
Tree-based (push)
Data-driven (pull)
P2P swarming
BitTorrent, CoolStreaming
Released in the summer of 2001
Basic ideas from game theory to largely eliminate
the free-rider problem
All precedent systems could not deal with this problem
well
No strong guarantees unlike DHTs
Working extremely well in practice unlike DHTs
A file is chopped into small pieces, called chunks
Pieces are disseminated over the network
As soon as a peer acquire a piece, it can trade it for
missing pieces with other peers
A peer hopes to be able to assemble the entire file
at the end
Web server
The .torrent file
Tracker
Peers
Content discovery (i.e., file search) is handled
outside of BitTorrent, using a Web server
To provide the “meta-info” file by HTTP
For example, http://bt.btchina.net
The information about each movie or content
is stored in a metafile such as
“supergirl.torrent”
Static file storing necessary meta information
Name
Size
Checksum
The content is divided into many “chunks” (e.g., 1/4 megabyte
each)
Each chunk is hashed to a checksum value
When a peer later gets the chunks (from other peers), it can
check the authenticity by comparing the checksum
IP address and port of the Tracker
Keeping track of peers
To allow peers to find one another
To return a random list of active peers
Two types of peers:
Downloader (leecher) : A peer who has only a part (or
none) of the file.
Seeder: A peer who has the complete file, and chooses
to stay in the system to allow other peers to download
Matrix.torrent
User
Bob
Web Server
Tracker
User User
User
Seeder:
Alice
{}{1,2,3}
{1,2,3,5}
{}
{1,2,3}
{1,2,3,4}
{1,2,3,4,5} User
User
Downloader
Downloader Joe
Bob
Rarer pieces are given priority in downloading
with the rarest being the first candidate
The most common pieces are postponed
towards the end
This policy ensures that a variety of pieces are
downloaded from the seeder, resulting in
quicker chunk propagation
Basic idea of tit-for-tat strategy in BitTorrent:
Maintain 4-5 “friends” with which to exchange chunks
40kb/s 70kb/s
User
110kb/s
10kb/s
Downloader
Joe 70kb/s
10kb/s
20kb/s 30kb/s
5kb/s
15kb/s
User
User
Downloader:
Downloader: Bob
User
Ed Downloader:
User
Downloader:
David
Chris