You are on page 1of 42

Mul$media

 Networking  

#8  P2P  Streaming  
Semester  Ganjil  2012  
PTIIK  Universitas  Brawijaya  
Schedule  of  Class  Mee$ng  
1.  Introduc$on     8.  Overlay  Mul-cast  
2.  Applica$ons  of  MN   9.  CDN:  Solu$ons  
3.  Requirements  of  MN   10. CDN:  Case  Studies  
4.  Coding  and   11. QoS  on  the  Internet:  
Compression   Constraints  
5.  RTP   12. QoS  on  the  Internet:  
6.  IP  Mul$cast   Solu$ons  
7.  IP  Mul$cast  (cont’d)     13. Discussion  
14. Summary  
Multmedia  Networking   2  
Today’s  Outline  
•  Ways  to  distribute  video  online  
–  Client-­‐server  
–  IP  Mul$cast  
–  P2P  Media  Streaming  
–  CDN  (Content  Delivery  Networks)  

Multmedia  Networking   3  
Applica$on  Category

Real-time communication

TV  broadcast  
Online  mee$ng  
Live  event  
Online  game
Conference

One-to-many Many-to-many
E-­‐learning Communication
Communication

CDN  
Stored  contents  
VoD  (e.g.  YouTube) Writable  contents?  
(Virtually  many-­‐to-­‐
many)  

Non-real-time communication
Multmedia  Networking   4  
Client-­‐Server  
•  Applica$on-­‐layer  solu$on    
–  Single  media  server  unicasts  to  all  clients    
•  Needs  very  high  capacity  to  serve  large  
number  of  clients    
–  CPU    
–  Memory    
–  Bandwidth    
•  Expensive  for  millions  of  simultaneous  viewers  

Multmedia  Networking   5  
Client-­‐Server  

10  flows    
of  the  same  packet  

SERVER  

Unicast  

Multmedia  Networking   6  
Mul$cast  
•  Basic  idea:  the  same  data  needs  to  reach  mul$ple  
receivers      
 avoid  transmicng  it  once  for  each  receiver    
–  par$cularly  useful  if  access  link  has  bandwidth  
limita$ons    
–  can  be  implemented  at  link,  network  and  applica$on  
layer    
–  e.g.,  mailing  list  as  example    
•  IP  Mul$cast:  Network-­‐layer  solu$on    
–  Routers  responsible  for  mul$cas$ng    

Multmedia  Networking   7  
IP  Mul$cast  
•  Network-­‐layer  solu$on    
–  Routers  responsible  for  mul$cas$ng    
•  Efficient  bandwidth  usage    
•  Requires  per-­‐group  state  in  routers    
–  Scalability  concern    
–  Violates  end-­‐to-­‐end  design  principle    
•  Slow  deployment    
–  IP  mul$cast  is  ofen  disabled  in  routers    
•  Difficult  to  support  higher  layer  func$onality    

Multmedia  Networking   8  
Peer-­‐to-­‐Peer  Networks    
(P2P)  
P2P  Technology  
•  The  servers  serve  only  a  handful  of  clients;    
•  Each  of  the  clients  in  turn  propagate  the  stream  to  
more  downstream  clients  and  so  on.    
•  This  moves  the  distribu$on  costs  from  the  channel  
owner  to  the  user.  
•  Many  P2P  applica$ons  since  the  1990s  
–  File  sharing    
•  Napster,  Gnutella,  KaZaa,  BitTorrent  
–  Internet  telephony    
•  Skype    
–  Internet  television    
•  PPLive,  CoolStreaming,  Joost  

Multmedia  Networking   10  
Why  P2P?  
•  Every  node  is  both  a  server  and  client  
–  Easier  to  deploy  applica$ons  at  endpoints  
–  No  need  to  build  and  maintain  expensive  
infrastructure  
–  Poten$al  for  both  performance  improvement  and  
addi$onal  robustness  
–  Addi$onal  clients  create  addi$onal  servers  for  
scalability  

Multmedia  Networking   11  
P2P  Overview  
•  Applica$on-­‐layer  approach  

•  Clients  send  contents  to  each  other  

•  Use  an  Overlay  Network!  

Multmedia  Networking   12  
Overlay  Network  
•  Consists  of  applica$on-­‐layer  links    
•  Applica$on-­‐layer  link  is  logical  link  consis$ng  
of  one  or  more  links  in  underlying  network    
•  Used  by  both  CDNs  and  pure  P2P  systems  

Multmedia  Networking   13  
Overlay  Networks  

Multmedia  Networking   14  
Overlay  Networks  
Focus at the application level

