powerpoint slides


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

powerpoint slides

  1. 1. A Proxy Smoothing Service for Variable-Bit-Rate Streaming Video Jennifer Rexford AT&T Labs - Research Florham Park NJ http://www.research.att.com/~jrex Joint work with Subhabrata Sen, Don Towsley, and Andrea Basso
  2. 2. Outline <ul><li>Background and motivation </li></ul><ul><ul><li>Burstiness of compressed video streams </li></ul></ul><ul><ul><li>Smoothing techniques for stored video </li></ul></ul><ul><li>Online smoothing of variable-bit-rate video </li></ul><ul><ul><li>Sliding-window smoothing algorithm </li></ul></ul><ul><ul><li>Performance evaluation on MPEG traces </li></ul></ul><ul><li>Integration of smoothing with prefix caching </li></ul><ul><ul><li>Caching initial frames of popular video streams </li></ul></ul><ul><ul><li>Resource allocation across multiple streams </li></ul></ul><ul><li>Prototype proxy smoothing service </li></ul><ul><ul><li>Software design of proxy service in Windows NT </li></ul></ul><ul><ul><li>MPEG-2 PC-based video streaming testbed </li></ul></ul><ul><li>Conclusions and ongoing work </li></ul>
  3. 3. Video Streaming Applications <ul><li>Live, interactive video </li></ul><ul><ul><li>Video teleconferencing, video phones, etc. </li></ul></ul><ul><ul><li>Tight delay constraints to support interactivity </li></ul></ul><ul><li>Stored, non-interactive video </li></ul><ul><ul><li>Movies, distance learning, Web videos, etc. </li></ul></ul><ul><ul><li>Video recorded in advance; loose delay constraints </li></ul></ul><ul><li>Live, non-interactive video </li></ul><ul><ul><li>Course lectures, news, sporting events, conferences </li></ul></ul><ul><ul><li>Video not recorded in advance; loose delay constraints </li></ul></ul>
  4. 4. Network Environment
  5. 5. Challenges of Video Streaming <ul><li>High bandwidth requirements of compressed video </li></ul><ul><ul><li>4-6 Megabits/second for high quality MPEG2 streams </li></ul></ul><ul><li>Burstiness of frame sizes on several time scales </li></ul><ul><ul><li>MPEG group-of-pictures structure (I, P, B frames) </li></ul></ul><ul><ul><li>Differences in action and detail within/across scenes </li></ul></ul><ul><li>Bandwidth limitations on clients and links </li></ul><ul><ul><li>10 or 100 Mbps shared local area network </li></ul></ul><ul><ul><li>27 Mbps cable channel, 1.5 Mbps ADSL </li></ul></ul><ul><li>Lack of end-to-end control of path from source </li></ul><ul><li>Poor delay, throughput, and loss in the Internet </li></ul>
  6. 6. Compressed Video Streams
  7. 7. Approaches to Handling Variability <ul><li>Constant-bit-rate encoding of each stream </li></ul><ul><ul><li>Adjust quality of encoding to stay at constant rate </li></ul></ul><ul><ul><li>Quality degradation during scenes with action & detail </li></ul></ul><ul><li>Statistical multiplexing of variable rate streams </li></ul><ul><ul><li>Rely on mixing to reduce the aggregate peak rate </li></ul></ul><ul><ul><li>Limited effectiveness on access links </li></ul></ul><ul><li>Selective discard of packets/frames in stream </li></ul><ul><ul><li>Discard packets/frames during transient congestion </li></ul></ul><ul><ul><li>Noticeable degradation in video quality </li></ul></ul><ul><li>Transcoding or layered encoding to reduce bit rate </li></ul><ul><ul><li>Re-encode the video stream at different quality at proxy </li></ul></ul><ul><ul><li>Quality degradation; hard to transcode at link speeds </li></ul></ul>
  8. 8. Smoothing Stored Video <ul><li>For prerecorded video streams: </li></ul><ul><li>All video frames stored in advance at server </li></ul><ul><li>Prior knowledge of all frame sizes ( f i , i=1,2,..,n) </li></ul><ul><li>Prior knowledge of client buffer size ( b ) </li></ul><ul><li>workahead transmission into client buffer </li></ul>1 2 n b bytes Server Client
  9. 9. Smoothing Constraints <ul><li>Given frame sizes { f i } and buffer size b </li></ul><ul><ul><li>Buffer underflow constraint (L k = f 1 + f 2 + … + f k ) </li></ul></ul><ul><ul><li>Buffer overflow constraint (U k = min(L k + b, L n )) </li></ul></ul><ul><ul><li>Find a schedule S k between the constraints </li></ul></ul><ul><li>O(n) algorithm minimizes peak and variability </li></ul>L U S time (in frames) number of bytes rate changes
  10. 10. Reducing the Peak Rate
  11. 11. Limitations of Smoothing Model <ul><li>Assumes prerecorded stored video </li></ul><ul><ul><li>but… need to support live and precorded video </li></ul></ul><ul><li>Assumes smoothing is performed by server </li></ul><ul><ul><li>but… server is in the domain of another provider </li></ul></ul><ul><li>Assumes end-to-end control of the network </li></ul><ul><ul><li>but… the Internet is decentralized </li></ul></ul><ul><li>Assumes server knows the client buffer size </li></ul><ul><ul><li>but… the client may be in a different domain </li></ul></ul>
  12. 12. Online Smoothing <ul><li>Larger window w reduces burstiness, but… </li></ul><ul><ul><li>Larger buffer at the source/proxy </li></ul></ul><ul><ul><li>Larger processing load to compute schedule </li></ul></ul><ul><ul><li>Larger playback delay at the client </li></ul></ul>b bytes Source/Proxy Client streaming video Source or proxy can delay the stream by w time units: stream with delay w
  13. 13. Online Smoothing Model <ul><li>Arrival of A i bits to proxy by time i in frames </li></ul><ul><li>Smoothing buffer of B bits at proxy </li></ul><ul><li>Smoothing window (playout delay) of w frames </li></ul><ul><li>Playout of D i-w bits by client by time i </li></ul><ul><li>Playout buffer of b bits at client </li></ul><ul><li>transmission of S i bits by proxy by time i </li></ul>B b D i-w A i S i proxy client
  14. 14. Online Smoothing <ul><li>Must send enough to avoid underflow at client </li></ul><ul><ul><li>S i must be at least D i-w </li></ul></ul><ul><li>Cannot send more than the client can store </li></ul><ul><ul><li>S i must be at most D i-w + b </li></ul></ul><ul><li>Cannot send more than the data that has arrived </li></ul><ul><ul><li>S i must be at most A i </li></ul></ul><ul><li>Must send enough to avoid overflow at proxy </li></ul><ul><ul><li>S i must be at least A i - B </li></ul></ul>max{D i-w , A i - B}  S i <= min{D i-w + b, A i }
  15. 15. Online Smoothing Constraints Source/proxy has w frames ahead of current time t: L U time (in frames) number of bytes t t+w-1 don’t know the future Modified smoothing constraints as more frames arrive... ?
  16. 16. Smoothing Star Wars GOP averages 2-second window 30-second window <ul><li>MPEG-1 Star Wars,12-frame group-of-pictures </li></ul><ul><li>Max frame 23160 bytes, mean frame 1950 bytes </li></ul><ul><li>Client buffer b=512 kbytes </li></ul>
  17. 17. Reducing Computational Complexity <ul><li>No need to compute schedule at every time unit </li></ul><ul><ul><li>Limited information from new frame arrivals </li></ul></ul><ul><ul><li>Limited impact on trajectory of the schedule </li></ul></ul><ul><li>Execute online algorithm every  time units </li></ul><ul><ul><li>Perform O(w) work every  time units </li></ul></ul><ul><ul><li>Limit number of rate changes </li></ul></ul><ul><li>Performance implications </li></ul><ul><ul><li>Very small increases in peak and variance of rates </li></ul></ul><ul><ul><li>Setting  = w/2 performs almost as well as  = 1 </li></ul></ul>
  18. 18. Parameters in Smoothing Model <ul><li>Algorithm parameters </li></ul><ul><ul><li>Window w (in number of frame slots) </li></ul></ul><ul><ul><li>Client buffer size b (in bytes) </li></ul></ul><ul><ul><li>Source/proxy buffer size B (in bytes) </li></ul></ul><ul><ul><li>Computation interval  (in frames) </li></ul></ul><ul><ul><li>Frame-size prediction interval p (in frames) </li></ul></ul><ul><li>Performance metrics </li></ul><ul><ul><li>Peak rate of the smoothed stream </li></ul></ul><ul><ul><li>Coefficient of variation (standard-deviation/mean) </li></ul></ul><ul><ul><li>Effective bandwidth (given buffer and loss rate) </li></ul></ul>
  19. 19. Peak Rate vs. Window Size (varying client buffer size for MPEG-1 Wizard of Oz ) <ul><li>Dramatic decrease in bandwidth variability </li></ul><ul><li>Online algorithm approaches offline scheme </li></ul><ul><li>Ten-second window gives most of the gain </li></ul>
  20. 20. Peak Rate vs. Client Buffer (varying window size for MPEG-1 Wizard of Oz ) <ul><li>Significant reductions with a few Mbytes of buffer </li></ul><ul><li>Diminishing returns for larger client buffer sizes </li></ul><ul><li>Window size w should scale with buffer size b </li></ul>
  21. 21. Proxy vs. Client Buffer (varying prediction under 512-kbyte total buffer & 30-frame window) <ul><li>Need buffer at each end for good performance </li></ul><ul><li>Even buffer for large P, more at proxy for small P </li></ul><ul><li>Simple prediction schemes are very effective </li></ul>
  22. 22. Prefix Caching to Avoid Start-Up Delay <ul><li>Avoid start-up delay for prerecorded streams </li></ul><ul><ul><li>Proxy caches initial part of popular video streams </li></ul></ul><ul><ul><li>Proxy starts satisfying client request more quickly </li></ul></ul><ul><ul><li>Proxy requests remainder of the stream from server </li></ul></ul><ul><li>smooth over large window without large delay </li></ul><ul><li>Use prefix caching to hide other Internet delays </li></ul><ul><ul><li>TCP connection from browser to server </li></ul></ul><ul><ul><li>TCP connection from player to server </li></ul></ul><ul><ul><li>Dejitter buffer at the client to tolerate jitter </li></ul></ul><ul><ul><li>Retransmission of lost packets </li></ul></ul><ul><li>apply to “point-and-click” Web video streams </li></ul>
  23. 23. New Questions <ul><li>Video streaming protocol </li></ul><ul><ul><li>How to get the proxy in the path? </li></ul></ul><ul><ul><li>How to receive an initial copy of the prefix? </li></ul></ul><ul><ul><li>How to retrieve the remaining frames of the video? </li></ul></ul><ul><li>Smoothing model </li></ul><ul><ul><li>What changes in the smoothing constraints? </li></ul></ul><ul><ul><li>What changes in the basic performance properties? </li></ul></ul><ul><li>Proxy resource allocation </li></ul><ul><ul><li>How much prefix is needed to hide Internet delays? </li></ul></ul><ul><ul><li>How to allocate between caching and smoothing? </li></ul></ul><ul><ul><li>How to allocate resources across multiple streams? </li></ul></ul>
  24. 24. Protocol Issues <ul><li>Ensuring that requests go through the proxy </li></ul><ul><ul><li>Configuration of proxy in client browser or player </li></ul></ul><ul><ul><li>Placement of transparent proxy in the path </li></ul></ul><ul><li>Caching of the initial frames of the video </li></ul><ul><ul><li>Server replication of the prefix </li></ul></ul><ul><ul><li>Proxy prefetching of the prefix </li></ul></ul><ul><ul><li>Proxy caching of prefix after first request </li></ul></ul><ul><li>Transparent retrieval of remaining frames </li></ul><ul><ul><li>Range request operation in HTTP 1.1 </li></ul></ul><ul><ul><li>Absolute positioning in RTSP </li></ul></ul>
  25. 25. Changes to Smoothing Model <ul><li>Separate parameter s for client start-up delay </li></ul><ul><li>Prefix cache stores the first w-s frames </li></ul><ul><li>Arrival vector A i includes cached frames </li></ul><ul><li>Prefix buffer does not empty after transmission </li></ul><ul><li>Send entire prefix before overflow of b s </li></ul><ul><li>Frame sizes may be known in advance (cached) </li></ul>b s b p b c A i D i-s S i
  26. 26. Performance Evaluation <ul><li>Comparison to original online smoothing model </li></ul><ul><ul><li>Pro: can have large window and small start-up delay </li></ul></ul><ul><ul><li>Pro: performance is virtually indistinguishable </li></ul></ul><ul><ul><li>Con: storing prefix nearly doubles buffer requirement </li></ul></ul><ul><ul><li>Con: may be difficult to smooth at beginning of video </li></ul></ul><ul><li>Allocation of prefix and smoothing buffers </li></ul><ul><ul><li>Small prefix buffer limits size of smoothing window </li></ul></ul><ul><ul><ul><li>small window w restricts workahead smoothing </li></ul></ul></ul><ul><ul><li>Large prefix buffer limits size of smoothing buffer </li></ul></ul><ul><ul><ul><li>small b s requires aggressive transmission schedule </li></ul></ul></ul>
  27. 27. Peak Rate vs. Window Size (varying total proxy buffer size for MPEG-1 Wizard of Oz ) <ul><li>Convex, cup-shaped curve of peak rate vs. buffer </li></ul><ul><li>Simple binary search for optimal allocation </li></ul><ul><li>Heuristic: pick largest w that does not constrain b s </li></ul>
  28. 28. Peak Rate vs. Prefix Buffer Size (varying total proxy buffer size for MPEG-1 Wizard of Oz )
  29. 29. Allocating Resources Across Streams <ul><li>Performance issues </li></ul><ul><ul><li>Limited buffer ( M ) and/or bandwidth ( B ) at proxy </li></ul></ul><ul><ul><li>Collection of V videos with different popularity </li></ul></ul><ul><ul><li>Videos with different sequences of frame sizes </li></ul></ul><ul><li>Optimization problem </li></ul><ul><ul><li>Allocate prefix buffer b p for each video v =1,…, V </li></ul></ul><ul><ul><li>Allocate smoothing buffer b s for each of n v requests </li></ul></ul><ul><ul><li>Obey constraint on buffer ( M ) or bandwidth ( B ) </li></ul></ul><ul><ul><li>Minimize the usage of the other resource ( M or B ) </li></ul></ul>
  30. 30. Simplifying the Problem <ul><li>Complex resource allocation problem </li></ul><ul><ul><li>Assign b p , b s , and w for each video v </li></ul></ul><ul><ul><li>Buffer requirement: sum v {b p (v) + n v * b s (v)} </li></ul></ul><ul><ul><li>Bandwidth requirement: sum v {n v * peak(v)} </li></ul></ul><ul><li>Reduce problem to selecting w for each video </li></ul><ul><ul><li>Select same b s and w across all requests for v </li></ul></ul><ul><ul><li>Select prefix buffer b p as first w-s frames </li></ul></ul><ul><ul><li>Select b s as max smoothing buffer for window w </li></ul></ul>
  31. 31. Greedy Algorithm <ul><li>Further simplifying the problem </li></ul><ul><ul><li>Selecting w determines b p (v) , b s (v) , and peak(v) </li></ul></ul><ul><ul><li>Consider the n v* peak(v) vs. b p (v)+n v* b s (v) curve </li></ul></ul><ul><ul><li>Curve is piecewise-linear, convex, non-increasing </li></ul></ul><ul><li>Greedy algorithm for buffer constraint M </li></ul><ul><ul><li>Select the video with steepest initial slope </li></ul></ul><ul><ul><li>Assign buffer space to this video for max gain </li></ul></ul><ul><ul><li>Repeat until reaching the buffer constraint M </li></ul></ul><ul><li>Greedy algorithm for bandwidth constraint B </li></ul><ul><ul><li>Repeat until not exceeding bandwidth constraint B </li></ul></ul>
  32. 32. Illustration of Greedy Algorithm buffer for video 1 bandwidth for video 1 buffer for video 2 bandwidth for video 2 #1 #2 #3 #6 #5 #4
  33. 33. Building a Smoothing Proxy <ul><li>Performance results </li></ul><ul><ul><li>Memory: a few megabytes of RAM is sufficient </li></ul></ul><ul><ul><li>CPU: 1-2 msec to smooth 30 sec (300 MHz PC) </li></ul></ul><ul><ul><li>Bandwidth: 2-4 Mbps feasible on personal computer </li></ul></ul><ul><li>Solution with off-the-shelf components </li></ul><ul><ul><li>300 MHz Pentium Pro with 192 megabytes of RAM </li></ul></ul><ul><ul><li>Input and output on 10 megabit/second Ethernet </li></ul></ul><ul><ul><li>Windows NT operating system with WinSock 2.0 </li></ul></ul>
  34. 34. Reality Sets In <ul><li>Video stream is packetized, not a fluid </li></ul><ul><ul><li>Smoothing constraints must be applied to packets </li></ul></ul><ul><ul><li>Proxy cannot transmit the stream at arbitrary rates </li></ul></ul><ul><li>System does not have support for traffic shaping </li></ul><ul><ul><li>Cannot control the inter-packet spacing at fine scale </li></ul></ul><ul><ul><li>E.g., 2 msec spacing for 15-packets frames (30 fps) </li></ul></ul><ul><li>Interrupt latency, timer jitter, and data copying </li></ul><ul><ul><li>Limited control over time expiration times </li></ul></ul><ul><ul><li>Latency in processing I/O and timer operations </li></ul></ul><ul><ul><li>Need to avoid extra copying of video frames </li></ul></ul>
  35. 35. Time-Sharing the Processor <ul><li>Reception of incoming packets </li></ul><ul><ul><li>Smooth over more frames by receiving often </li></ul></ul><ul><ul><li>Avoid double-copy from kernel to user space </li></ul></ul><ul><ul><li>Avoid the worst-case scenario of overflow </li></ul></ul><ul><li>Computation of smooth schedule </li></ul><ul><ul><li>Must run often enough to maximize smoothing </li></ul></ul><ul><ul><li>Fortunately, does not need to read or write data </li></ul></ul><ul><li>Transmission of packets according to schedule </li></ul><ul><ul><li>Must run often enough to control packet spacing </li></ul></ul><ul><ul><li>Avoid the bad case of sending a large burst </li></ul></ul><ul><ul><li>Avoid the worst case of client underflow </li></ul></ul>
  36. 36. Key Design Decisions <ul><li>Single thread of control </li></ul><ul><ul><li>No operating system control over fine-grain sharing </li></ul></ul><ul><li>High-performance counter for timing operations </li></ul><ul><ul><li>Timers are too inaccurate (tens of milliseconds) </li></ul></ul><ul><ul><li>How often should the counter be checked? </li></ul></ul><ul><li>Overlapped I/O to avoid double copying </li></ul><ul><ul><li>Receive and send directly to/from the user-space buffer </li></ul></ul><ul><ul><li>How many outstanding sends and receives? </li></ul></ul><ul><li>Explicit pacing of packet transmissions </li></ul><ul><ul><li>How often should the send routine be invoked? </li></ul></ul>
  37. 37. LiveNet MPEG-2 Testbed (developed by Andrea Basso, Glenn Cash, and Reha Civanlar) <ul><li>MPEG-2 encoder </li></ul><ul><ul><li>MPEG-2 encoder board (MPEGXpress) </li></ul></ul><ul><ul><li>Software to read into buffers and stream into network </li></ul></ul><ul><li>Real-time packetizer </li></ul><ul><ul><li>Parses MPEG-2 stream and divides frames into slices </li></ul></ul><ul><ul><li>Packing slices into Real-Time Protocol (RTP) packets </li></ul></ul><ul><li>MPEG-2 decoder </li></ul><ul><ul><li>Software for packet reception and error concealment </li></ul></ul><ul><ul><li>MPEG-2 decoder board (DarimVision) </li></ul></ul>
  38. 38. LiveNet Testbed
  39. 39. Conclusions <ul><li>Online smoothing model </li></ul><ul><ul><li>Applicable to many non-interactive applications </li></ul></ul><ul><ul><li>Significantly lowers burstiness of compressed video </li></ul></ul><ul><ul><li>Enables high-quality video across access networks </li></ul></ul><ul><li>Prefix caching </li></ul><ul><ul><li>Hides start-up delay for smoothing and other operations </li></ul></ul><ul><ul><li>Effective resource allocation schemes at the proxy </li></ul></ul><ul><li>Practical application </li></ul><ul><ul><li>Transparent to the origin video source/server </li></ul></ul><ul><ul><li>Implementation with commercial off-the-shelf parts </li></ul></ul><ul><ul><li>Integration with MPEG-2 and Real-Time Protocol </li></ul></ul>
  40. 40. Ongoing Work <ul><li>Prototyping the proxy smoothing service </li></ul><ul><ul><li>Completion of implementation of proxy service </li></ul></ul><ul><ul><li>Performance evaluation of parameterized system </li></ul></ul><ul><li>Combining smoothing with other mechanisms </li></ul><ul><ul><li>Discard, transcoding, feedback, and retransmission </li></ul></ul><ul><ul><li>Exploiting prefix cache to hide additional latency </li></ul></ul><ul><li>Measurement of Web-initiated video streaming </li></ul><ul><ul><li>Collection of video packet traces in AT&T WorldNet </li></ul></ul><ul><ul><li>Study of potential for (partial) caching at the proxy </li></ul></ul>