Multimedia Lectures
Multimedia Lectures
Lectures
Multimedia Concepts
• Text:
– Hypertext, Hotword, True Type fonts, Printer
fonts, Kerning, Leading, Screen fonts
• Graphics:
– Clip Art, Charts, Stock photography, Digital
cameras, scanners
• Animation:
– Convey information that is important
– Change or movement
Lecture *Multimedia-Igli Tafa*
11
Multimedia Elements
A movieLecture
may*Multimedia-Igli
consist of Tafa*
several files 13
Multimedia Applications
• International Access
• Standard Use
• Ensuring a level or mastery
• Update skills of current employees
• Immediate feedback
• Simulated experiences
• Electronic References
• Push Technology
• Kiosk
• Advertise and marketing
• Electronic catalogs and malls
• Games
• Up-to-date articles
• Software on demand
• Free standing information stations
• Grab Attention and online slide shows
• Marketing Goods and purchases
• Edutainment
Scanning PatternLecture
for*Multimedia-Igli
NTSC Video Tafa* and Television 20
The JPEG Standard
• Rewind is simple
– set next frame to zero
• Fast forward/backward are trickier
– compression makes rapid motion complicated
– special file containg e.g. every 10th frame
New streamLecture
starting at regular intervals
*Multimedia-Igli Tafa*
33
Near Video on Demand with VCR Functions
Audio Text
Frame Frame
Block Caching
(a) Two users, same movie 10 sec out of sync
(b) Merging two streams into one
Lecture *Multimedia-Igli Tafa*
42
File Caching
• Scan-EDF algorithm
– uses deadlines & cylinder numbers for scheduling
Lecture *Multimedia-Igli Tafa*
45
QoS Problem
• Selection of proper VC
• Problems with Bandwidth: FDM and TDM
• Problems with Delay: Line Transmission
and Buffer Delay
• Problems with Jitter: Dynamic Packets
during transmission
• Problems with Reliabilities: OS must solve
it?
Lecture *Multimedia-Igli Tafa*
46
An End-To-End Problem
160 ---
Client
160 160
160 148
160 190
... ...
represented by bits,
e.g., 8 bits for 256
values
Multmedia Networking
7-53
Multimedia: audio
example: 8,000 samples/sec,
256 quantized values:
quantization
64,000 bps error
quantized
value of
receiver converts bits back to analog value
example rates
CD: 1.411 Mbps time
Multmedia Networking
7-54
spatial coding example: instead
2. video
1. video sent 3. video received,
recorded network played out at
(e.g., 30 delay client time
frames/ (fixed in (30 frames/sec)
streaming:
this at this time, client
sec)
playing
example) out early part of video,
while server still sending later
part of video
Multmedia Networking
7-58
Streaming stored video: challenges
continuous playout constraint: once client playout begins, playback must match
original timing
… but network delays are variable (jitter), so will need client-side buffer to
match playout requirements
other challenges:
client interactivity: pause, fast-forward, rewind, jump through video
video packets may be lost, retransmitted
Multmedia Networking
7-59
Streaming stored video: revisted
constant bit
rate video client video
Cumulative
constant bit
transmission reception rate video
data
buffered
network
video
delay
client time
playout
delay
client-side buffering and playout delay: compensate
for network-added delay, delay jitter
Multmedia Networking
7-60
Client-side buffering, playout
buffer fill level,
Q(t)
variable fill playout rate,
rate, x(t) e.g., CBR r
client application
video server buffer, size B
client
Multmedia Networking
7-61
Client-side buffering, playout
buffer fill level,
Q(t)
variable fill playout rate,
rate, x(t) e.g., CBR r
client application
video server buffer, size B
client
client application
video server buffer, size B
variable
rate, x(t)
netcinema’s
authorative DNS KingCDN.com KingCDN
Multmedia Networking
authoritative DNS 7-70
CDN cluster selection strategy
• challenge: how does CDN DNS select “good” CDN
node to stream to client
– pick CDN node geographically closest to client
– pick CDN node with shortest delay (or min # hops) to
client (CDN nodes periodically ping access ISPs,
reporting results to CDN DNS)
– IP anycast
Netflix registration,
accounting servers
3. Manifest file
2. Bob browses returned for
requested video Limelight CDN
Netflix video
2
3
1
1. Bob manages
Netflix account
Level-3 CDN
4. DASH streaming
Multmedia Networking
7-73
Voice-over-IP (VoIP)
• VoIP end-end-delay requirement: needed to maintain
“conversational” aspect
– higher delays noticeable, impair interactivity
– < 150 msec: good
– > 400 msec bad
– includes application-level (packetization,playout), network
delays
• session initialization: how does callee advertise IP address,
port number, encoding algorithms?
• value-added services: call forwarding, screening,
recording
• emergency services: 911
Multmedia Networking
7-74
VoIP characteristics
• 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 of data
• application-layer header added to each chunk
• chunk+header encapsulated into UDP or TCP segment
• application sends segment into socket every 20 msec
during talkspurt
Multmedia Networking
7-75
VoIP: packet loss, delay
network loss: IP datagram lost due to
network congestion (router buffer overflow)
delay loss: IP datagram arrives too late for
playout at receiver
delays: processing, queueing in network; end-
system (sender, receiver) delays
typical maximum tolerable delay: 400 ms
loss tolerance: depending on voice encoding,
loss concealment, packet loss rates between
1% and 10% can be tolerated
Multmedia Networking
7-76
Delay jitter
constant bit
rate client
Cumulative
constant bit
transmission reception rate playout
data
variable at client
buffered
network
data
delay
(jitter)
client time
playout
end-to-end delays ofdelay
two consecutive packets: difference can
be more or less than 20 msec (transmission time difference)
Multmedia Networking
7-77
VoIP: 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
– small q: better interactive experience
Multmedia Networking
7-78
VoIP: 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
packets loss
generated
packets
playout schedule
received
p' - r
playout schedule
p-r
tim e
Multmedia
r
Networking
5-79
p p'
Adaptive playout delay (1)
goal: low playout delay, low late loss rate
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
i = (1)d
adaptively destimate i-1 + delay:
packet (ri – ti)( EWMA -
exponentially weighted moving average, recall TCP RTT
estimate):
delay estimate small constant, time received - time sent
after ith packet e.g. 0.1 (timestamp)
measured delay of ith packet
Multmedia Networking
7-80
Adaptive playout delay (2)
also useful to estimate average deviation of delay, v i :
vi = (1)vi-1 + |ri – ti – di|
estimates di, vi calculated for every received
packet, but used only at start of talk spurt
Multmedia Networking
7-82
VoiP: recovery from packet loss (1)
Challenge: recover from packet loss given small tolerable delay
between original transmission and playout
each ACK/NAK takes ~ one RTT
alternative: Forward Error Correction (FEC)
send enough bits to allow recovery without retransmission (recall two-
dimensional parity in Ch. 5)
simple FEC
for every group of n chunks, create redundant chunk by exclusive OR-ing n
original chunks
send n+1 chunks, increasing bandwidth by factor 1/n
can reconstruct original n chunks if at most one lost chunk from n+1 chunks,
with playout delay
Multmedia Networking
7-83
VoiP: recovery from packet loss (2)
another FEC scheme:
“ 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
non-consecutive loss: receiver can conceal loss
generalization: can also append (n-1)st and (n-2)nd low-bit rate
chunk
Multmedia Networking
7-84
VoiP: recovery from packet loss (3)
login server
Application Layer
2-86
P2P voice-over-IP: skype
skype client operation:
1. joins skype network by
contacting SN (IP address
cached) using TCP Skype
login server
2. logs-in (usename,
password) to centralized
skype login server
3. obtains IP address for
callee from SN, SN overlay
or client buddy list
Application Layer
2-87
Skype: peers as relays
• problem: both Alice, Bob
are behind “NATs”
– NAT prevents outside peer
from initiating connection to
insider peer
– inside peer can initiate
connection to outside
relay solution: Alice, Bob
maintain open connection
to their SNs
Alice signals her SN to connect
to Bob
Alice’s SN connects to Bob’s
SN
Bob’s SN connects to Bob over
open connection Bob initially
initiated to his SN
Application Layer
2-88
Real-Time Protocol (RTP)
Multmedia Networking
5-90
RTP example
example: sending 64 kbps RTP header indicates
PCM-encoded voice over type of audio encoding
RTP in each packet
application collects sender can change
encoded data in chunks, encoding during
conference
e.g., every 20 msec = 160
bytes in a chunk RTP header also
audio chunk + RTP contains sequence
header form RTP packet, numbers, timestamps
which is encapsulated in
UDP segment
Multmedia Networking
7-91
RTP and QoS
RTP does not provide any mechanism to
ensure timely data delivery or other QoS
guarantees
RTP encapsulation only seen at end systems
(not by intermediate routers)
routers provide best-effort service, making no
special effort to ensure that RTP packets arrive
at destination in timely matter
Multmedia Networking
7-92
RTP header
payload sequence Synchronization Miscellaneou
time stamp
type number type Source ID s fields
sequence # (16 bits): increment by one for each RTP packet sent
detect packet loss, restore packet sequence
Multmedia Networking
5-93
RTP header
payload sequence Synchronization Miscellaneou
time stamp
type number type Source ID s fields
SSRC field (32 bits long): identifies source of RTP stream. Each
stream in RTP session has distinct SSRC
Multmedia Networking
7-94
RTSP/RTP programming
assignment
build a server that encapsulates stored video
frames into RTP packets
grab video frame, add RTP headers, create
UDP segments, send segments to UDP socket
include seq numbers and time stamps
client RTP provided for you
also write client side of RTSP
issue play/pause commands
server RTSP provided for you
Multmedia Networking
7-95
Real-Time Control Protocol (RTCP)
works in conjunction each RTCP packet
with RTP contains sender and/or
each participant in RTP receiver reports
session periodically report statistics useful to
application: # packets
sends RTCP control
sent, # packets lost,
packets to all other interarrival jitter
participants
feedback used to control
performance
sender may modify its
transmissions based on
feedback
Multmedia Networking
7-96
RTCP: multiple multicast senders
sender RTP
RTCP
RTCP
RTCP
receivers
Multmedia Networking
7-98
RTCP: stream synchronization
Multmedia Networking
7-101
SIP services
SIP provides determine current IP
mechanisms for call address of callee:
setup: maps mnemonic
identifier to current IP
for caller to let callee address
know she wants to call management:
establish a call add new media streams
so caller, callee can during call
agree on media type, change encoding during
encoding call
invite others
to end call transfer, hold calls
Multmedia Networking
7-102
Example: setting up call to known IP address
Bob
Alice
Multmedia Networking
7-104
Example of SIP message
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 167.180.112.24 Here we don’t know
From: sip:[email protected] Bob’s IP address
To: sip:[email protected]
intermediate SIP
Call-ID: [email protected]
Content-Type: application/sdp servers needed
Content-Length: 885 Alice sends,
receives SIP messages
c=IN IP4 167.180.112.24
using SIP default port
m=audio 38060 RTP/AVP 0
506
register message:
REGISTER sip:domain.com SIP/2.0
Via: SIP/2.0/UDP 193.64.210.89
From: sip:[email protected]
To: sip:[email protected]
Expires: 3600
Multmedia Networking
7-107
SIP proxy
• another function of SIP server: proxy
• Alice sends invite message to her proxy server
– contains address sip:[email protected]
– proxy responsible for routing SIP messages to callee, possibly
through multiple proxies
• Bob sends response back through same set of SIP
proxies
• proxy returns Bob’s SIP response message to Alice
– contains Bob’s IP address
• SIP proxy analogous to local DNS server plus TCP setup
Multmedia Networking
7-108
SIP example: [email protected] calls [email protected]
Poly SIP
2. UMass proxy forwards request registrar
to Poly registrar server
2 3 3. Poly server returns redirect response,
indicating that it should try [email protected]
Multmedia Networking
7-111
Dimensioning best effort networks
individual connections
history: ToS bits
Multmedia Networking
7-113
Multiple classes of service: scenario
H3
H1
R1 R2
H4
H2 R1 output 1.5 Mbps link
interface
queue
Multmedia Networking
7-114
Scenario 1: mixed HTTP and VoIP
example: 1Mbps VoIP, HTTP share 1.5 Mbps
link.
HTTP bursts can congest router, cause audio loss
want to give priority
R1 to audio over
R2
HTTP
Principle 1
packet marking needed for router to distinguish
between different classes; and new router policy to
treat packets accordingly
Multmedia Networking
7-115
Principles for QOS guarantees (more)
what if applications misbehave (VoIP sends higher than
declared rate)
policing: force source adherence to bandwidth allocations
marking, policing at network edge
1 Mbps
phone R1 R2
Principle 2
provide protection (isolation) for one class from others
Multmedia Networking
7-116
Principles for QOS guarantees (more)
• allocating fixed (non-sharable) bandwidth to flow:
inefficient use of bandwidth if flows doesn’t use its
allocation
Principle 3
while providing isolation, it is desirable to use
resources Multmedia
as efficiently
Networking as possible
7-117
Scheduling and policing mechanisms
scheduling: choose next packet to send on link
FIFO (first in first out) scheduling: send in order of
arrival to queue
real-world example?
discard policy: if packet arrives to full queue: who to
discard?
• tail drop: drop arriving packet
• priority: drop/remove on priority basis
• random: drop/remove randomly
packet packet
arrivals queue link departures
(waiting area) (server)
Multmedia Networking
7-118
Scheduling policies: priority
high priority queue
priority scheduling: (waiting area)
queued packet
classify link
multiple classes, with low priority queue
(server)
(waiting area)
different priorities
2
class may depend on 1 3 4 5
arrivals
marking or other
header info, e.g. IP packet
in 1 3 2 4 5
service
source/dest, port
numbers, etc. departures
1 3 2 4 5
real world example?
Multmedia Networking
7-119
Scheduling policies: still more
Round Robin (RR) scheduling:
multiple classes
cyclically scan class queues, sending one complete packet from each class (if available)
real world example?
2
1 3 4 5
arrivals
packet
in 1 3 2 4 5
service
departures
1 3 3 4 5
Multmedia Networking
7-120
Scheduling policies: still more
Weighted Fair Queuing (WFQ):
generalized Round Robin
each class gets weighted amount of service
in each cycle
real-world example?
Multmedia Networking
7-121
Policing mechanisms
goal: limit traffic to not exceed declared parameters
Three common-used criteria:
(long term) average rate: how many pkts can be sent per unit time (in the long
run)
crucial question: what is the interval length: 100 packets per sec or 6000 packets per min
have same average!
peak rate: e.g., 6000 pkts per min (ppm) avg.; 1500 ppm peak rate
(max.) burst size: max number of pkts sent consecutively (with no intervening
idle)
Multmedia Networking
7-122
Policing mechanisms:
implementation
token bucket: limit input to specified burst size and
average rate
D = b/R
arriving max
traffic
Multmedia Networking
7-124
Differentiated services
• want “qualitative” service classes
– “behaves like a wire”
– relative service distinction: Platinum, Gold, Silver
• scalability: simple functions in network core, relatively complex
functions at edge routers (or hosts)
– signaling, maintaining per-flow router state difficult with large number of
flows
• don’t define define service classes, provide functional components
to build service classes
Multmedia Networking
7-125
Diffserv architecture
marking
r
edge router:
b scheduling
per-flow traffic management
marks packets as in-profile and
out-profile ..
.
core router:
per class traffic management
buffering and scheduling based
on marking at edge
preference given to in-profile
packets over out-of-profile
packets Multmedia Networking
7-126
Edge-router packet marking
profile: pre-negotiated rate r, bucket size b
packet marking at edge based on per-flow profile
rate r
user packets
Multmedia Networking
7-128
Classification, conditioning
may be desirable to limit traffic injection rate
of some class:
user declares traffic profile (e.g., rate, burst
size)
traffic metered, shaped if non-conforming
Multmedia Networking
7-129
Forwarding Per-hop Behavior (PHB)
PHB result in a different observable
(measurable) forwarding performance behavior
PHB does not specify what mechanisms to use
to ensure required PHB performance behavior
examples:
class A gets x% of outgoing link bandwidth over
time intervals of a specified length
class A packets leave first before packets from class
B
Multmedia Networking
7-130
Forwarding PHB
PHBs proposed:
expedited forwarding: pkt departure rate of
a class equals or exceeds specified rate
logical link with a minimum guaranteed rate
assured forwarding: 4 classes of traffic
each guaranteed minimum amount of
bandwidth
each with three drop preference partitions
Multmedia Networking
7-131
Per-connection QOS guarantees
basic fact of life: can not support traffic demands
beyond link capacity
1 Mbps R1
phone R2
Principle 4
call admission: flow declares its needs, network may
block call (e.g., busy signal) if it cannot meet needs
Multmedia Networking
7-132
QoS guarantee scenario
resource reservation
call setup, signaling (RSVP)
traffic, QoS declaration
per-element admission control
request/
reply
QoS-sensitive scheduling
(e.g., WFQ)
Multmedia Networking
7-133