Multmedia  Networking   15  
Overlay  Networks  
•  A  logical  network  built  on  top  of  a  physical  network  
–  Overlay  links  are  tunnels  through  the  underlying  network  
•  Many  logical  networks  may  coexist  at  once  
–  Over  the  same  underlying  network  
–  And  providing  its  own  par$cular  service  
•  Nodes  are  ofen  end  hosts  
–  Ac$ng  as  intermediate  nodes  that  forward  traffic  
–  Providing  a  service,  such  as  access  to  files  
•  Who  controls  the  nodes  providing  service?  
–  The  party  providing  the  service  (e.g.,  Akamai)  
–  Distributed  collec$on  of  end  users  (e.g.,  peer-­‐to-­‐peer)  

Multmedia  Networking   16  
IP  Tunneling  
•  IP  tunnel  is  a  virtual  point-­‐to-­‐point  link  
–  Illusion  of  a  direct  link  between  two  separated  nodes  
A B E F
Logical view: tunnel

A B E F
Physical view:

 
•  Encapsula$on  of  the  packet  inside  an  IP  datagram  
–  Node  B  sends  a  packet  to  node  E  
–  …  containing  another  packet  as  the  payload  

Multmedia  Networking   17  
Server  Distribu$ng  a  Large  File  
F bits
d4

upload rate us
Internet

d1 d3

d2

download rates di
Multmedia  Networking   18  
Server  Distribu$ng  a  Large  File  
•  Sending  an  F-­‐bit  file  to  N  receivers  
–  Transmicng  NF  bits  at  rate  us  
–  …  takes  at  least  NF/us  $me  
•  Receiving  the  data  at  the  slowest  receiver  
–  Slowest  receiver  has  download  rate  dmin=  mini{di}  
–  …  takes  at  least  F/dmin  $me  
•  Download  $me:  max{NF/us  ,  F/dmin}  

Multmedia  Networking   19  
Speeding  Up  the  File  Distribu$on  
•  Increase  the  server  upload  rate  
–  Higher  link  bandwidth  at  the  server  
–  Mul$ple  servers,  each  with  their  own  link  
•  Alterna$ve:  have  the  receivers  help  
–  Receivers  get  a  copy  of  the  data  
–  …  and  redistribute  to  other  receivers  
–  To  reduce  the  burden  on  the  server  

Multmedia  Networking   20  
Peers  Help  Distribu$ng  a  Large  File  
F bits
d4

u4
upload rate us
Internet

d1 d3

u1 u2 u3
d2

upload rates ui
download rates di Multmedia  Networking   21  
Peers  Help  Distribu$ng  a  Large  File  
•  Components  of  distribu$on  latency  
–  Server  must  send  each  bit:  min  $me  F/us  
–  Slowest  peer  must  receive  each  bit:  min  $me  F/
dmin  
•  Upload  $me  using  all  upload  resources  
–  Total  number  of  bits:  NF  
–  Total  upload  bandwidth  us  +  sumi(ui)  
•  Total:  max{F/us  ,  F/dmin  ,  NF/(us+sumi(ui))}  

Multmedia  Networking   22  
Peer-­‐to-­‐Peer  is  Self-­‐Scaling  
•  Download  $me  grows  slowly  with  N  
–  Client-­‐server:  max{NF/u  s,  F/dmin}  
–  Peer-­‐to-­‐peer:  max{F/us  ,  F/dmin  ,  NF/(us+sumi(ui))}  
•  But…  
–  Peers  may  come  and  go  
–  Peers  need  to  find  each  other  
–  Peers  need  to  be  willing  to  help  each  other  

Multmedia  Networking   23  
Loca$ng  the  Relevant  Peers  
•  Three  main  approaches  
–  Central  directory  (Napster)  
–  Query  flooding  (Gnutella)  
–  Hierarchical  overlay  (Kazaa,  modern  Gnutella)  
•  Design  goals  
–  Scalability  
–  Simplicity  
–  Robustness  
–  Plausible  deniability  

Multmedia  Networking   24  
Peer-­‐to-­‐Peer  Networks:  BitTorrent  
•  BitTorrent  history  
–  2002:  B.  Cohen  debuted  BitTorrent  
•  Emphasis  on  efficient  fetching,  not  searching  
–  Distribute  same  file  to  many  peers  
–  Single  publisher,  many  downloaders  
•  Preven$ng  free-­‐loading  
–  Incen$ves  for  peers  to  contribute  

Multmedia  Networking   25  
BitTorrent:  Simultaneous  Downloads  

•  Divide  file  into  many  chunks  (e.g.,  256  KB)  


–  Replicate  different  chunks  on  different  peers  
–  Peers  can  trade  chunks  with  other  peers  
–  Peer  can  (hopefully)  assemble  the  en$re  file  
•  Allows  simultaneous  downloading  
–  Retrieving  different  chunks  from  different  peers  
–  And  uploading  chunks  to  peers  
–  Important  for  very  large  files  

