Professional Documents
Culture Documents
1. BitTorrent Background
a) What is BitTorrent?
b) Whos the author, history
2. The Protocol
a) Terminology
b) Distributed Scenario
c) Structure of .torrent files
d) Protocol between peers and trackers
3. BitTorrent Applications
a) Bittorent Inc, Usages throughout industry
BitTorrent
http://www.cs.uiowa.edu/~ghosh/bittorrent.ppt
What is BitTorrent?
BitTorrent introduced two novel concepts
Rather than providing a search protocol itself, it
was designed to integrate seamlessly with the
Web and made files (torrents) available via Web
pages, which could be searched for using
standard Web search tools.
It enabled so-called file swarming; that is, once
a peer starts downloading that file, it also makes
whatever portion of the file that is downloaded
immediately available for sharing.
What is BitTorrent
The file-swarming process is enabled through
the use of a tracker:
an HTTP-based server used to dynamically
synchronise and update the peers as they are
downloading - tracks availability of pieces of the file
on the network.
The tracker also can monitor users usage on the
network how much do they contribute?
Then implements a tit-for-tat scheme, which
divides bandwidth according to how much a peer
contributes to the other peers in the network if you
do not share, you cannot consume.
BitTorrent Bram Cohen
Born 1975 - computer programmer
Engineered large parts of Mojo
Nation (mojonation.net) - parts of it
similar in flavour to Bittorrent (Pre
April 2001).
April 2001, Focused on authoring the
peer-to-peer (P2P) BitTorrent
protocol and writing the first file
sharing program to use the protocol, Currently lives in the
also known as BitTorrent. San Francisco Bay
Area
He is also the organizer of the San
Francisco Bay Area P2P-hackers
meeting, and the co-author of
Codeville.
Start of BitTorrent - CodeCon
Cohen unveiled his novel ideas at the first
CodeCon conference in 2002
CodeCon is a conference for hackers and
technology enthusiasts.
Co-organised by Bram and his roommate Len
Sassaman.
CodeCon intended to be a low cost conference
(I.e. <$100) with a focus on developers doing
presentations of working code, rather than on
companies with products to sell.
It remains an event for those seeking information
about new directions in software, though
BitTorrent continues to lay claim to the title of
"most famous presentation".
Features?
Peer-to-peer in nature
Taxonomy for Distributed Systems
pieces
Features?
Peer-to-peer in nature
Central server called a tracker
Tracker uses HTTP
Download and upload at the same time
Efficiency improves the more a file is
downloaded
Downloading Speeds
Download speeds depend on two factors:
The BitTorrent
Solution:
customers help
distribute content
BT 1
BT 3
Step 2 - Piece 1
Step 2 - Piece 3
BT 2
Step 1 Step 2 - Piece 2
Step 2
Tracker GET Request
Peer -> Tracker
Info_hash - 20 byte SHA1 hash of the bencoded form of
the info value from the metainfo file.
Peer_id - string of length 20 containing ID of downloader
- generated at random at the start of a new download.
IP - IP (or dns name) of peer.
Port - port number for the peer - tries port 6881 and if
that port is taken try 6882, then 6883, etc. and give up
after 6889.
Uploaded - total amount uploaded so far.
Downloaded - The total amount downloaded so far.
Left - number of bytes this peer still has to download
Event - optional key which maps to started, completed,
or stopped (or empty, which is the same as not being
present).
Tracker Response
Tracker -> peer
Tracker responses are bencoded dictionaries.
If a tracker response has a key failure reason,
then that maps to a human readable string which
explains why the query failed, and no other keys
are required.
Otherwise, it must have two keys:
Interval which maps to the number of seconds the
downloader should wait between regular rerequests
Peers maps to a list of dictionaries corresponding to
peers, each of which contains the keys peer id, ip, and
port, which map to the peer's self-selected ID, IP
address or dns name as a string, and port number,
respectively.
Scenario
Web Server Tracker
Web page
with link
to .torrent
nt
.torre
C
A
Peer
Peer [Seed]
B
[Leech]
Downloader Peer
US [Leech]
Scenario
Web Server Tracker
Web page
with link
to .torrent
nce
u
nno
et-a
G
C
A
Peer
Peer [Seed]
B
[Leech]
Downloader Peer
US [Leech]
Scenario
Web Server Tracker
Web page
with link
to .torrent
l i st
eer
e-p
ons
esp
R
C
A
Peer
Peer [Seed]
B
[Leech]
Downloader Peer
US [Leech]
Scenario
Web Server Tracker
Web page
with link
to .torrent
Shake-hand
C
A
Sh Peer
ak
Peer e-h [Seed]
an
d B
[Leech]
Downloader Peer
US [Leech]
Scenario
Web Server Tracker
Web page
with link
to .torrent
pieces
C
A pie
ce
s Peer
Peer [Seed]
B
[Leech]
Downloader Peer
US [Leech]
Scenario
Web Server Tracker
Web page
with link
to .torrent
pieces
C
A pie
ce
s Peer
pie
Peer ce [Seed]
s
B
[Leech]
Downloader Peer
US [Leech]
Scenario
Web Server Tracker
Web page
with link
to .torrent
n ce
u
nno st
t -a l i
Ge eer
e-p
ns
s po
Re pieces
C
A pie
ce
s Peer
pie
Peer ce [Seed]
s
B
[Leech]
Downloader Peer
US [Leech]
Strengths
Better bandwidth utilization
Never before speeds.
Up to 7 MB/s from the Internet.
Limit free riding tit-for-tat
Limit leech attack coupling upload &
download
Spurious files not propagated
Ability to resume a download
Open Source implementations !
Potential Drawbacks
Small files latency, overhead
Scalability
Millions of peers Tracker behavior (uses 1/1000 of
bandwidth)
Single point of failure - although there can be many trackers,
there is only one tracker assigned to each torrent file
Difficult to load balance
Solved later by having lists of alternative trackers
Robustness
System progress dependent on altruistic nature of seeds
(and peers)
Malicious attacks and leeches.
Who Uses it?
1. BitTorrent
a) Underlying file sharing protocol
b) Role of the .torrent
c) Use and role of the tracker
d) Bittorrent Scenario
e) How file swarming works