Pseudo-DHT: Distributed Search Algorithm for P2P Video Streaming December 15, 2008 Jeonghun Noh Stanford University Sachin Deshpande Sharp Laboratories of America
P2P Live Video Streaming Relaying video using uplink bandwidth Define leech clearly. Video source Live video: no needs for locating video chunks
P2P Time-Shifted Streaming Local storage to store fractions of the video To locate video at arbitrary point, a query server may be used 7~11m 3~6m 0~4m Seeking video of position 5m The server can become a bottleneck as peer population increases No dedicated server may be available A scalable distributed content search is desired
Outline P2TSS system Pseudo-DHT: Distributed Search Performance evaluation Numerical analysis Simulation study Carol: I think this slide could be eliminated
Introduction to P2TSS P2TSS (P2P Time-shifted Streaming System) Serves both live streaming and time-shifted streaming Time-shifted stream (TSS) is the same as the original stream except being delayed in time Peers store a fraction of video Cached video chunks are later served to other peers Source peer Peer 1 stores Video [0m, 4m) from 9:00am Peer 2 watches from 0m at 9:10am [Deshpande et al., 2008]
Caching Live Stream Peers cache live stream with another video connection Peer3 Cached portion t2 x2 Video position Playback trajectory Peer 2 Peers locally determine which portion to cache Distributed Stream Buffer (DSB) Peer’s local buffer to hold a fraction of video A finite size of cache (e.g., size of 2 to 4 minutes of video) Independent of playback buffer Static contents in cache No content change once the cache is full Provides a bottom line performance t3 x3 x1 t1 Peer 1 Live stream Time
Chord: Distributed Lookup Chord: a distributed lookup overlay [Stoica et al., 2001] Nodes (peers) are connected as a circle Keys are mapped to successor node Fast lookup by a finger table. Lookup latency: O( log(Np) ) An example key/node space Nodes and keys sorted by IDs ID length: 6bits Can be normalized to [0,1) Each peer participates in the search process Computational resources” contributed by peers N: node K: key
Building Lookup Overlay Node is entered to overlay as peer joins Node ID: uniformly drawn between [0,1) Node is placed in a distributed manner (Key, Value) is entered as peer registers buffer status Key (K): hashed video chunk ID ( 0 ≤ K < 1) Value (V): peer network address (K,V) is mapped to the successor node Example 1
Pseudo-DHT: Registration Register (K, V) may result in “collision” (i, Peer 1) (i, Peer 2) Chunk ID i Repeat Register (K’, V) until there is no collision K’ = K + (n-1)Δ (n=# attempts, Δ=offset base) Another consequence : low penalty due to node disconnect. But this is low level (Chord functionality.. Or DHT) Increases lookup performance. 1st attempt 2nd attempt Chunk ID i i-1 empty : Occupied ID Unlike original DHT, single key-multiple values is discouraged Leads to better load balancing and low latency retrieval
Pseudo-DHT: Retrieval Seeking Video Chunk I Retrieve(i) may return a “miss” K’ = i - (n-1)Δ (n=# attempts, Δ=offset base) Repeat Retrieve(K’) with different keys until a hit occurs Best-effort search, different from original DHT 3rd 2nd 1st attempt Chunk ID i i-1 : Video chunks available i-2 : Video Chunk Header miss miss Chunks delivered to the consumer peer
Outline P2TSS system Pseudo-DHT: Distributed Search Performance evaluation Numerical analysis Simulation study Carol: I think this slide could be eliminated
Preliminaries for Analysis Symbols Np: Number of peers (or nodes) L: Video length (in secs) Q: Video chunk size (in secs) : Ratio between Np and available slots M (=L/Q)
Registration Latency Independence model for the number of collision, C More sophisticated model where A denotes the number of peer arrival in Q seconds
Experimental Setup Pseudo-DHT implemented in PlanetSim [Garcia et al, 2004] Simulation setup Maximum successive lookup: 4 Video length L: 7200s Buffer size D: 240s Chunk size Q: 5, 10, 15, 30s
Registration Latency When is small, models match simulation results Registration latency of both forward/backward key change is identical Load factor = Num of peers. As alpha increases, higher-order model (sophisticated) matches the result better. Video chunk size (Q): 5s
Retrieval Latency Empirical statistics Modeling retrieval latency N: Xk: 1 if video chunk Bk is occupied. 0 otherwise Conditional hit probability Pr (Xi-j=1| Xi=0), ( j: offset base ) With a larger offset base Δ, the correlation between successive retrievals becomes weaker (Np=500, L=7200s, Q=5s, =0.346) Each trial is assumed to be independent (with large offset Δ) Modeling retrieval latency N:
Offset Base and Retrieval Latency Retrieval latency decreases as an offset base increases Q=5. Load Factor = 300 / (7200/5+1). Step size (offset) : 5, 10, 15 seconds. A penalty is more frequent supplier switching Video chunk size Q: 5s
Video Chunk Size and Retrieval Latency As chunk size Q increases, retrieval latency decreases Potential discussion: Larger Q is always better? 1. Larger Q takes peers to take more time before registration (slow contribution). 2. More dense key accumulation -> Losing one node results in many key information (can be avoided by key replication, though) 3. Only a few of peers will hold all keys. Bad load balancing..
Overhead of Key Storage Balls and bins problem How many nodes (bins) hold k keys (balls)? Bins are created by nodes Random keys fall into [0,1) uniformly Statistically, larger bins will receive more balls Sample space: N=90, K=12. 1 Key/Node space
Overhead of Key Storage One node’s probability of storing k keys Observations Low overhead: keys are spread out on the overlay 50% of nodes store no keys when N=K Number of keys stored in a node N=300 K=300
Conclusion and Future Work Proposed Pseudo-DHT Allows peers to register / retrieve video chunk in a scalable way Slightly different from original DHT due to video continuity Spreads out (key, value) items over the overlay P2TSS and Pseudo-DHT Application to a P2P system Thorough evaluation with analysis and simulations Future research topics Changing Q dynamically according to peer population size Considering heterogeneous peer uplink capacity for registration
Thank you!
Backup Slides
Preliminaries for Analysis Video chunk ID space M-1 X0 X2 XM-1 X1
Sample Key/Node Space Interval between nodes is not constant Nodes (peers) Keys (DSB info)
Chord: Distributed Lookup Chord: a distributed lookup overlay [Stoica et al., 2001] Nodes (peers) and keys are mapped to a common space Fast lookup by a finger table. Lookup time: O( log(Np) ) An example key/node space Each peer participates in the search process Computational resources” contributed by peers N: node K: key
Caching Video Peers locally determine which portion to cache Distributed Stream Buffer (DSB) Peer’s local buffer to hold a fraction of video A finite size of cache (e.g., size of 2 to 4 minutes of video) Independent of playback buffer Peers locally determine which portion to cache Distributed Stream Buffer (DSB) Peer’s local buffer to hold a fraction of video A finite size of cache (e.g., size of 2 to 4 minutes of video) Independent of playback buffer Static contents in cache No content change once the cache is full Provides a bottom line performance Static contents in cache No content change once the cache is full Provides a bottom line performance
A lookup on Chord Overlay Fast search using a finger table. Each node has more detailed knowledge about nodes closer to them.
Registration Approach 2: Simplified dependence model Ai : Number of insertions for key i ( Number of arrivals during the slot i) Ai: Arrival in slot I. Not the number of key! Be careful.
Simultaneous Retrieval To reduce a retrieval latency
Retrieval Analysis With larger offsets (+) The number of lookups decreases slightly. (-) Peers have to switch earlier to another peer. The simulation results match the model Parameters Np = 500 L = 7200 D = 480s Q = 5s Number of slots: 1441 (M = 1440)
Analysis: Overhead for Key Storage Poisson process property: Given N(t) = N, N arrival times are independently uniformly distributed. In Poisson process, interarrival time between events is exponentially distributed. The converse is also true. Finally,