Multmedia  Networking   26  
BitTorrent:  Tracker  
•  Infrastructure  node  
–  Keeps  track  of  peers  par$cipa$ng  in  the  torrent  
–  Peers  registers  with  the  tracker  when  it  arrives  
•  Tracker  selects  peers  for  downloading  
–  Returns  a  random  set  of  peer  IP  addresses  
–  So  the  new  peer  knows  who  to  contact  for  data  
•  Can  have  “trackerless”  system  
–  Using  distributed  hash  tables  (DHTs)  

Multmedia  Networking   27  
Defini$on:  Peer  
•  Leecher  
–  A  peer  that  is  client  and  server  
–  In  the  context  of  content  delivery  
•  Has  a  par$al  copy  of  the  content  
•  Seed  
–  A  peer  that  is  only  server  
–  In  the  context  of  content  delivery  
•  Has  a  full  copy  of  the  content  

Multmedia  Networking   28  
BitTorrent:  Overall  Architecture  
Web Server Tracker

Web page
with link
to .torrent
t n
.torre

C
A
Peer
Peer [Seed]
B
[Leech]
Peer
[Leech]
Multmedia  Networking   29  
BitTorrent:  Overall  Architecture  
Web Server Tracker

Web page
with link
to .torrent

C
A
Peer
Peer [Seed]
B
[Leech]
Peer
[Leech]
Multmedia  Networking   30  
BitTorrent:  Overall  Architecture  
Web Server Tracker

Web page
with link
to .torrent

C
A
Peer
Peer [Seed]
B
[Leech]
Peer
[Leech]
Multmedia  Networking   31  
BitTorrent:  Overall  Architecture  
Web Server Tracker

Web page
with link
to .torrent

Shake-hand
C
A
Peer
Peer [Seed]
B
[Leech]
Downloader Peer
“US” [Leech]
Multmedia  Networking   32  
BitTorrent:  Overall  Architecture  
Web Server Tracker

Web page
with link
to .torrent

pieces
C
A
Peer
Peer [Seed]
B
[Leech]
Downloader Peer
“US” [Leech]
Multmedia  Networking   33  
BitTorrent:  Overall  Architecture  
Web Server Tracker

Web page
with link
to .torrent

pieces
C
A
Peer
Peer [Seed]
B
[Leech]
Downloader Peer
“US” [Leech]
Multmedia  Networking   34  
BitTorrent:  Overall  Architecture  
Web Server Tracker

Web page
with link
to .torrent

pieces
C
A
Peer
Peer [Seed]
B
[Leech]
Peer
[Leech]
Multmedia  Networking   35  
P2P Streaming
Gatech Stan1
Stanford
Source:
Stan2
Purdue

Dumb Network Berk1

Overlay Tree Berkeley


Stan1 Berk2
Gatech
Stan2

Purdue
Berk1
Berk2
Multmedia  Networking   36  
Source:  Sanjay  Rao’s  lecture  from  Purdue  
P2P Streaming
•  Tree-based
–  Parent-child relationships
–  Push-based
–  Uplink bandwidth not utilized at leaves
•  Data can be divided and disseminated along multiple trees
(e.g., SplitStream)
–  Must be repaired and maintained to avoid
interruptions
–  Example: End System Multicast (ESM)

Multmedia  Networking   37  
P2P Multicast
•  Mesh-based
–  Data-driven
–  Pull-based
–  Periodically exchange data availability with
random partners and retrieve new data
–  Unlike BitTorrent, must consider real-time
constraints
–  Example: CoolStreaming

Multmedia  Networking   38  
Overlay Performance
•  Even a well-designed overlay cannot be as efficient as IP Mulitcast
•  But performance penalty can be kept low
•  Trade-off some performance for other benefits

Duplicate Packets: Gatech Stanford


Bandwidth Wastage

Dumb Network Increased


Delay
Berkeley

Multmedia  Networking   39  
Source:  Sanjay  Rao’s  lecture  from  Purdue  
Case Study: PPLive
•  Very popular P2P IPTV application
–  Free for viewers
–  Over 100,000 simultaneous viewers and
400,00 viewers daily
–  Over 200+ channels
–  Windows Media Video and Real Video format

Multmedia  Networking   40  
Case Study: PPLive
•  Gossip-based protocols
–  Peer management
–  Channel discovery
•  Data-driven p2p streaming
•  Recommend papers are measurement
studies of PPLive

Multmedia  Networking   41  
Case Study: PPLive
1.  Contact channel
server for available
channels
2.  Retrieve list of
peers watching
selected channel
3.  Find active peers
on channel to
share video chunks Source: “Insights into PPLive: A Measurement
Study of a Large-Scale P2P IPTV System” by Hei et al.

Multmedia  Networking   42  

You might also like