cs 414 – multimedia systems design lecture 24 – p2p streaming
DESCRIPTION
CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming. Klara Nahrstedt Ramsés Morales. Streaming from servers. clients. …. servers. …. Video service. Bandwidth at video service and number of servers have to grow with demand Flash crowds have to be taken into account. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/1.jpg)
CS 414 - Spring 2009
CS 414 – Multimedia Systems Design
Lecture 24 – P2P Streaming
Klara Nahrstedt
Ramsés Morales
![Page 2: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/2.jpg)
Streaming from servers
Bandwidth at video service and number of servers have to grow with demandFlash crowds have to be taken into account
CS 414 - Spring 2009
…
…
clients
Video service
servers
![Page 3: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/3.jpg)
P2P Streaming
Use the participating node’s bandwidthMore nodes watching stream = more shared
bandwidth App-level multicast
How?
CS 414 - Spring 2009
Live stream source(could be a member of the p2p network)
P2P network
Peers watching stream
![Page 4: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/4.jpg)
P2P Streaming
Common arrangements to multicast the streamSingle TreeMultiple TreeMesh-basedAll nodes are usually interested in the stream
They all have to deal with node dynamism (join/leave/fail/capacity-changes)
CS 414 - Spring 2009
![Page 5: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/5.jpg)
Streaming in a single tree
CS 414 - Spring 2009
Source
Frames coder
3 2 1
packets
3
2
1
3
2
1(using RTP/UDP)
![Page 6: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/6.jpg)
Single Tree
Peers interested in the stream organize themselves into a tree
CS 414 - Spring 2009
…
……Source
Nodes send as many copies of a data packet as they have children
![Page 7: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/7.jpg)
Joining the tree
Find a node with spare capacity, then make it parent
If contacted node lacks capacity, pick childRandom childRound robinChild closest in physical network to joining
node
CS 414 - Spring 2009
“Parent?”
“Try one of my children”
![Page 8: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/8.jpg)
Leaving the tree or failing
Orphan nodes need a new parent Policies for new parent
Children pick sourceSubtree nodes pick sourceChildren pick grandfatherSubtree nodes pick grandfather…then repeat join procedure
CS 414 - Spring 2009
Orphan children after parent leaves
Ex-parent
grandfather
![Page 9: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/9.jpg)
Single tree issues
Leaves do not use their outgoing bandwidth
Packets are lost while recovering after a parent leaves/fails
Finding unsaturated peer could take a while
Tree connections could be rearranged for better transfer
CS 414 - Spring 2009
![Page 10: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/10.jpg)
Multiple Trees
Challenge: a peer must be internal node in only one tree, leaf in the rest
CS 414 - Spring 2009
1 2
2 3 1 3
3
1 2
Source Are nodes 1, 2, 3 receiving the same data multiple times?
![Page 11: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/11.jpg)
Multiple Description Coding (MDC)
Each description can be independently decoded (only one needed to reproduce audio/video)More descriptions received result in higher
qualityCS 414 - Spring 2009
coder
Frames 30 20 10
Packets for description 0
Packets for description n
…
3n 2n 1n
![Page 12: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/12.jpg)
Streaming in multiple-trees using MDC Assume odd-bit/even-bit encoding --
description 0 derived from frame’s odd-bits, description 1 derived from frame’s even-bits
CS 414 - Spring 2009
4
1
2 3
3
1 2
3020
10
3121
11(using RTP/UDP)
![Page 13: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/13.jpg)
Multiple Tree Streaming in Pastry DHT -- SplitStream Pastry routes messages using id prefix
matching
CS 414 - Spring 2009
![Page 14: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/14.jpg)
Multiple Tree Streaming in Pastry DHT -- SplitStream Assign an id to each coded description
If most significant digit is different, then trees will be interior-node-disjoint, example,
Id tree 1: d46a1c Id tree 2: a1321d 65a1fc: route(m, d46a1c) -> d13da3 -> d4213f ->
d462ba 65a1fc: route(m, a1321d) -> a0b14f -> a1b987 ->
a1321a Stream flows through reverse path
CS 414 - Spring 2009
![Page 15: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/15.jpg)
Multiple Tree Streaming in Pastry DHT -- SplitStream Peer is internal node in only one tree, due
to interior-node-disjoint trees and Pastry’s routing
CS 414 - Spring 2009
d462ba
d4213f
d13da3
65a1fc
a1321a
a1b987
a0b14f
65a1fc
Description 0
d462bad4213f
d13da3a1321a a1b987
Description 1
a0b14f
![Page 16: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/16.jpg)
Multiple-Tree Issues
Complex procedure to locate a potential-parent peer with spare out-degreeDegraded quality until a parent found in every
tree Static mapping in trees, instead of
choosing parents based on their (and my) bandwidthAn internal node can be a bottleneck
CS 414 - Spring 2009
![Page 17: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/17.jpg)
Mesh-based streaming Basic idea
Report to peers the packets that you haveAsk peers for the packets that you are
missingAdjust connections depending on in/out
bandwidth
CS 414 - Spring 2009
Description 0/1/2
Description 1
Description 0
Description 1,2
Description 0,1,2
(Nodes are randomly connected to their peers, instead of statically)
Description 0/1/2
(mesh uses MDC)
![Page 18: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/18.jpg)
Content delivery
CS 414 - Spring 2009
1
4
10 11 12
5
2
6
13 14 15
7
3
8
16 17
9
Description 0 Description 2Description 1
(1) Diffusion Phase ( ) (2) Swarming Phase ( )
(Levels determined by hops to source)
![Page 19: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/19.jpg)
Diffusion Phase
As a new segment (set of packets) of length L becomes available at source every L seconds Level 1 nodes pull data units
from source, then level 2 pulls from level 1, etc.
Recall that reporting and pulling are performed periodically
CS 414 - Spring 2009
30 20 10
…
32 22 12
40
42
Segment 0Segment 1
…
…
Have segment 0
3
Send meSegment 0
22
12
(during period 0)
3 Have segment 0
9
22
12
(during period 1)
Send meSegment 0
(drawings follow previous example)
![Page 20: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/20.jpg)
Swarming Phase
At the end of the diffusion all nodes have at least one data unit of the segment
Pull missing data units from (swarm-parent) peers located at same or lower level
Can node 9 pull new data units from node 16? Node 9 cannot pull data in a single swarm interval
CS 414 - Spring 2009(drawings follow previous example)
10 11 12
2
13 14 15
7
16 17
9
20
10
2111
21 11
1121
1020
![Page 21: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/21.jpg)
Buffering
Due to diffusion nodes need a bufferSize: c * L(diffusion tree dept + minimum number of
swarming intervals) <= c
CS 414 - Spring 2009
![Page 22: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/22.jpg)
Receiver driven packet scheduling Peers maintain parents’
Available packetsWeighted average bandwidth
Peers monitor aggregate bandwidth from all parentsRequested descriptions adapt to this measure
Designed to maximize utilization of available bandwidth from parents
CS 414 - Spring 2009
9
Bw from 15=x, 16=y15 has from t=0 to t=2016 has from t=0 to t=10X+y = x_agg (can I handle more?)
(drawings follow previous example)
![Page 23: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/23.jpg)
Receiver driven packet scheduling
Scheduler identifies packets with highest timestamp available at parents (during last L seconds) Then request all these packets
Identify missing packets for each timestamp Then request a random subset of these missing packets from all
parents (even if they don’t have it) to fully utilize their bandwidth
CS 414 - Spring 2009
9
Send me 0<=t<=20
15
16
Have up to t=20
Have up to t=10
9
I’m still missing t=19, t=18
15
16
![Page 24: CS 414 – Multimedia Systems Design Lecture 24 – P2P Streaming](https://reader036.vdocuments.site/reader036/viewer/2022062500/56814f31550346895dbcc13b/html5/thumbnails/24.jpg)
Many more details in references and source code M. Castro, P. Druschel, A-M. Kermarrec, A. Nandi, A. Rowstron and
A. Singh, "SplitStream: High-bandwidth multicast in a cooperative environment," SOSP 2003.
H. Deshpande, M. Bawa, H. Garcia-Molina. "Streaming Live Media over Peers," Technical Report, Stanford InfoLab, 2002.
N. Magharei, R. Rejaie. "PRIME: Peer-to-Peer Receiver drIven MEsh-Based Streaming," INFOCOM 2007.
N. Magharei, R. Rejaie, Y. Guo. "Mesh or Multiple-Tree: A Comparative Study of Live P2P Streaming Approaches," INFOCOM 2007.
http://freepastry.org
CS 414 - Spring 2009