Upload
eustacia-stanley
View
215
Download
0
Embed Size (px)
Citation preview
Multimedia Networking Quality of Services
Hongli Luo, IPFW
Topics
Multimedia networking applications Stored, live, interactive multimedia applications
How should Internet better support QoS Internet multimedia streaming
Web server or streaming server TCP or UDP
Packet loss, delay and jitter How to alleviate it
Multimedia and Quality of Service: What is it?
multimedia applications: network audio and video(“continuous media”)
network provides application with level of performance needed for application to function.
QoS
MM Networking Applications
Fundamental characteristics:
typically delay sensitive end-to-end delay delay jitter
loss tolerant: infrequent losses cause minor glitches
Elastic applications Web, e-mail, FTP, telnet loss intolerant but delay
tolerant.
Classes of MM applications:
1) stored streaming2) live streaming3) interactive, real-time
Jitter is the variability of packet delays within the same packet stream
Streaming Stored Multimedia
Stored streaming: Applications: CNN, Microsoft Video, YouTube media stored at source transmitted to clientstreaming: client playout begins before all data has
arrived timing constraint for still-to-be transmitted data: in time
for playout Continuous playout Streaming multimedia clients: RealPlayer, QuickTime,
Windows Media
Streaming Stored Multimedia: What is it?
1. videorecorded
2. videosent
3. video received,played out at client
Cum
ula
tive
data
streaming: at this time, client playing out early part of video, while server still sending laterpart of video
networkdelay
time
Streaming Stored Multimedia: Interactivity
VCR-like functionality: client can pause, rewind, FF, push slider bar 10 sec initial delay OK 1-2 sec until command effect
OK
timing constraint for still-to-be transmitted data: in time for playout
Streaming Live Multimedia
Examples: Internet radio talk show live sporting event IPTVStreaming (as with streaming stored multimedia) playback buffer playback can lag tens of seconds after
transmission still have timing constraintInteractivity fast forward impossible rewind, pause possible!
Streaming Live Multimedia
Live, broadcast like applications often have many clients who are receiving the same audio/video program
How to efficiently deliver the contents Multiple separate server-to-client unicast streams IP multicast Application-layer multicast – multicast overlay
networks Content Distribution Networks (CDNs) Peer-to-peer networks
Real-Time Interactive Multimedia
end-end delay requirements: audio: < 150 msec good, < 400 msec OK
• includes application-level (packetization) and network delays• higher delays noticeable, impair interactivity
session initialization how does callee advertise its IP address, port number, encoding
algorithms?
applications: IP telephony, video conference, distributed interactive worlds
Requirements for Data Transport
Delay Some small delay at the beginning is acceptable E.g., start-up delays of a few seconds are okay
Jitter Variability of packet delay within the same packet
stream Client cannot tolerate high variation if the buffer
starves
Loss Small amount of missing data does not disrupt
playback Retransmitting a lost packet might take too long
anyway
Multimedia Over Today’s InternetTCP/UDP/IP: “best-effort service” 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 requiresQoS and level of performance to be
effective!
?? ???
?
? ??
?
?
Challenges to the Current Internet (1)
TCP/UDP/IP suite provides best-effort, no guarantees on expectation or variance of packet delay
Streaming applications delay of 5 to 10 seconds is typical and has been acceptable, but performance deteriorate if links are congested (transoceanic)
Most router implementations use only First-Come-First-Serve (FCFS) packet processing and transmission scheduling
Challenges to the Current Internet (2)
To mitigate impact of “best-effort” protocols, we can: Use UDP to avoid TCP and its slow-start phase… Buffer content at client and delay playback to
remedy jitter Prefetch data during playback when client storage
and extra bandwidth are available Adapt compression level to available bandwidth Different treatment of packets at the router
• Different classes of packets
How should the Internet evolve to better support multimedia?
Integrated services philosophy: fundamental changes in Internet so that apps can
reserve end-to-end bandwidth Applications receive a guarantee on its end-to-end
performance Hard guarantee – received QoS with certainty Soft guarantee – received QoS with high
probability requires new, complex software in hosts & routers
Application makes reservation Modify scheduling policies at the router Description of traffic Admission control
How should the Internet evolve to better support multimedia?
Laissez-faire no major changes more bandwidth when needed content distribution,
Replicate stored content and put the replicated contents at the edges of the Internet
application-layer multicast Multicast Overlay networks can be deployed Application layer
Differentiated services philosophy: fewer changes to Internet infrastructure, yet provide 1st
and 2nd class service
A few words about audio compression analog signal sampled
at constant rate telephone: 8,000
samples/sec CD music: 44,100
samples/sec
each sample quantized, i.e., rounded e.g., 28=256 possible
quantized values
each quantized value represented by bits 8 bits for 256 values
example: 8,000 samples/sec, 256 quantized values --> 64,000 bps
receiver converts bits back to analog signal: some quality reduction
Example rates CD: 1.411 Mbps MP3: 96, 128, 160
kbps Internet telephony:
5.3 kbps and up
A few words about video compression
video: sequence of images displayed at constant rate e.g. 24 images/sec
digital image: array of pixels each pixel represented
by bits
redundancy spatial (within image) temporal (from one
image to next)
Examples: MPEG 1 (CD-ROM) 1.5
Mbps MPEG2 (DVD) 3-6 Mbps MPEG4 (often used in
Internet, < 1 Mbps)Research: layered (scalable)
video adapt layers to available
bandwidth
Streaming Stored Multimedia
Client-server system Server stores the audio and video files Clients request files, play them as they download,
and perform VCR-like functions (e.g., rewind and pause)
Playing data at the right time Server divides the data into segments labels each segment with timestamp or frame id so the client knows when to play the data
Avoiding starvation at the client The data must arrive quickly enough otherwise the client cannot keep playing
Streaming Stored Multimedia
application-level streaming techniques for making the best out of best effort service: client-side buffering use of UDP versus TCP multiple encodings of
multimedia
jitter removal decompression error concealment graphical user interface
w/ controls for interactivity
Media Player
Streaming stored multimedia Through a Web server
• Deliver the video/audio to the client over HTTP Through a streaming server
• Using HTTP or some other protocol HTTP popular – pass through firewall while
proprietary protocols are blocked
Internet multimedia: simplest approach – through a Web Server
audio or video stored in file files transferred as HTTP object
TCP connection between client and server
received in entirety at client then passed to player
Client invokes the media player Content-type indicates the encoding Browser launches the media player Media player then renders the file
Internet multimedia: through a Web Server
User clicks on a hyperlink for an audio/video file browser GETs metafile describing the object browser launches player, passing metafile player sets up its own connection to the Web server server streams audio/video to player
Streaming from a streaming server
Web server returns a meta file describing the object via HTTP Player requests the data using a different protocol allows for non-HTTP protocol between server, media player To control playback, protocol is needed to exchange
playback control information – RTSP protocol
Streaming Multimedia: Client Buffering
How to deliver media from the streaming server to the media player
Media is sent over UDP at a constant rate equal to the drain rate As soon as the client receives media, it decompresses it and
plays it back The media player delays playout for 2 to 5 seconds in order to
eliminate network-induced jitter. Media is sent over TCP
Fill rate x(t) fluctuates with time – due to TCP congestion control and window flow control
X(t) may be less that d for long periods because of congestion Empty client buffer - starvation/underflow Introduces undesirable pause during the playback X(t) very much depends on the size of the client buffer
• Large client buffer – TCP make use of the available bandwidth to prfetch, less likely starvation
• Small client buffer – more client starvation
constant bit rate videotransmission
Cum
ula
tive
data
time
variablenetwork
delay
client videoreception
constant bit rate video playout at client
client playoutdelay
bu
ffere
dvid
eo
Streaming Multimedia: Client Buffering
client-side buffering, playout delay compensate for network-added delay, delay jitter
Streaming Multimedia: Client Buffering
client-side buffering, Store the data as it arrives from the server Play data for the user in a continuous fashion
playout delay Client typically waits a few seconds to start playing Allow some data to build up in the buffer compensate for network-added delay, delay jitter
Streaming Multimedia: UDP or TCP?
TCP send at maximum possible rate under TCP fill rate fluctuates due to TCP congestion control
Slow down after a packet loss, May cause starvation at the client
HTTP/TCP passes more easily through firewalls TCP’s Reliable delivery not needed for
multimedia Retransmission of lost packets even though
retransmission may not be useful Late packet can be thrown away
Protocol overhead TCP header of 20 bytes in every packet
Streaming Multimedia: UDP or TCP?
UDP server sends at rate appropriate for client
(oblivious to network congestion !) often send rate = encoding rate = constant rate then, fill rate = constant rate - packet loss No automatic adaptation of sending rate
short playout delay (2-5 seconds) to remove network jitter
error recover: time permitting No automatic retransmission of lost packets Retransmit if packet deadline not past
Smaller packet header
Streaming Multimedia: UDP or TCP?
UDP Do not respond to congestion
Not sharing bandwidth fairly Possible to cause congestion collapse Put flow control, congestion control into application
UDP leaves many things to the application When to transmit data How to encapsulate the data Whether to retransmit lost data Whether to adapt the sending rate Whether to adapt the quality of the audio/video encoding
Streaming Multimedia: UDP or TCP?
UDP Even when using UDP, applications should
respond to congestion end-to-end. Need to promote “TCP-friendly” behavior.
Rate-based Adaptation adjust rate to avoid congestion
reduce rate before packet loss or at the detection of packet loss.
TCP-Friendly
Throughput of a TCP connection
P: the packet size p: the lost probability of a packet
Limit flows to TCP-style BW Don’t know RTT exactly
)/(2.1 RTTpP
YouTube: HTTP, TCP, and Flash
Flash videos All uploaded videos converted to Flash format Nearly every browser has a Flash plug-in avoids need for users to install players
HTTP/TCP Implemented in every browser Easily gets through most firewalls
Keep It Simple, Stupid Simplicity more important than video quality
Real-time interactive applications PC-2-PC phone
Skype PC-2-phone
Dialpad, Net2phone, Skype videoconference with webcams
Skype, Polycom Video game QoS requirements:
Strict delay constraints Much harder than streaming applications Receiver can not introduce much playback
delay
Going to now look at a PC-2-PC Internet phone example in detail
Interactive Multimedia: Internet Phone
Introduce Internet Phone by way of an example
speaker’s audio: alternating talk spurts, silent periods.
64 kbps during talk spurt
pkts generated only during talk spurts
20 msec chunks at 8 Kbytes/sec: 160 bytes data
application-layer header added to each chunk.
chunk+header encapsulated into UDP segment.
application sends UDP segment into socket every 20 msec during talkspurt
Internet Phone: Packet Loss and Delay
network loss: IP datagram lost due to network congestion (router buffer overflow)
delay loss: IP datagram arrives too late for playout at receiver
loss tolerance: depending on voice encoding, losses concealed, packet loss rates between 1% and 10% can be tolerated.
Most Internet phone applications that run over UDP do not retransmit lost packets.
Recovering From Packet Loss
Loss is defined in a broader sense Does a packet arrive in time for playback? A packet that arrives late is as good as lost Retransmission is not useful if deadline passed
Selective retransmission Sometimes retransmission is acceptable E.g., if client has not already started playing data Data can be retransmitted within time constraint
Could do Forward Error Correction (FEC) Send redundant info so receiver can reconstruct
Internet Phone: Packet Loss and Delay
Packet delay delays: processing, queueing in network;
end-system (sender, receiver) delays For highly interactive audio applications,
e.g., Internet phone• End-to-end delays smaller than 150 ms
are not perceived by a human listener• Delays between 150 and 400 ms
acceptable but not ideal• typical maximum tolerable delay: 400 ms
Removing Jitter at the Receiver for Audio
Provide synchronous playout of voice chunks in the presence of random network jitter
To alleviate the jitter Sequence number is added to each chunk Timestamp – sender stamps each chunk with the
time at which the chunk was generated Delaying playout
• Playout delay must be long enough so that most of the packets are received before the scheduled playout times
• Fixed playout delay• Adaptive playout delay
Internet Phone: Fixed Playout Delay
receiver attempts to playout each chunk exactly q msecs after chunk was generated. chunk has time stamp t: play out chunk at
t+q . chunk arrives after t+q: data arrives too
late for playout, data “lost” tradeoff in choosing q:
large q: less packet loss• When large variations in end-to-end delay
small q: better interactive experience• Delay and variations in delay are small• .e.g., < 150 ms
constant bit ratetransmission
Cum
ula
tive
data
time
variablenetwork
delay(jitter)
clientreception
constant bit rate playout at client
client playoutdelay
bu
ffere
ddata
Delay Jitter
consider end-to-end delays of two consecutive packets: difference can be more or less than 20 msec (transmission time difference)
Fixed Playout Delay
packets
time
packetsgenerated
packetsreceived
loss
r
p p '
playout schedulep' - r
playout schedulep - r
• 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’
Adaptive Playout Delay Goal: minimize playout delay, keeping late
loss rate low Approach: adaptive playout delay adjustment:
estimate network delay, adjust playout delay at beginning of each talk spurt.
silent periods compressed and elongated. chunks still played out every 20 msec
during talk spurt.
Recovery from packet loss (1)
Forward Error Correction (FEC): simple scheme
for every group of n chunks create redundant chunk by exclusive OR-ing n original chunks
send out n+1 chunks, increasing bandwidth by factor 1/n.
can reconstruct original n chunks if at most one lost chunk from n+1 chunks
playout delay: enough time to receive all n+1 packets
tradeoff: increase n, less
bandwidth waste increase n, longer
playout delay increase n, higher
probability that 2 or more chunks will be lost
Recovery from packet loss (2)
2nd FEC scheme “piggyback lower quality stream” send lower resolutionaudio stream as redundant information e.g., nominal stream PCM at 64 kbpsand redundant streamGSM at 13 kbps.
whenever there is non-consecutive loss, receiver can conceal the loss. can also append (n-1)st and (n-2)nd low-bit ratechunk
Recovery from packet loss (3)
Interleaving chunks divided into smaller units for example, four 5 msec units
per chunk packet contains small units from
different chunks
if packet lost, still have most of every chunk
no redundancy overhead, but increases playout delay