Professional Documents
Culture Documents
09 Bit Torrent
09 Bit Torrent
Slide 3
Last class
• Email!
– Application Layer Protocol
Slide 7
If SMTP only allows 7-bit ASCII, how do we
send pictures/videos/files via email?
Slide 8
Base 64
Slide 9
Multipurpose Internet Mail Extensions (MIME)
• Supports
– Text in character sets other than ASCII
– Non-text attachments
– Message bodies with multiple parts
– Header information in non-ASCII character sets
Slide 10
MIME
Slide 11
Mail access protocols
user mail access user
SMTP SMTP
agent protocol agent
(e.g., POP,
IMAP)
sender s mail receiver s mail
server server
Slide 12
POP3 protocol
S: +OK POP3 server ready
authorization phase C: user bob
• client commands: S: +OK
– user: declare username C: pass hungry
– pass: password S: +OK user successfully logged on
• Limitations:
– Can’t retrieve just the headers
– Can’t impose structure on messages
Slide 14
IMAP
• Keeps all messages in one place: at server
Slide 15
Webmail
Slide 16
Summary
Slide 17
Today
• P2P applications
• BitTorrent
– Cooperative file transfers
Slide 18
Where we are
Network: routing
Slide 19
Designating roles to an endpoint
Slide 20
File Transfer Problem
Slide 21
Traditional Client/Server
Slide 22
Traditional Client/Server
Slide 23
What is the biggest problem you run into with
the traditional C/S model?
Slide 24
Traditional Client/Server
Free Capacity
Heavy Congestion
Slide 25
P2P Solution
Slide 26
Client-server vs. P2P: example
3.5
P2P
Minimum Distribution Time
3 Client-Server
2.5
1.5
0.5
0
0 5 10 15 20 25 30 35
Let F = file size, client UL rate = u, server rate = us, d = client DL rate
Assumptions: F/u = 1 hour, us = 10u, dmin ≥ us Lecture 13 - Slide 27
P2P Solution
Am I helpful?
Slide 28
Do we need a centralized server at all?
Would you use one for something?
Am I helpful?
E G
A C
F
B
D Slide 30
File Search via Flooding in Gnutella
Slide 31
What are the cons of the Gnutella approach?
Slide 32
Peer Lifetimes: Highly available?
• Study of host uptime and application uptime (MMCN
2002)
– Sessions are short (median is 60 minutes)
– Hosts are frequently offline
Percentage of Hosts
Slide 33
Host Uptime (out of 100%)
Slide 34
Alice arrives …
… obtains list
of peers from tracker
… and begins exchanging
file chunks with peers in torrent Slide 35
.torrent files
Slide 36
BitTorrent : Peer Joining
Slide 37
P2P file distribution: BitTorrent
Slide 38
Requesting Chunks
• Periodically, each asks peers for list of chunks that they have.
Slide 39
Sharing Pieces
Initial Seeder
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8
A. Random chunk.
B. Most common chunk.
C. Least common chunk.
D. Some other chunk.
E. It doesn’t matter.
Slide 41
Requesting Chunks
Slide 43
Academic Interest in BitTorrent
• Research
– Modifications to improve performance
– Modeling peer communications (auctions)
– Gaming the system (BitTyrant)
Slide 44
Incentives to Upload
45
Unchoker Example
Round t Round t + 1
13 10
10 10
12 10
15 10
46
Abusing the Unchocker
10
12
Send
Senda lot
justof 10
1st
data, getdata,
enough
7
getplace
4th place
9
15 10
20
11 10
47
Sybil Attack
Round t Divide Round t + 1
13 Only receive
resources 10
10 10 pieces
across 3 fake
12 peers 10
15 10
42
14 10
14 10
Receive 30
14 10
pieces
Total Capacity = 42
48
BitTyrant
49
Slide 50
supernode
Skype: P2P VoIP
51
Do the benefits of hierarchical P2P networks
out-weight the cons?
A. Pros: Scalability
B. Pros: Limits flooding
C. Cons: No guarantees of performance
D. Cons: Failure?
Slide 52