Network Technologies essentials Week 9: Distributed file sharing & multimedia Compilation made by Tim Moors, UNSW Australia Original slides by David Wetherall,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Web Caching• Users often revisit web pages– Big win from reusing local copy!– This is caching
• Key question:– When is it OK to reuse local copy?
NetworkCache
Local copies
Server
8-6.3
Computer Networks 3
Web Caching (4)• Putting the pieces together:
8-6.6
Computer Networks 4
After CDNs (2)• Benefits assuming popular content:– Reduces server, network load– Improves user experience (PLT)
Source
User
User
. . .Replica
8-7.6
Content Delivery Network
Computer Networks 58-7.9
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 68-7.10
Computer Networks 7
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
Peer
PeerPeer
8-9.5
Computer Networks 8
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?
8-9.6
Computer Networks 9
BitTorrent Protocol• Steps to download a torrent:
1. Start with torrent description2. Contact tracker to join and get list of
peers (with at least seed peer)2. Or, use DHT index for peers3. Trade pieces with different peers4. Favor peers that upload to you rapidly;
“choke” peers that don’t by slowing your upload to them
8-9.13
BitTorrent Protocol (2)• All peers (except seed) retrieve torrent at the same time
Computer Networks 108-9.14
Computer Networks 11
Network Delay (2)• Network delay is variable– Message latency plus queuing delay– Variability in delay is called jitter
Delay (msec)
Frac
tion
(PD
F)
Latency Queuing
9-2.4
Computer Networks 12
Playout Buffer (2)• Media arrival curve determines
time in playout buffer and deadline
Time
Med
ia ti
mes
tam
p
PlayoutBuffering
Too late!
9-2.9
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 139-2.13
Computer Networks 14
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)
INVITE180 RINGING
200 OK
Acceptcall
BYE
RTP media
200 OKACK
Hangup
9-2.16
Handling Bandwidth• Send file in one of multiple encodings– Higher quality encodings require more bandwidth– Select best encoding given available bandwidth
Computer Networks 15
By Toytoy, CC-BY-SA-3.0, from Wikimedia Commons
23:1 46:1 144:115:1
Higher qualityMore bandwidth
Lower qualityLess bandwidth
(JPEG example)
9-3.6
Computer Networks 16
Streaming with HTTP• Fetch media description data
– Gives index of clips, rates• Fetch small segments
– Put in playout buffer• Adapt selection of encoding
– Based on buffer occupancy
• Evolving standards, e.g., DASH – Leverages HTTP and HTML5– Server is otherwise stateless