Transcript Document

Network Technologies essentials
Week 9: Distributed file sharing & multimedia
Videos 8-6, 8-7, 8-9 and 9-1 to 9-3
Compilation made by Tim Moors, UNSW Australia
Original slides by David Wetherall, University of Washington
ISBN-10: 0133766624 © 2014
For the book A. Tanenbaum and D. Wetherall: Computer Networks, 5th ed, Prentice-Hall, 2011
Web Caching
• Users often revisit web pages
– Big win from reusing local copy!
– This is caching
Local copies
Cache
Network
Server
• Key question:
– When is it OK to reuse local copy?
Computer Networks
8-6.3
2
Web Caching (4)
• Putting the pieces together:
Computer Networks
8-6.6
3
After CDNs (2)
• Benefits assuming popular content:
– Reduces server, network load
– Improves user experience (PLT)
User
...
Source
Computer Networks
Replica
User
8-7.6
4
Content Delivery Network
Computer Networks
8-7.9
5
Content Delivery Network (2)
• DNS resolution of site gives different answers to clients
– Tell each client the site is the nearest replica (map client IP)
Computer Networks
8-7.10
6
P2P Challenges
• No servers on which to rely
– Communication must be peer-to-peer
and self-organizing, not client-server
– Leads to several issues at scale …
Peer
Peer
Computer Networks
Peer
Peer
Peer
8-9.5
7
P2P Challenges (2)
1. Limited capabilities
– How can one peer deliver content
to all other peers?
2. Participation incentives
– Why will peers help each other?
3. Decentralization
– How will peers find content?
Computer Networks
8-9.6
8
BitTorrent Protocol
• Steps to download a torrent:
1. Start with torrent description
2. Contact tracker to join and get list
of peers (with at least seed peer)
2. Or, use DHT index for peers
3. Trade pieces with different peers
4. Favor peers that upload to you
rapidly; “choke” peers that don’t
by slowing your upload to them
Computer Networks
8-9.13
9
BitTorrent Protocol (2)
• All peers (except seed) retrieve torrent at the same time
Computer Networks
8-9.14
10
Network Delay (2)
• Network delay is variable
Fraction (PDF)
– Message latency plus queuing delay
– Variability in delay is called jitter
Latency
Queuing
Delay (msec)
Computer Networks
9-2.4
11
Playout Buffer (2)
• Media arrival curve determines
time in playout buffer and deadline
Media timestamp
Buffering
Computer Networks
Playout
Too late!
Time
9-2.9
12
RTP (Real-time Transport Protocol)
• Used to carry media on top of best effort UDP (§6.4.3)
– Header has media format, timestamp, sequence number, etc.
– Media follows in standard formats, e.g., G.711, MP4
Computer Networks
9-2.13
13
SIP Signaling (2)
• Signaling for call control
– Like HTTP, uses simple
method/response codes
– Runs on UDP or TCP
– SIP proxy servers and
registrars provide
mobility (not shown)
Computer Networks
INVITE
180 RINGING
200 OK
ACK
Accept
call
RTP media
BYE
200 OK
Hang
up
9-2.16
14
Handling Bandwidth
• Send file in one of multiple encodings
– Higher quality encodings require more bandwidth
– Select best encoding given available bandwidth
Higher quality
More bandwidth
15:1
Lower quality
Less bandwidth
(JPEG example)
23:1
46:1
144:1
By Toytoy, CC-BY-SA-3.0, from Wikimedia Commons
Computer Networks
9-3.6
15
Streaming with HTTP
• Fetch media description data
– Gives index of clips, rates
• Fetch small segments
– Put in playout buffer
• Adapt selection of encoding
GET INDEX
GET MEDIA
– Based on buffer occupancy
GET MEDIA
• Evolving standards, e.g., DASH
GET MEDIA
– Leverages HTTP and HTML5
– Server is otherwise stateless
Computer Networks
GET MEDIA
9-3.10
16
END
© 2013 D. Wetherall
Slide material from: TANENBAUM, ANDREW S.; WETHERALL, DAVID J., COMPUTER NETWORKS, 5th Edition, © 2011.
Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle River, New Jersey
Computer Networks
17