7: Multimedia Networking 7-1
Chapter 7: Multimedia Networking
Jim Kurose, Keith Ross: “Computer Networking: A Top-Down Approach”
3rdedition: Addison-Wesley, July 2004 4thedition: Addison-Wesley, July 2007
Slides modified (edited, reordered, reduced, extended) by Lidia Yamamoto, Univ. Basel, May 26, 2008
7: Multimedia Networking 7-2
Chapter 7: Multimedia Networking
Jim Kurose, Keith Ross: “Computer Networking: A Top-Down Approach” Slides modified (edited, reordered, reduced, extended) by
Lidia Yamamoto, Univ. Basel, June 11, 2007
(most material comes from the 3rdedition, some from other sources, plus some gif figures from the 4thedition) A note on the use of these ppt slides:
We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lotof work on our part. In return for use, we only ask the following:
If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material.
Thanks and enjoy! JFK / KWR All material copyright 1996-2008 J.F Kurose and K.W. Ross, All Rights Reserved
7: Multimedia Networking 7-3
Contents: Multimedia, QoS, CDN, P2P
Introduction Definitions Performance requirements Multimedia networking Streaming • Client Buffering • RTSP Real-time Interactive • RTP/RTCP • SIP, SDP, H.323 • Mitigating delay and loss
QoS
Intserv, Diffserv
Content Distribution
Networks (CDNs)
Peer-to-Peer (P2P)
Case study: Skype
7: Multimedia Networking 7-4
Multimedia
Media: stimulate one of our 5 senses
Sight: Text, Graphics, Images, Video Hearing: Audio
Smell? Taste? Touch?
Multimedia strict definition: more than one medium
combined and synchronized together
Web browsing or e-mail with text + images Audio-visual communication, e.g. videoconferencing Multimedia documents
Multimedia networking
, Internet context:
continuous
audio and/or video
(also when single medium)
Streaming: Stored or live audio/video streaming Real-timeand/or interactiveaudio/video7: Multimedia Networking 7-5
Multimedia Networking Map
media data transmission Streaming presentation control by user presentation description
Streaming multimedia:
synchronization across media loss/delay compensation Media player Media server main direction of information flow 7: Multimedia Networking 7-6Multimedia Networking Map
call setup agree on encoding schemes user location interactive session description
statistics on media transmission synchronization across media media data transmission loss/delay compensation Application clock information information for accounting, billing invite users
Interactive multimedia:
fixed or mobile phone networks gateway7: Multimedia Networking 7-7
Multimedia Networking Requirements
How to transmit audio or video over the Internet?
Network performance requirements
Parameters: delay, packet loss, bandwidth, jitter(delay variation)
File transfer, web browsing, e-mail are elastic
applications: flexible in terms of delay/bandwidth, but no loss tolerated
Multimedia applications are typically delay-sensitiveand require some minimum bandwidthbut are loss tolerant: infrequent losses cause minor glitches
Technical challenges
Currently all packets receive equal, best effort service Except for TCP reliability (loss=0) guarantee, no other
performance guarantees are available
Scalability: one to many, many to many transmissions
7: Multimedia Networking 7-8
Multimedia Networking Requirements
File transfer E-mail Web browsing Streaming
multimedia multimediaReal-time
No loss (max loss = 0) Max loss
Max delay, jitter performance requirements TCP UDP Available transport protocols Min bandwidth
IP Network Layer: Best Effort Delivery Service elastic applications delay-sensitive, loss tolerant
?
?
?
7: Multimedia Networking 7-9
Multimedia Networking: Solutions
Add performance guarantees to the Internet
stack
Quality of Service (QoS), e.g. Intserv, Diffserv IP Multicast
Several attempts, no real success so far
Adaptive applications: make the best of best
effort
Streaming and (semi-)real-time support over UDP and even TCP
Application-layer solutions: CDNs, P2P, Application-layer multicast,…
Increasingly successful
7: Multimedia Networking 7-10
Contents: Multimedia, QoS, CDN, P2P
Introduction Definitions Performance requirements Multimedia networking Streaming • Client Buffering • RTSP Real-time Interactive • RTP/RTCP • SIP, SDP, H.323 • Mitigating delay and loss
QoS
Intserv, Diffserv
Content Distribution
Networks (CDNs)
Peer-to-Peer (P2P)
Case study: Skype
Streaming
Stored
Multimedia
file transmission
client playout begins as soon as possible
(i.e. before whole file is transmitted)
control:
VCR or DVD-like:
pause, move
forwards, backwards,…
time
constraint: media data should
arrive in time for playout
Media server
client
media data
control
Streaming
Live
Multimedia
examples
Internet radio talk show Live sports event
playout buffer instead of file transmission
store a few tens of seconds before playback: cope with jitter
no fast-forwarding possible!
time constraint same as stored streaming
Internet “broadcast station” client media data control
7: Multimedia Networking 7-13 constant bit rate video transmission Cu m ul at iv e da ta time variable network delay client video
reception rate videoconstant bit
playout at client client playout delay bu ffe re d vide o
Streaming Multimedia: Client Buffering
Client-side buffering with playout delay to
compensate for network-added delay and jitter
7: Multimedia Networking 7-14
Streaming Multimedia: Client Buffering
Buffer size: b > s*d
If large buffer (~file size) possible then avg(r(t)) > s allowed Small buffer requires avg(r(t)) = s
If avg(r(t)) < s: starvation buffered video variable fill rate, r(t) constant drain rate, s playout delay: d 7: Multimedia Networking 7-15
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
short playout delay (a few seconds) to compensate for jitter
error recovery if time permits
TCP
send at maximum possible rate under TCP
buffer fill rate fluctuates due to TCP congestion control larger playout delay in order to smooth TCP delivery rate popular: HTTP/TCP passes more easily through firewalls
7: Multimedia Networking 7-16
Streaming Multimedia: client rate(s)
Q:
how to handle different client receive rate
capabilities?
28.8 Kbps dialup
100 Mbps Ethernet
A:
server stores, transmits multiple copies
of video, encoded at different rates
1.5 Mbps encoding 28.8 Kbps encoding
7: Multimedia Networking 7-17
Multimedia Networking: Partial Map
media data transmission Streaming presentation control by user presentation description
Streaming multimedia:
Media playerMedia server
main direction of information flow
RTSP
7: Multimedia Networking 7-18
Real Time Streaming Protocol (RTSP)
IETF RFC 2326
www.rtsp.org
User control of streaming media: VCR-like
rewind, fast forward, pause, resume, repositioning, etc…
Client-server application-layer protocol
request-response: requests from player to server; each request
confirmed with a response message from server Syntax and operation intentionally similar to HTTP
7: Multimedia Networking 7-19
RTSP Operation
Client (browser) requests page
containing multimedia presentation Client obtains XML metafile: a
description of the multimedia presentation, which can consist of several media streams.
Link to each media stream: rtsp:// The browser invokes corresponding
media player(helper application) based on the content type of the presentation description.
Each player sets up an RTSP control
connection, and a data connection to the streaming server
RTSP: (out-of band) control protocol request-response
RTSP SETUP, PLAY, PAUSE, TEARDOWN HTTP GET SETUP PLAY media stream PAUSE TEARDOWN media player Web server media server Web browser client server presentation desc. 7: Multimedia Networking 7-20
XML Metafile Example
<title>Twister</title> <session><group language=en lipsync> <switch> <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"> </switch> <track type="video/jpeg" src="rtsp://video.example.com/twister/video"> </group> </session> 7: Multimedia Networking 7-21
RTSP Exchange Example
C: SETUP rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Transport: rtp/udp; compression;port=3056; mode=PLAYS: RTSP/1.0200 1 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: 200 3OK 7: Multimedia Networking 7-22
Multimedia Networking: Protocol Map
media data transmission Streaming presentation control by user presentation description
Streaming multimedia:
synchronization across media loss/delay compensation Media player Media server XML metafile RTP/UDP, TCP RTSP main direction of information flowContents: Multimedia, QoS, CDN, P2P
Introduction Definitions Performance requirements Multimedia networking Streaming • Client Buffering • RTSP Real-time Interactive • RTP/RTCP • SIP, SDP, H.323 • Mitigating delay and loss
QoS
Intserv, Diffserv
Content Distribution
Networks (CDNs)
Peer-to-Peer (P2P)
Case study: Skype
Interactive, Real-Time Multimedia
end-end delay requirements:
audio: < 150 msec good, < 400 msec OK
loss tolerance:
1% to 20% depending on encoding and application
session initialization
locate participants, agree on encoding formats, etc.
applications:
VoIP, IP
telephony, video conference,
distributed interactive worlds
7: Multimedia Networking 7-25
Multimedia Networking: Partial Map
statistics on media transmission synchronization across media RTP/UDP media data transmission RTCP loss/delay compensation Application clock information
Interactive multimedia:
data transmission and control
7: Multimedia Networking 7-26
RTP and RTCP
RTP (Real-Time Transport Protocol): RFC 3550
Transport-level packet format to carry monomedia
data (video, audio, animations,…). Payload contains:
Payload type, sequence number, timestamp, sourceidentifier(s), media samples
Multimedia via multiple synchronized RTP sessions
Support for multipoint, bidirectional flows,
translators and mixers
Generally runs over UDP: unicast or multicast
Companion Control Protocol: RTCP:
Clock timestamp for media synchronization Periodic sender/receiver statistics
7: Multimedia Networking 7-27
RTP Header
Payload Type
(7 bits)
: type of encoding, e.g.:
0 = PCM mu-law, 64 kbps 3 = GSM, 13 kbps 33 = MPEG2 video
Sequence Number
(16 bits)
of RTP packet
Timestamp
(32 bits)
: sample number
incremented by one for each sample (not real-time clock) even if source inactive
SSRC
(32 bits)
: synchronization source identifier
CSRC
(32 bits): contributing source id (e.g. mixing)
Seq. no. Timestamp SSRC cod.
type CSRC1 CSRC2 Samples…
7: Multimedia Networking 7-28
Multimedia Networking: Partial Map
call setup agree on encoding schemes user location interactive session description synchronization across media SDP loss/delay compensation
Application invite users SIP
Interactive multimedia:
7: Multimedia Networking 7-29
Session Initiation Protocol (SIP)
IETF RFC 3261
Creation and management of multimedia sessions
Establish, modify, terminate sessions Invite new participants to existing sessions Add or remove media
User location for personal mobility (name mapping and redirection)
SIP user identity
URI = Universal Resource Identifier: location-independent, e.g. sip:[email protected], sip:[email protected]
Address, e.g. sip:[email protected]
Multimedia session descriptions in SIP (mainly):
SDP= Session Description Protocol(RFC 2327)
7: Multimedia Networking 7-30
SIP Call Set Up: Known IP Address
Alice’s SIP invite messagecontains SDP session description
C= protocol (IPv4) & IP address. M= media (audio), port
number (38060), preferred encoding (“RTP/AVP 0” = PCM ulaw) to receive audio Bob’s SIP “200 OK” message
contains his own SDP descr.: IP address, port &
preferred encoding to recv. (“RTP/AVP 3” = GSM) SIP messages can be sent
over TCP or UDP; here sent over RTP/UDP. Default SIP port number is
5060. SDP
7: Multimedia Networking 7-31
SIP Call Set Up: Location- independent URI
sip:[email protected] sip:[email protected]
SIP Proxy atlanta.com
Call routing via SIP proxy servers SIP Registrar Biloxi.com Location database SIP Proxy biloxi.com
•SIP Registrar: registers SIP user locations into database
•SIP Proxy: informs clients about locations, routes calls
(both functions may be combined into the same machine) 2 INVITE sip:[email protected] 3 4 5 1 6 7: Multimedia Networking 7-32
SIP Call Set Up: Location- independent URI
sip:[email protected] sip:[email protected] SIP Proxy atlanta.com SIP Proxy unibas.ch SIP Registrar Biloxi.com Location database SIP Proxy biloxi.com 2 INVITE sip:[email protected] 4 5 REGISTER 3 REDIRECT unibas.ch 6 7 8 1
Call routing via SIP proxy servers
7: Multimedia Networking 7-33
Another Example
Caller [email protected] places a call to [email protected]
(1) Jim sends INVITE message to umass SIP proxy. (2) Proxy forwards request to upenn registrar server. (3) upenn server returns redirect response, indicating that it should try [email protected]
(4) umass proxy sends INVITE to eurecom registrar. (5) eurecom registrar forwards INVITE to 197.87.54.21, which is running keith’s SIP client. (6-8) SIP response sent back (9) media sent directly
between clients.
Note:also a SIP ack message, which is not shown. SIP client 217.123.56.89 SIP client 197.87.54.21 SIP proxy umass.edu SIP registrar upenn.edu SIP registrar eurecom.fr 1 2 3 4 5 6 7 8 9 Keith (now) Jim Keith (home) 7: Multimedia Networking 7-34
H.323 in a Nutshell
analogous to SIP registrar, plus accounting and billing functionsH.323 in a Nutshell
ITU recommendation for real-time audio and video
across IP networks
Comprehensive suite of protocols including:
Call set-up, transmission (via RTP), synchronization, gatekeepers for accounting and billing, gateways to traditional phone networks,...
Intensive support from industry and telecom
industry (late 90’s), e.g. Microsoft NetMeeting
SIP then gained a large momentum: simple, web
flavor, support from the IETF and Internet
community
Today battle still not decided; other players
emerged (e.g. skype with proprietary protocols)
Multimedia Networking: Protocol Map
call setup agree on encoding schemes user location interactive session description
statistics on media transmission synchronization across media RTP/UDP media data transmission SDP RTCP loss/delay compensation Application clock information information for accounting, billing invite users SIP
Interactive multimedia:
H.323 gateway fixed or mobile phone networks7: Multimedia Networking 7-37
Interactive, Real-Time Multimedia
Mitigating the impact of loss and delay
Example: Internet Phone
Mitigating delay
Adaptive playout delay adjustment
Mitigating loss
Forward error correction (FEC) Interleaving
Loss concealment
7: Multimedia Networking 7-38
Mitigating delay: Adaptive Playout
packets time packets generated packets received loss r p p' playout schedule p' - r playout schedule p - r • First packet received at time r • First playout schedule: begins at p • Second playout schedule: begins at p’
Adjust buffer size (hence playout delay) by compressing/elongating silent periods Valid only for voice!
7: Multimedia Networking 7-39
Mitigating loss: Forward Error Correction
(FEC) with Redundant Packets
A B C R R = A xor B xor C A B C R B = A xor C xor R Lost packet Recovery: Redundant packet (inserted one every n packets)
+ : simple, valid for any media -: consumes 1/n more bandwidth -: increases playout delay
7: Multimedia Networking 7-40
Mitigating loss: Forward Error Correction
(FEC) with Redundant Streams
Redundant stream (lower quality, e.g. GSM) Nominal stream (higher quality, e.g. PCM) 7: Multimedia Networking 7-41
Mitigating loss: Interleaving
Small gaps 7: Multimedia Networking 7-42
Interleaving
Used in GSM
Pros:
+ : significantly improves perceived quality
+ : low overhead
+ : does not increase bandwidth usage
+ : can handle lost bursts
Cons:
7: Multimedia Networking 7-43
Loss concealment
A B C A B C A C (silence) sent received played No concealment: A B C A B C A C packet repetition sent received played A Repetition: sent received played A B C A B C A C B’ = f(A, C) B’ Interpolation: A B’ C time decoded signal 7: Multimedia Networking 7-44Contents: Multimedia, QoS, CDN, P2P
Introduction Definitions Performance requirements Multimedia networking Streaming • Client Buffering • RTSP Real-time Interactive • RTP/RTCP • SIP, SDP, H.323 • Mitigating delay and loss
QoS
Intserv, Diffserv
Content Distribution
Networks (CDNs)
Peer-to-Peer (P2P)
Case study: Skype
7: Multimedia Networking 7-45
Multimedia Networking Requirements
File transfer E-mail Web browsing Streaming
multimedia multimediaReal-time
No loss (max loss = 0) Max loss
Max delay, jitter performance requirements TCP UDP Available transport protocols Min bandwidth
IP Network Layer: Best Effort Delivery Service elastic applications delay-sensitive, loss tolerant
?
?
?
7: Multimedia Networking 7-46
Multimedia Quality of Service (QoS)
Multimedia applications:
network audio and video
(“continuous media”)
network provides
application with
level of
performance needed for
application to function.
QoS
Multimedia, Quality of Service
Internet currently offers only best effort service
QoS proposals:
IntServ: QoS guarantees possible but complex Diffserv: Loose guarantees (per class). Simpler, but still
complex to deploy in practice.
Future directions
IETF Integrated Services (Intserv)
Per flow QoS guarantees through
resource
reservation
at all nodes along the path
call set-up signaling (RSVPprotocol, RFC 2205) traffic, QoS declarationper-element admission control and reservation
QoS-sensitive scheduling
request/ reply
7: Multimedia Networking 7-49
IETF Differentiated Services
Main concern with Intserv:
Scalability:
signaling, maintaining per-flow router
state difficult with large number of flows in core
routers
Diffserv approach:
simple functions in network core, relatively
complex functions at edge routers (or hosts)
achieved through differentiated service classes,
as opposed to per-flow resource reservation
7: Multimedia Networking 7-50
Edge router:
per-flowtraffic management marks packets
diffserv packet field: IPv4: Type of Service (ToS) IPv6: Traffic Class
Classes:
Expedited Forwarding (EF): 5 Assured Forwarding (AF)
AF 4 AF 3 AF 2 AF 1 Best Effort: 0
Core router:
per classtraffic management buffering and scheduling based
on diffserv field
Diffserv Architecture
scheduling...
marking preced en ce 7: Multimedia Networking 7-51How should the Internet evolve to better
support multimedia?
Integrated services (IntServ) philosophy:
QoS guarantees through
fine-grain end-to-end resource reservations (per flow)
Requires new, more complex
software in hosts & routers
Differentiated services (DiffServ) philosophy: Fewer changes to Internet
infrastructure
Coarse grain service levels or “classes” of service
"Laissez-faire" no major changes more bandwidth when
needed, over-provisioning
content distribution,
application-layer solutions
New architecture attempts Earlier Asynchronous Transfer Mode (ATM), MPLS Active/Programmable Networks More recent: NewArch (USA) Autonomic Communication 7: Multimedia Networking 7-52
Summary
Many limitations of current networked multimedia
applications are due to network constraints
Main problems with both Intserv and Diffserv
Complexity, deployment & management cost/effort Crossing legacy best-effort portions of the Internet Socio-economic barriers: who uses ≠ who pays
Current “winner” solution is “laissez-faire” with
over-provisioning
Research directions
Autonomic, self-organizing networks: self-deploying services, including QoS
Adaptive functionality, not only at application layer, also at transport and network layer
7: Multimedia Networking 7-53
Contents: Multimedia, QoS, CDN, P2P
Introduction Definitions Performance requirements Multimedia networking Streaming • Client Buffering • RTSP Real-time Interactive • RTP/RTCP • SIP, SDP, H.323 • Mitigating delay and loss
QoS
Intserv, Diffserv
Content Distribution
Networks (CDNs)
Peer-to-Peer (P2P)
Case study: Skype
7: Multimedia Networking 7-54
Content Distribution Networks (CDNs)
Problem: Streaming stored multimedia: large and
very popular files (e.g. video from TV broadcast)
from single origin server in real time
Bottleneck at server Delay, loss
Not a solution:
Multicast: not everyone asks content at the same time Web caching: content pulled on demand, fresh
information (e.g. news) not cached
Solution: CDN
Content pushed in advance to servers located as close as possible to potential users
New business: CDN company
7: Multimedia Networking 7-55
CDN: Proactive Content Replication
CDN company (e.g., Akamai): customers are large content providers (e.g. CNN)
CDN replicates customers’
content in CDN servers.
Content downloaded to CDN servers ahead of time
Placing content “close” to user
alleviates load at origin server avoids impairments (loss, delay)
of sending content over long paths CDN server typically in edge/access network origin server in North America CDN distribution node CDN server in S. America CDN server in Europe CDN server in Asia 7: Multimedia Networking 7-56
An
Akamaized
Website (Wikipedia)
origin server Akamai CDN server 7: Multimedia Networking 7-57
CDN Redirection Mechanism
HTTP request for www.ocpn.com/sports/sports.htmlDNS query for www.cdn.com Answer from map to determine nearest server HTTP request for www.cdn.com/www.ocpn.com/video.mpg2 1 2 3 Origin server CDNs authoritative DNS server Nearby CDN server client HTML page containing
link to www.cdn.com/www.ocpn.com/video.mpg2
1 4 2 4 3 Content Provider’s network CDN network www.ocpn.com www.cdn.com 7: Multimedia Networking 7-58
CDN: (Research) Issues
Content distribution: from origin server to CDN servers IP Multicast
Application Layer Multicast (Overcast, Scattercast, Yoid) Dedicated Content Managers
Replica placement: optimal placement of CDN servers
Minimum latency and overall bandwidth
Discovery: Assign clients to CDN servers: locate server that
gives best performance Min latency and load
Table (map) indicates distance (cost) from leaf ISP (range of
IP addresses) to CDN server
• Can be built based on BGP routing tables, RTT estimates, etc. Map lookup to chose CDN server with minimum distance (cost)
for an ISP
Contents: Multimedia, QoS, CDN, P2P
Introduction Definitions Performance requirements Multimedia networking Streaming • Client Buffering • RTSP Real-time Interactive • RTP/RTCP • SIP, SDP, H.323 • Mitigating delay and loss
QoS
Intserv, Diffserv
Content Distribution
Networks (CDNs)
Peer-to-Peer (P2P)
Case study: Skype
Client-server architecture
Server:
content provider
always-on host
permanent IP address
server farms for scaling
Clients:
content consumer communicate with server may be intermittently
connected
may have dynamic IP
addresses
do not communicate directly
with each other
client
server client
7: Multimedia Networking 7-61
P2P architecture
Peer: both content providerand
consumer
Motivation: share information,
e.g. files
End systems communicate
directly (no 3rdparty servers)
Decentralized, scalable Issues:
content dissemination, search
and retrieval intermittent connectivity dynamic IP addresses NAT/firewall traversal non-cooperative nodes security 7: Multimedia Networking 7-62
Hybrid
Centralized indexe.g. original “Napster”
1) when peer connects, it informs central server:
IP address content, e.g. song titles 2) Alice queries index for song, index
returns Bob’s address
3) Alice requests and obtains song file from Bob directly
Centralized access control
e.g. Skype: register/authenticate with central server, rest P2P (search for users, media exchange)
centralized index server peers Alice Bob 1 1 1 1 2 3 7: Multimedia Networking 7-63
P2P Case Study: Skype
login server
Supernode structure:
7: Multimedia Networking 7-64
P2P Case Study: Skype
P2P VoIP software, encrypted calls
NAT and firewall traversal
Gateways to mobile/fixed phone networks
Proprietary protocols over TCP and UDP
Supernode structure (precursor: KaZaA)
Supernode peer must be fully reachable (not behind NAT) among other criteria: Firewall/NAT traversal via supernodes
Media data: direct communication between peers
when possible; when not (e.g. firewall) then relay via
supernode
Codecs in the range ~16kbps-128kbps with loss
concealment
7: Multimedia Networking 7-65
CDN+P2P Summary
CDN increasingly popular
Can P2P win over CDN?
Skype’s new Joost service: TV on demand
Bittorrent for sharing large files (including videos, software)
Legal issues
Copyright infringement
Dissemination of offensive content, malicious programs (e.g.