1 CSE 401N Multimedia Networking Lecture-18
2 Multimedia, Quality of Service: What is it? Multimedia applications: network audio and video network provides application with level of performance needed for application to function. QoS
3 Multimedia Performance Requirements Requirement: deliver data in “timely” manner r interactive multimedia: short end-end delay m e.g., IP telephony, teleconf., virtual worlds, DIS m excessive delay impairs human interaction r streaming (non-interactive) multimedia: m data must arrive in time for “smooth” playout m late arriving data introduces gaps in rendered audio/video r reliability: 100% reliability not always required
4 Interactive, Real-Time Multimedia r end-end delay requirements: m video: < 150 msec acceptable m audio: < 150 msec good, < 400 msec OK m includes application-level (packetization) and network delays m higher delays noticeable, impair interactivity r applications: IP telephony, video conference, distributed interactive worlds
5 Streaming Multimedia Streaming: r media stored at source r transmitted to client r streaming: client playout begins before all data has arrived r timing constraint for still-to-be transmitted data: in time for playout
6 Streaming: what is it? 1. video recorded 2. video sent 3. video received, played out at client Cumulative data streaming: at this time, client playing out early part of video, while server still sending later part of video network delay time
7 Streaming Multimedia (more) Types of interactivity: r none: like broadcast radio, TV m initial startup delays of < 10 secs OK r VCR-functionality: client can pause, rewind, FF m 1-2 sec until command effect OK r timing constraint for still-to-be transmitted data: in time for playout
8 Multimedia Over Today’s Internet TCP/UDP/IP: “best-effort service” r no guarantees on delay, loss Today’s Internet multimedia applications use application-level techniques to mitigate (as best possible) effects of delay, loss But you said multimedia apps requires QoS and level of performance to be effective! ? ? ?? ? ? ? ? ? ? ?
9 Streaming Internet Multimedia Application-level streaming techniques for making the best out of best effort service: m client side buffering m use of UDP versus TCP m multiple rate encodings of multimedia ….. let’s look at these …..
10 Internet multimedia: simplest approach audio, video not streamed: r no, “pipelining,” long delays until playout! r audio or video stored in file r files transferred as HTTP object m received in entirety at client m then passed to player
11 Internet multimedia: streaming approach r browser GETs metafile r browser launches player, passing metafile r player contacts server r server streams audio/video to player
12 Streaming from a streaming server r This architecture allows for non-HTTP protocol between server and media player r Can also use UDP instead of TCP.
13 constant bit rate video transmission Cumulative data time variable network delay client video reception constant bit rate video playout at client client playout delay buffered video Streaming Multimedia: Client Buffering r Client-side buffering, playout delay compensate for network-added delay, delay jitter
14 Streaming Multimedia: Client Buffering r Client-side buffering, playout delay compensate for network-added delay, delay jitter buffered video variable fill rate, x(t) constant drain rate, d
15 Buffering Smoothing the output stream by buffering packets.
16 The Leaky Bucket Algorithm (a) A leaky bucket with water. (b) a leaky bucket with packets.
17 Streaming Multimedia: UDP or TCP? UDP r server sends at rate appropriate for client (oblivious to network congestion !) r short playout delay (2-5 seconds) to compensate for network delay jitter r error recover: time permitting TCP r send at maximum possible rate under TCP r congestion loss: retransmission, rate reductions r larger playout delay: smooth TCP delivery rate
18 Streaming Multimedia: client rate(s) Q: how to handle different client receive rate capabilities? m 28.8 Kbps dialup m 100Mbps Ethernet A: server stores, transmits multiple copies of video, encoded at different rates 1.5 Mbps encoding 28.8 Kbps encoding
19 User control of streaming multimedia Real Time Streaming Protocol (RTSP): RFC 2326 r user control: rewind, FF, pause, resume, etc… r out-of-band protocol: m one port (544) for control msgs m one port for media stream r TCP or UDP for control msg connection Scenario: r metafile communicated to web browser r browser launches player r player sets up an RTSP control connection, data connection to server
20 Metafile Example Twister <track type=audio e="PCMU/8000/1" src = "rtsp://audio.example.com/twister/audio.en/lofi"> <track type=audio e="DVI4/16000/2" pt="90 DVI4/8000/1" src="rtsp://audio.example.com/twister/audio.en/hifi"> <track type="video/jpeg" src="rtsp://video.example.com/twister/video">
21 RTSP Operation
22 RTSP Exchange Example C: SETUP rtsp://audio.example.com/twister/audio RTSP/1.0 Transport: rtp/udp; compression; port=3056; mode=PLAY S: RTSP/ OK Session 4231 C: PLAY rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Session: 4231 Range: npt=0- C: PAUSE rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Session: 4231 Range: npt=37 C: TEARDOWN rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Session: 4231 S: OK
23 Interactive Multimedia: Internet Phone Introduce Internet Phone by way of an example (note: there is no “standard” yet): r speaker’s audio: alternating talk spurts, silent periods. r pkts generated only during talk spurts m E.g., 20 msec chunks at 8 Kbytes/sec: 160 bytes data r application-layer header added to each chunk. r Chunk+header encapsulated into UDP segment. r application sends UDP segment into socket every 20 msec during talk spurt.
24 Internet Phone: Packet Loss and Delay r network loss: IP datagram lost due to network congestion (router buffer overflow) r delay loss: IP datagram arrives too late for playout at receiver m delays: processing, queueing in network; end-system (sender, receiver) delays m typical maximum tolerable delay: 400 ms r loss tolerance: depending on voice encoding, losses concealed, packet loss rates between 1% and 10% can be tolerated.
25 constant bit rate transmission Cumulative data time variable network delay (jitter) client reception constant bit rate playout at client client playout delay buffered data Delay Jitter r Client-side buffering, playout delay compensate for network-added delay, delay jitter
26 Internet Phone: Fixed Playout Delay r Receiver attempts to playout each chunk exactly q msecs after chunk was generated. m chunk has time stamp t: play out chunk at t+q. m chunk arrives after t+q: data arrives too late for playout, data “lost” r Tradeoff for q: m large q: less packet loss m small q: better interactive experience
27 Fixed Playout Delay Sender generates packets every 20 msec during talk spurt. First packet received at time r First playout schedule: begins at p Second playout schedule: begins at p’
28 Adaptive Playout Delay, I Dynamic estimate of average delay at receiver: where u is a fixed constant (e.g., u =.01). r Goal: minimize playout delay, keeping late loss rate low r Approach: adaptive playout delay adjustment: m Estimate network delay, adjust playout delay at beginning of each talk spurt. m Silent periods compressed and elongated. m Chunks still played out every 20 msec during talk spurt.
29 Adaptive Playout Delay, II Also useful to estimate the average deviation of the delay, v i : Remaining packets in talkspurt played out periodically For first packet in talk spurt, playout time is:
30 Adaptive Playout, III Q: How does receiver determine whether packet is first in a talkspurt? r If no loss, receiver look at successive timestamps. m difference of successive stamps > 20 msec -->talk spurt begins. r With loss possible, receiver must look at both time stamps and sequence numbers. m difference of successive stamps > 20 msec and sequence numbers without gaps, talk spurt begins.
31 Recovery From Packet Loss r loss: pkt never arrives or arrives too late r real-time constraints: little (no) time for retransmissions! m What to do? r Forward Error Correction (FEC): add error correction bits (recall 2-dimensional parity) m e.g.,: add redundant chunk made up of exclusive OR of n chunks; redundancy is 1/n; can reconstruct if at most one lost chunk r Interleaving: spread loss evenly over received data to minimize impact of loss
32 Piggybacking Lower Quality Stream
33 Interleaving r Has no redundancy, but can cause delay in playout beyond Real Time requirements r Divide 20 msec of audio data into smaller units of 5 msec each and interleave r Upon loss, have a set of partially filled chunks
34 Summary: Internet Multimedia: bag of tricks use UDP to avoid TCP congestion control (delays) for time-sensitive traffic r client-side adaptive playout delay: to compensate for delay r server side matches stream bandwidth to available client-to-server path bandwidth m chose among pre-encoded stream rates m dynamic server encoding rate r error recovery (on top of UDP) m FEC m retransmissions, time permitting m mask errors: repeat nearby data