Lecture-5 on 10/08/2009
Download
Report
Transcript Lecture-5 on 10/08/2009
CSE 124
Networked Services
Fall 2009
B. S. Manoj, Ph.D
http://cseweb.ucsd.edu/classes/fa09/cse124
Some of these slides are adapted from various sources/individuals including but not limited to
the slides from the text books by Kurose and Ross. Use of these slides other than for
pedagogical purpose for CSE 124, may require explicit permissions from the respective sources.
10/8/2009
CSE 124 Networked Services Fall 2009
1
Multimedia Networking Applications
• Network applications can be broadly classified into
– Loss sensitive
• Data traffic such as HTTP or FTP traffic
• Delay tolerant
– Delay sensitive
•
•
•
•
Streamed stored audio/video
Streamed live audio/video
Interactive video
Loss tolerant
– Loss and delay sensitive
• Time-sensitive stock quotes
• Health sensor traffic
10/8/2009
CSE 124 Networked Services Fall 2009
2
Streaming Stored Audio/Video
• Streaming
– The media transfer scheme where a part of the media file is played out
while the remaining parts of the file are being received
– Popular services: stored video sharing servers such s YouTube, Yahoo
Videos, CNN etc.
– Uni-directional media communication
• Main features
– Stored media files that are pre-recorded and coded
– Streaming over the Internet
• Streaming server pushes the content at a regular rate
• Streaming client begins play back a few seconds after beginning reception
• Two kinds of media players
– Web browser-based and Host based
– Continuous play out
10/8/2009
• Play out options are many: Fast Forward, Rewind, and Pause
• Once play out begins, it should strive to maintain the original recorded timings
• Key issue: getting the data over the network in time
CSE 124 Networked Services Fall 2009
3
Streaming Live Audio and Video
• Media source generates multimedia content in realtime
– e.g., live video or audio transmission
– Delay associated with content generation
• Limited play out options: Limited Rewind and Pause
• Uni-directional media communication
• More stringent delay constraints than stored media
streaming
10/8/2009
CSE 124 Networked Services Fall 2009
4
Real-time Interactive Audio/Video
• Mostly bi-directional media communication
• Each end-source generates media content in real-time
• High delay constraints due to interactive nature of
communication
• End-to-end delay preferably < 150ms
• e.g, Voice over IP applications such as Skype, Google
Talk, Yahoo Messenger, Microsoft Netmeeting
10/8/2009
CSE 124 Networked Services Fall 2009
5
Why multimedia services are
challenging?
• Internet is designed for delay tolerant data communications
– Best-effort traffic support only
– Neither guarantee nor timeliness of data delivery
• During high load situations
– the delay performance can be worse
– High load can be at the server, network links, or the routers
• Main issues
– Delay (latency or end-to-end delay)
– Jitter (Delay jitter or Delay variation)
– Packet loss
10/8/2009
CSE 124 Networked Services Fall 2009
6
Delay
• Kinds of delays
– Source delay (content generation delay
– End-to-end delay
– Play out delay
• Source delay
– Generating a media content takes certain amount of time
Analog voice
(4KHz)
10/8/2009
Digitization
(8KHz,
8 bits per sample)
10101010000000….
10101010000
8 KBytes per second
160 Bytes packet
will take about
160 B/8KB/s= 20ms
120 B/8KB/s= 15ms
7
CSE 124 Networked Services Fall 2009
Delay (contd)
• End-to-end delay
– Due to the end-to-end network
• Contributed by
– Processing time by the intermediate routers
– Queuing delay at intermediate routers
– Transmission delay due to the source and
intermediate routers
– Propagation delay due to the links in the network
10/8/2009
CSE 124 Networked Services Fall 2009
8
End-to-end delay: four sources
• 1. Router processing:
–
–
–
–
2. Queueing
Receive
Check bit errors
Buffer
Determine output link
Time waiting at output
link/buffer for
transmission
Vary drastically
depends on congestion
level of router
transmission
A
propagation
B
Router
processing
queueing
Introduction
1-9
End-to-end delay
3. Transmission delay:
• R=link bandwidth (bps)
• L=packet length (bits)
• time to send bits into link
= L/R
transmission
A
4. Propagation delay:
• d = length of physical link
• s = propagation speed in
medium
– copper: ~2x108 m/sec
– Wireless: 3x 108 m/sec
– Fiber: 3x 108 m/sec
• propagation delay = d/s
propagation
B
Router
processing
queueing
Introduction
1-10
Queueing delay (revisited)
• R=link bandwidth (bps)
• L=packet length (bits)
• a=average packet arrival
rate
traffic intensity = La/R
La/R ~ 0: average queueing delay small
La/R -> 1: delays become large
La/R > 1: more “work” arriving than can be serviced, average
delay infinite!
Introduction
1-11
End-to-end Delay
• Delay at a router/node
d router d proc d queue d trans d prop
• dproc = processing delay
– typically a few microsecs or
less
• dqueue = queuing delay
– depends on congestion
• End-to-end delay
i 1
10/8/2009
– = L/R, significant for lowspeed links
• dprop = propagation delay
N
d
• dtrans = transmission delay
i
– a few microsecs to hundreds
of msecs
– N = number of routers/nodes in
the network
– di = delay at router/node i
CSE 124 Networked Services Fall 2009
12
Playout delay
• The delay added/caused by the receiver-side media
player
• A certain amount of delay in playing out may improve
the playout performance
• Challenge is to get the required OS resources to play
when desired
– High priority for playout processes is essential
• Two types
– Fixed playout delay
– Adaptive playout CSE
delay
10/8/2009
124 Networked Services Fall 2009
13
Jitter
• The shared network resources such as links and routers
– Results in high variability in end-to-end delay
– Sometimes packets can be even out-of-ordered
1
2
t
t+20ms
3
t+40ms
1
t+d
2
t+20ms+2d
3
t+40ms+d
• Jitter cannot be easily removed
– Because the network is best-effort
– Its impact can be lessened
10/8/2009
CSE 124 Networked Services Fall 2009
– Receiver playout management
14
Handling Jitter
• The impacts of Jitter can be managed together by
– Sequence numbering
– Time stamps
– Receiver playout delay
• Media source adds sequence numbers to every media packet
– Sequence number increments with every packet
– Usually unique for a certain duration of the session
• Time stamps include the time instance at which the packets
are generated
• Sequence numbers and time stamps help
– differentiate packetCSElosses
from silence periods
124 Networked Services Fall 2009
10/8/2009
15
1
2
t
3
t+20ms
t+40ms
1
t+d
2
t+40ms
1
1
2
t+20ms+d
2
t
t+d
10/8/2009
t+100ms
4
5
t+20ms+d
6
t+80ms+d
4
5
t+60ms
t+80ms
t+100ms+d
Packet
Loss
6
t+100ms
6
t+40ms+d
t+100ms+d
4
t+40ms
2
t+60ms+d
6
3
3
t+20ms
1
t+80ms
3
t+20ms
t+d
t+60ms
t+40ms+d
2
t
5
3
t+20ms+d
1
4
t+80ms
3
5
6
t+100ms
t+120ms
4
5
t+40ms+d
t+80ms+d
CSE 124 Networked Services Fall
2009
Talk
spurt
6
t+100ms+d t+120ms+d
16
Receiver Playout delay
• Delay added by receiver media player for every packet
• Two approaches
– Fixed playout delay
– Adaptive playout delay
• Fixed playout delay
– Receiver fixes the playout delay for all packets
– Simple to implement
– e.g., media receiver plays out every packet exactly q units of
time after receiving it
• If packet is received at time t, it is played at time t+q
– Determining a good value for q is a challenge
10/8/2009
CSE 124 Networked Services Fall 2009
17
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’
packets
loss
packets
generated
packets
received
playout schedule
p' - r
playout schedule
p-r
time
CSE 124 Networked Services
10/8/2009
Fall 2009
r
p
p'
Determining Fixed Playout Delay
0 ms
150 ms
400 ms
• There are no strict rules for the choice of fixed
playout delay
– The delay is sufficient to handle the Jitter
– One good estimate is the play out time can be equal
to Mean Delay + Mean Jitter
– Therefore, p = (Mean Delay + Mean Jitter) – r
10/8/2009
CSE 124 Networked Services Fall 2009
19
Adaptive Playout Delay
• In a dynamic network, Jitter can vary highly
– Use of fixed playout delay can result in high packet loss or non optimal
play out delay
– Adaptive Playout delay is preferred in such dynamic situations
– Adaptive playout delay, dynamically modifies the playout delay
– Playout delay is modified based on the delay and jitter observations
– Playout delay is estimated for every packet, however, modified only
when the talk spurt begins
• Objective: Minimize playout delay, keeping late loss rate low
10/8/2009
CSE 124 Networked Services Fall 2009
20
Estimating Adaptive Playout Delay
• One Approach to 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.
t i timestamp of the ith packet
ri the time packet i is received by receiver
p i the time packet i is played at receiver
ri t i network delay for ith packet
d i estimate of average network delay after receiving ith packet
dynamic estimate of average delay at receiver:
di (1 u)di 1 u( ri ti )
where u is a fixed constant (e.g., u = .01).
10/8/2009
CSE 124 Networked Services Fall 2009
21
Estimating Adaptive playout delay
also useful to estimate average deviation of delay, vi :
vi (1 u)vi 1 u | ri ti di |
estimates di , vi calculated for every received packet
(but used only at start of talk spurt
for first packet in talk spurt, playout time is:
pi ti di Kvi
where K is positive constant
remaining packets in talkspurt are played out periodically at time
p j t j d i Kvi
10/8/2009
CSE 124 Networked Services Fall 2009
22
Transport layer choice for multimedia applications
• TCP-like transport protocols are not suitable for multimedia traffic
– They are connection oriented
• high overhead
– They offer reliable delivery
• high delay due to potential retransmissions
• Larger playout delay: smooth TCP delivery rate
• HTTP/TCP passes more easily through firewalls
• Transmission rate fluctuates due to TCP congestion control
• UDP-like light connection less protocols are preferred
– Low end-to-end delay
– short playout delay (2-5 seconds) to remove network jitter
• Due to administrative reasons, TCP still dominates the multimedia
video/audio transport
• UDP is prominent for VoIP applications
10/8/2009
CSE 124 Networked Services Fall 2009
23
Packet loss
• Packet loss is unavoidable
– Recovery from packet loss is an important
objective
– Lossy recovery is sufficient for multimedia
• Two popular approaches
– Forward Error Correction
– Packet Interleaving
10/8/2009
CSE 124 Networked Services Fall 2009
24
Forward Error Correction
Approach: Packet Redundancy
• 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
FEC
Approach: Stream redundancy
“piggyback lower
quality stream”
send lower resolution
audio stream as
redundant information
e.g., nominal
stream PCM at 64 kbps
and redundant stream
GSM 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 rate
chunk
Packet Interleaving method
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
Week-2-Homework
• Reading assignments
– File Transfer protocol
• End-of-chapter Problems P10 and P11 from
Chapter 7 of Kurose and Ross (page 676)
– Will be placed at the course website
10/8/2009
CSE 124 Networked Services Fall 2009
28