118
Telematics Chapter 10: Multimedia Networking Beispielbild User watching video clip Server with video clips Prof. Dr. Mesut Güneş Computer Systems and Telematics (CST) Presentation Layer Session Layer Application Layer Presentation Layer Session Layer Application Layer Distributed, embedded Systems Institute of Computer Science Freie Universität Berlin Data Link Layer Network Layer Transport Layer Data Link Layer Network Layer Transport Layer Data Link Layer Network Layer Freie Universität Berlin http://cst.mi.fu-berlin.de Data Link Layer Physical Layer Data Link Layer Physical Layer Data Link Layer Physical Layer Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking

Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

TelematicsChapter 10: Multimedia Networking

Beispielbildp g

User watching video clip

Server with video clips

Prof. Dr. Mesut GüneşComputer Systems and Telematics (CST)

Presentation Layer

Session Layer

Application Layer

Presentation Layer

Session Layer

Application Layer

p y ( )Distributed, embedded Systems Institute of Computer ScienceFreie Universität Berlin Data Link Layer

Network Layer

Transport Layer

Data Link Layer

Network Layer

Transport Layer

Data Link Layer

Network Layer

Freie Universität Berlinhttp://cst.mi.fu-berlin.de

Data Link Layer

Physical Layer

Data Link Layer

Physical Layer

Data Link Layer

Physical Layer

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 2: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Contents

● Design issues● Multimedia networking applications● Multimedia networking applications● Streaming stored audio and video● Making the best out of best effort service● Protocols for real-time interactive applications ● Providing multiple classes of service● Providing QoS guarantees

10.2Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 3: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Design Issuesg

● Two kinds of applications●Non-realtime applications OSI Reference Model●Non realtime applications● Email, FTP,

● Realtime applicationsA di id Presentation Layer

Application Layer

● Audio, video

● Principles● Classify multimedia applications

Presentation Layer

Session Layery pp

● Identify network services applications need

●Making the best of the best effortNetwork Layer

Transport Layer

●Making the best of the best effort service

● Protocols and Architectures Data Link Layer

Ph sical La e● Specific protocols for best-effort●Mechanisms for providing QoS● Architectures for QoS

Physical Layer

10.3

● Architectures for QoS

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 4: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Multimedia and Quality of Service: What is it?Q y

Multimedia applications: Network audio and video(“continuous media”)

QoSNetwork provides application with level of

QoS

application with level of performance needed for application to function.

10.4Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

application to function.

Page 5: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Quality of Service in the InternetQ y

● Problem today:● IP is packet switched, therefore no guarantees on transmission is given● IP is packet switched, therefore no guarantees on transmission is given● Throughput, transmission delay, …● The Internet transmits data at best effort

B t li ti d t i Q lit f S i (Q S)● But: many applications need a certain Quality of Service (QoS)

Application Reliability Delay Jitter Throughput

E Mail high low low lowE-Mail high low low low

File Transfer high low low medium

Web Access high medium low mediumg

Remote Login high medium medium low

Audio on Demand low low high medium

Video on Demand low low high high

IP Telephony low high high low

10.5

Video Conference low high high high

Page 6: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

QoS ParametersQ

● Throughput [bit/s]●Which minimum/maximum/average data rate is necessary?●Which minimum/maximum/average data rate is necessary?

● Transmission delay [s]●Which maximum delay is tolerable?

● Jitter [s]●Which fluctuations in the transmission delay are tolerable?

● Availability [%]● Availability [%]●With which probability the communication service is available?

10.6

Page 7: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Multimedia networking applicationsMultimedia networking applications

10.7Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 8: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

MM Networking Applications g pp

● Classes of MM applications:● Stored streaming

A Bt● Stored streaming

● Live streaming● Interactive, real-time

t1t2t3t

t‘1t‘

● Fundamental characteristics:● Typically delay sensitive

t4 t 2

t‘3

t‘4● Typically delay sensitive● End-to-end delay● Delay jitter

4

Time● Loss tolerant: infrequent losses

cause minor glitches ● Antithesis of data, which are loss

Timedi = t‘i – tiji = di+1 – di

,intolerant but delay tolerant

Jitter ji is the variability of packet

10.8Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

ji y pdelays within the same packet stream

Page 9: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming Stored Multimedia g

● Stored streaming: ●Media stored at source

T itt d t li t● Transmitted to client● Streaming: client play out begins

before all data has arrived● Timing constraint for still-to-be

transmitted data: in time for play out

10.9Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 10: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming Stored Multimedia: What is it?g

2 video

1. videorecorded

2. videosent 3. video received,

played out at clientnetworkd l

Streaming: at this time, client

delaytime

playing out early part of video, while server still sending laterpart of video

10.10Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 11: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming Stored Multimedia: Interactivityg y

● VCR-like functionality: ● Client can

i d FF h lid b● pause, rewind, FF, push slider bar

●Delay restrictions● 10 sec initial delay OK● 1-2 sec until command effect OK

● Timing constraint for still-to-be transmitted data: in time for playtransmitted data: in time for play out

10.11Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 12: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming Live Multimediag

● Examples:● Internet radio talk show● Internet radio talk show● Live sporting event

● Streaming (as with streaming stored multimedia)● Playback buffer● Playback can lag tens of seconds after transmission● Still have timing constraint● Still have timing constraint

● Interactivity● Fast forward impossible● Rewind, pause possible!

10.12Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 13: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Real-Time Interactive Multimedia

● Applications● IP telephony, video conference● IP telephony, video conference●Distributed interactive worlds

● End-to-end delay requirements● Audio: <150 msec good, <400 msec OK● Includes application-level (packetization)

and network delays● Higher delays noticeable, impair

interactivity

● Session initializationSess o t a at o●How does callee advertise its IP address,

port number, encoding algorithms?

10.13Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 14: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Multimedia Over Today’s Internety

● TCP/UDP/IP: “best-effort service”●No guarantees on delay, loss●No guarantees on delay, loss

?But you said multimedia apps requireQ S d l l f f m t b

?? ?? ???

QoS and level of performance to beeffective! ? ?? ?

Today’s Internet multimedia applications y ppuse application-level techniques to mitigate

(as best possible) effects of delay, loss

10.14Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 15: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

How should the Internet evolve to better support multimedia?pp

● Integrated services philosophy ● Fundamental changes in Internet so that apps can reserve end-to-end bandwidth● Fundamental changes in Internet so that apps can reserve end to end bandwidth● Requires new, complex software in hosts & routers

● Laissez-faire●No major changes●More bandwidth when needed●More bandwidth when needed● Content distribution, application-layer multicast● Application layer

● Differentiated services philosophyFewer changes to Internet infrastructure

What’s your opinion?

● Fewer changes to Internet infrastructure● Provide small number of service classes (maybe two)

10.15Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 16: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

How should the Internet evolve to better support multimedia?pp

Approach Unit of allocation

Guarantee Deploymentto date

Complexity Mechanisms

Making the best of best-effort service

None None or soft Everywhere Minimal Application-layersupport, CDN, over-provisioning

Differential QoS Classes of None or soft Some Medium Policing Differential QoS Classes of flows

None or soft Some Medium Policing, scheduling

Guaranteed QoS Individualflows

Soft or hard, once a flow is d d

Little High Policing, scheduling, call d d admitted admission and

signaling

10.16Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 17: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Multimedia networking applicationsAudio and Video CompressionMultimedia networking applications

10.17Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 18: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

A few words about audio compressionp

● Analog signal sampled at constant rate

● Example: ● 8,000 samples/sec, 256 quantized

● Telephone: 8,000 samples/sec● CD music: 44,100 samples/sec

E h l i d i

● 8,000 samples/sec, 256 quantized values 64,000 bps

● Receiver converts bits back to analog signal● Each sample quantized, i.e.,

rounded● 28=256 possible quantized values

analog signal● Some quality reduction

p q

● Each quantized value represented by bits

8 bit f 256 l

● Example rates● CD: 1.411 Mbps (stereo)●MP3: 96 128 160 kbps● 8 bits for 256 values ●MP3: 96, 128, 160 kbps●GSM: 13 kbps● Internet telephony ● G.729: 8 kbps● G.723.3: 5.3 kbps and 6.4 kbps

10.18Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 19: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

A few words about video compressionp

● Video: sequence of images displayed at constant rate

● Examples:●MPEG1 (CD-ROM) 1.5 Mbpsp y

● Frame rate 24 images/sec

● Digital image: array of pixels

●MPEG1 (CD ROM) 1.5 Mbps●MPEG2 (DVD) 3-6 Mbps●MPEG4 <1 Mbps

● Each pixel represented by bits

● Redundancy● Spatial (within image)

● Often used in Internet

● Research: layered (scalable) video● Spatial (within image)

● Temporal (from one image to next) ● Adapt layers to available bandwidth

● Example● Single image of 1024 pixels● Each pixel encoded into 24 bits● Each pixel encoded into 24 bits

3 Mbyte without compressionCompression ratio 10:1 results in

10.19

300 Kbyte

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 20: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming stored audio and videoStreaming stored audio and video

10.20Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 21: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming Stored Multimediag

● Application-level streaming techniques for making the best out of best effort service:● Client-side buffering●Use of UDP versus TCP

M l i l di f l i di●Multiple encodings of multimedia

● Media PlayerMedia Player● Jitter removal●Decompression● Error concealment●Graphical user interface

with controls for interactivityy

10.21Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 22: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Internet multimedia: Simplest approachp pp

● Audio or video stored in file● Files transferred as HTTP object● Files transferred as HTTP object● Received in entirety at client● Then passed to player WebWeb

browserWeb

server● Audio, video not streamed:●No, “pipelining,” long delays until

Media Player

serverwith audio

filesplay out!

Player

10.22Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 23: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Internet multimedia: Streaming approachg pp

Webbbrowser

Web server(2) Meta file

Media Player

with audiofiles

● Browser gets metafile● Browser launches player, passing metafile● Player contacts server

10.23Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

● Player contacts server● Server streams audio/video to player

Page 24: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming from a streaming serverg g

Web Web server

(1) HTTP request/response forpresentation description file

browser server

(2) presentationdescription file

Media Player

Streaming server

(3) Audio/video filerequested and sent

p

● Allows for non-HTTP protocol between server and media player● UDP or TCP for step (3)

10.24Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 25: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming Multimedia: Client Bufferingg g

t t bit constant bit rate video

transmissionclient video

receptionconstant bit

rate video

variablenetwork

d l

playout at client

ered

eodelay

buff

evi

d

timeclient playoutdelay

● Client-side buffering, play out delay compensate for network-added delay, delay jitter

10.25Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 26: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming Multimedia: Client Bufferingg g

Variable fill Constant

Client buffer

Variable fillrate = x(t)

Constantdrain rate = d To

decompression and playout

Fromnetwork

Bufferedvideovideo

● Client-side buffering, play out delay compensate for network-added delay, delay jitter

10.26Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 27: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming Multimedia: UDP or TCP?g

● UDP ● Server sends at rate appropriate for client (oblivious to network congestion !)● Server sends at rate appropriate for client (oblivious to network congestion !)● Often send rate = encoding rate = constant rate

Fill rate = constant rate - packet loss

Sh t l t d l (2 5 d ) t t k jitt● Short play out delay (2-5 seconds) to remove network jitter● Error recover: time permitting

● TCP● Send at maximum possible rate under TCP● Fill rate fluctuates due to TCP congestion control● Larger play out delay: smooth TCP delivery rate●HTTP/TCP passes more easily through firewalls●HTTP/TCP passes more easily through firewalls

10.27Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 28: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming Multimedia: Client rate(s)g ( )

1.5 Mbps encoding

28.8 Kbps encoding

● Q: How to handle different client receive rate capabilities?● 28 8 Kbps dialup● 28.8 Kbps dialup● 100 Mbps Ethernet

● A: Server stores, transmits multiple copies of video, encoded at different

10.28

, p p ,rates

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 29: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Streaming stored audio and videoRTSPStreaming stored audio and video

10.29Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 30: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

User Control of Streaming Media: RTSP g

● HTTP●Does not target multimedia content

● What it does not do:●Does not define compression●Does not target multimedia content

●No commands for fast forward, etc.●Does not define compression

schemes●Does not define how audio/video is

encapsulated for streaming over● RTSP: RFC2326● Client-server application layer

protocol

encapsulated for streaming over network

●Does not restrict how streamed media is transported (UDP or TCPprotocol

●User control ● rewind

f t f d

media is transported (UDP or TCP possible)

●Does not specify how media player b ff di / id● fast forward

● pause, resume● repositioning, etc.

buffers audio/video

10.30Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 31: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTSP: Out of band control

● FTP uses an “out-of-band” control channel:

● RTSP messages also sent out-of-band:

● File transferred over one TCP connection.

● Control info (directory changes file

● RTSP control messages use different port numbers than media stream: out-of-band● Control info (directory changes, file

deletion, rename) sent over separate TCP connection“O t f b d” “i b d” h l

stream: out of band● Port 554

●Media stream is considered “in-band”● “Out-of-band”, “in-band” channels

use different port numbersband”

10.31Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 32: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTSP Examplep

● Scenario:●Metafile communicated to web browser●Metafile communicated to web browser● Browser launches player● Player sets up an RTSP control connection, data connection to streaming server

● Metafile example

<title>Twister</title> <session> <session>

<group language=en lipsync><switch>

<track type=audio e="PCMU/8000/1" 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"> src= rtsp://audio.example.com/twister/audio.en/hifi >

</switch> <track type="video/jpeg“ src="rtsp://video.example.com/twister/video">

</group></session>

10.32Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

</session>

Page 33: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTSP Operationp

WebWeb

serverHTTP Get

browser

St i

Presentation description file

SetupMedia Player

Streaming server

Setup

Play

Media stream

Pause

Teardown

10.33Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 34: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTSP Exchange Exampleg p

C: SETUP rtsp://audio.example.com/twister/audio RTSP/1.0 Transport: rtp/udp; compression; port=3056; mode=PLAY

S: RTSP/1.0 200 1 OK Session 4231

Difference to HTTPRTSP tracks session andstate of the client

C: PLAY rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Session: 4231 R t 0Range: npt=0-

C: PAUSE rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 S i 4231Session: 4231 Range: npt=37

C TEARDOWN t // di l /t i t / di /l fi RTSP/1 0C: TEARDOWN rtsp://audio.example.com/twister/audio.en/lofi RTSP/1.0 Session: 4231

S 200 3 OK

10.34

S: 200 3 OK

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 35: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Making the best out of best-effort serviceMaking the best out of best effort service

10.35Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 36: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Interactive Multimedia: Internet Phone

● Look at a PC-2-PC Internet phone example in detail● Speaker’s audio: alternating talk spurts and silent periods● Speaker s audio: alternating talk spurts and silent periods● 64 kbps during talk spurt● Packets generated only during talk spurts

20 msec chunks at 8000bytes/sec 1 chunk 160 bytes data● 20 msec chunks at 8000bytes/sec 1 chunk = 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

Talk Silence

Ti

10.36Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Time

Page 37: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Internet Phone: Packet Loss and Delayy

● Network loss: IP datagram lost due to network congestion ● Router buffer overflow● Router buffer overflow

● Delay loss: IP datagram arrives too late for play out at receiver●Delays: ● Processing ● Queuing in network ● End-system (sender, receiver) delaysy ( , ) y

● Typical maximum tolerable delay: 400 ms

● Loss tolerance D di i di l l d k l b 1%●Depending on voice encoding, losses concealed, packet loss rates between 1% and 10% can be tolerated

10.37Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 38: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Delay Jittery

constant bit rate client constant bit transmission

variable

cl entreception

constant bit rate playout

at clientar a

networkdelay

(jitter) buff

ered

data

timeclient playoutl

C id d t d d l f t ti k t diff

delay

● Consider end-to-end delays of two consecutive packets: difference can be more or less than 20 msec (transmission time difference)

10.38Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 39: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Internet Phone: Fixed Playout Delayy y

● Receiver attempts to play out each chunk exactly q msecs after chunk was generated.g●Chunk has time stamp t: play out chunk at t+q●Chunk arrives after t+q: data arrives too late for play out, data “lost”

● Tradeoff in choosing q:●Large q: less packet loss

Small : better interactive experience●Small q: better interactive experience

10.39Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 40: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Fixed Playout Delayy y

● Sender generates packets every 20 msec during talk spurt

● First packet received at time rFirst packet received at time r● First playout schedule: begins at p● Second playout schedule: begins at p’

packets

packetsgenerated

loss

packetsreceived playout schedule

p' - r

playout schedulep - r

time

p - r

10.40Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

rp p'

Page 41: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Adaptive Playout Delay (1)p y y ( )

● Goal: minimize playout delay, keeping late loss rate low● Approach: adaptive playout delay adjustment:● 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

packetith theof timestampti =

acketpithfordelaynetworktrreceiverat played is ipacket timethep

receiverby received is ipacket timether

i

i

==

packetith receivingafter delay network average of estimatedacketpith for delay network tr

i

ii

==−

● Dynamic estimate of average delay at receiver:● where u is a fixed constant (e.g., u = 0.01).

)()1( 1 iiii trudud −+−= −

10.41

( g , )

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 42: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Adaptive playout delay (2)p p y y ( )

Also useful to estimate average deviation of delay, vi :

||)1( 1 iiiii dtruvuv −−+−= −

Estimates d v calculated for every received packetEstimates di , vi calculated for every received packet (but used only at start of talk spurt

For first packet in talk spurt playout time is:For first packet in talk spurt, playout time is:

iiii Kvdtp ++=Where K is positive constantWhere K is positive constant

Remaining packets in talkspurt are played out periodically

10.42Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 43: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Adaptive Playout (3)p y ( )

● Q: How does receiver determine whether packet is first in a talkspurt?

● If no loss, receiver looks at successive timestamps.●Difference of successive stamps > 20 msec talk spurt begins.

● With loss possible, receiver must look at both time stamps and sequence numbersnumbers.●Difference of successive stamps > 20 msec and

sequence numbers without gaps talk spurt begins.

10.43Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 44: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Making the best out of best effort serviceRecovery from packet lossMaking the best out of best effort service

10.44Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 45: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Recovery from packet loss (1)y p ( )

● Forward Error Correction (FEC): simple scheme

● Playout delay: enough time to receive all n+1 packetsp

● For every group of n chunks create redundant chunk by exclusive or-ing n original chunks

● Tradeoff: ● Increase n, less bandwidth waste

● Increase n longer playout delaying n original chunks● Send out n+1 chunks, increasing

bandwidth by factor 1/n.C t t i i l h k if

● Increase n, longer playout delay

● Increase n, higher probability that 2 or more chunks will be lost

● Can reconstruct original n chunks if at most one lost chunk from n+1chunks

10.45Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 46: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Recovery from packet loss (2)y p ( )

2nd FEC scheme“Pi b k l“Piggyback lower quality stream” send lower resolutionaudio stream as redundant informationE.G., Nominal ,stream PCM at 64 kbpsand redundant streamGSM at 13 kbps.GSM at 13 kbps.

Whenever there is non-consecutive loss,Whenever there is non consecutive loss, receiver can conceal the loss. Can also append (n-1)st and (n-2)nd low-bit ratechunk

10.46Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

chunk

Page 47: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Recovery from packet loss (3)y p ( )

InterleavingInterleaving● Chunks divided into smaller units● For example, four 5 msec units per

● If packet lost, still have most of every chunkNo ed ndanc o e head b tchunk

● Packet contains small units from different chunks

●No redundancy overhead, but increases playout delay

10.47Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 48: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Making the best out of best-effort-serviceContent distribution networks (CDN)Making the best out of best effort service

10.48Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 49: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Content distribution networks (CDNs)( )

● Content replication● Challenging to stream large files

Origin server in North America● Challenging to stream large files

(e.g., Video) from single origin server in real time

● Solution: replicate content at● Solution: replicate content at hundreds of servers throughout internet● Content downloaded to CDN servers

CDN distribution node● Content downloaded to CDN servers

ahead of time● Placing content “close” to user avoids

impairments (loss delay) of sendingimpairments (loss, delay) of sending content over long paths

● CDN server typically in edge/access network

CDN serverin S. America

CDN serverin Europe

CDN serverin Asia

10.49Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

in S. America p

Page 50: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Content distribution networks (CDNs)( )

● Content replication● CDN (e.g., Akamai) customer is the

Origin server in North America● CDN (e.g., Akamai) customer is the

content provider (e.g., CNN)● CDN replicates customers’ content

in CDN serversin CDN servers. ●when provider updates content,

CDN updates servers CDN distribution node

CDN serverin S. America

CDN serverin Europe

CDN serverin Asia

10.50Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

in S. America p

Page 51: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

CDN examplep

● Origin server (www.foo.com)●Distributes HTML

● CDN company (cdn.com)●Distributes gif files●Distributes HTML

● Replaces:http://www.foo.com/sports.ruth.gifwith

●Distributes gif files●Uses its authoritative DNS server to

route redirect requestswith http://www.cdn.com/www.foo.com/sports/ruth.gif

HTTP request for www.foo.com/sports/sports.html

DNS query for1

origin server

DNS query forwww.cdn.com2

CDN’s authoritative DNS serverClient

HTTP request for www cdn com/www foo com/sports/ruth gif

3S se e

10.51Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

www.cdn.com/www.foo.com/sports/ruth.gif

CDN server near client

Page 52: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

More about CDNs

● Routing requests● CDN creates a “map”, indicating distances from leaf ISPs and CDN nodes● CDN creates a map , indicating distances from leaf ISPs and CDN nodes●When query arrives at authoritative DNS server:● Server determines ISP from which query originates

U “ ” t d t i b t CDN● Uses “map” to determine best CDN server

● CDN nodes create application-layer overlay network

10.52Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 53: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Summary: Internet Multimedia / Bag of tricksy g

●Use UDP to avoid TCP congestion control (delays) for time-sensitive traffic● Client-side adaptive playout delay: to compensate for delayp p y y p y● Server side matches stream bandwidth to available client-to-server path

bandwidth● Chose among pre encoded stream rates● Chose among pre-encoded stream rates● Dynamic server encoding rate

● Error recovery (on top of UDP)● FEC, interleaving, error concealment● Retransmissions, time permitting

● CDN: bring content closer to clientsg

10.53Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 54: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Protocols for real-time interactive applicationsRTP, RTCP, SIPapplications

10.54Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 55: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Real-Time Protocol (RTP)( )

● RTP specifies packet structure for packets carrying audio and video

● RTP runs in end systems● RTP packets encapsulated in UDPp y g

data● RFC 3550

RTP k id

● RTP packets encapsulated in UDP segments

● Interoperability: if two Internet h li i RTP h● RTP packet provides

● Payload type identification● Packet sequence numbering

phone applications run RTP, then they may be able to work together● Packet sequence numbering

● Time stamping

10.55Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 56: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTP runs on top of UDPp

● RTP libraries provide transport-layer interface that extends UDP: y● Port numbers, IP addresses● Payload type identification

P k b i

ApplicatonRTPUDP

Transport Layer● Packet sequence numbering

● Time-stamping

UDPIP

Data Link

Layer

D LPhysical

10.56Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 57: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTP Examplep

● Consider sending 64 kbps PCM-encoded voice over RTP.

● RTP header indicates type of audio encoding in each packet

● Application collects encoded data in chunks, e.g., every 20 msec 160 bytes

g p● Sender can change encoding

during conference.

● RTP header also containsevery 20 msec = 160 bytes in a chunk.

● Audio chunk + RTP header form

● RTP header also contains sequence numbers, timestamps.

RTP packet, which is encapsulated in UDP segment

10.57Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 58: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTP and QoSQ

● RTP does not provide any mechanism to ensure timely data delivery or other QoS guarantees. Q g

● RTP encapsulation is only seen at end systems (not) by intermediate routers.

R t idi b t ff t i ki i l ff t t th t RTP● Routers providing best-effort service, making no special effort to ensure that RTP packets arrive at destination in timely matter.

10.58Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 59: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTP Header

● Payload Type (7 bits): Indicates type of encoding currently being used. If sender changes encoding in middle of conference, sender g g ,

● informs receiver via payload type field. ● Payload type 0: PCM µ-law, 64 kbps● Payload type 3: GSM, 13 kbps● Payload type 7: LPC, 2.4 kbps● Payload type 26: Motion JPEG● Payload type 26: Motion JPEG● Payload type 31: H.261● Payload type 33: MPEG2 video

● Sequence Number (16 bits): Increments by one for each RTP packet ● sent, and may be used to detect packet loss and to restore packet ● sequence● sequence.

Payload Type Sequence Number Timestamp Synchronization

Source IdentifierMiscellaneous

Fields

10.59Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

RTP Header

Page 60: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTP Header (2)( )

● Timestamp field (32 bits long): sampling instant of first byte in this RTP data packetp● For audio, timestamp clock typically increments by one for each sampling period

(for example, each 125 usecs for 8 KHz sampling clock) ● If application generates chunks of 160 encoded samples then timestamp● If application generates chunks of 160 encoded samples, then timestamp

increases by 160 for each RTP packet when source is active. Timestamp clock continues to increase at constant rate when source is inactive.

● SSRC field (32 bits long): identifies source of the RTP stream. Each stream in RTP session should have distinct SSRC.

10.60Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 61: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Real-Time Control Protocol (RTCP)( )

● Works in conjunction with RTP. ● Each participant in RTP session

● Feedback can be used to control performance● Each participant in RTP session

periodically transmits RTCP control packets to all other participants

p● Sender may modify its

transmissions based on feedback

participants. ● Each RTCP packet contains

sender and/or receiver reports● Report statistics useful to

application●Number of packets sent●Number of packets sent●Number of packets lost● Interarrival jitter● etc.

10.61Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 62: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTCP - Continued

● Each RTP session: typically a single multicast address g● All RTP/RTCP packets belonging to

session use multicast address.

● RTP and RTCP packets are

RTP

RTCP● RTP and RTCP packets are distinguished from each other via distinct port numbers

● To limit traffic, each participant reduces RTCP traffic as number of conference participants

Internet

of conference participants increases RTCP RTCP

10.62Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 63: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTCP Packets

● Receiver report packets:● Fraction of packets lost,

● Source description packets: ● E-mail address of sender● Fraction of packets lost,

● Last sequence number ● Average interarrival jitter

● E mail address of sender● Sender's name● SSRC of associated RTP stream

● Sender report packets: ● SSRC of RTP stream● Current time

● Provide mapping between the SSRC and the user/host name

● Current time●Number of packets sent●Number of bytes sent

10.63Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 64: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Synchronization of Streamsy

● RTCP can synchronize different media streams within a RTP

● Each RTCP sender-report packet contains (for most recently

session ● Consider videoconferencing app

for which each sender generates

( ygenerated packet in associated RTP stream):● Timestamp of RTP packetfor which each sender generates

one RTP stream for video, one for audio.

● Timestamp of RTP packet ●Wall-clock time for when packet

was created.

● Timestamps in RTP packets tied to the video, audio sampling clocks

● Receivers uses association to synchronize playout of audio, video clocks

● not tied to wall-clock time

10.64Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 65: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RTCP Bandwidth Scalingg

● RTCP attempts to limit its traffic to 5% of session bandwidth.

● 75 kbps is equally shared among receivers:

● Example ● Suppose one sender, sending video

t 2 Mbp Then RTCP ttempt to

●With R receivers, each receiver gets to send RTCP traffic at 75/R kbpsat 2 Mbps. Then RTCP attempts to

limit its traffic to 100 Kbps. ● RTCP gives 75% of rate to

kbps.

● Sender gets to send RTCP traffic at 25 kbps.

receivers; remaining 25% to sender ● Participant determines RTCP packet transmission period by calculating avg RTCP packet size g g p(across entire session) and dividing by allocated rate

10.65Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 66: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Protocols for real-time interactive applicationsSession Initiation Protocol (SIP)applications

10.66Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 67: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

SIP: Session Initiation Protocol [RFC 3261][ ]

● SIP long-term vision:● All telephone calls, video conference calls take place over Internet● All telephone calls, video conference calls take place over Internet● People are identified by names or e-mail addresses, rather than by phone

numbersY h ll tt h ll tt h t IP d i● You can reach callee, no matter where callee roams, no matter what IP device callee is currently using

10.67Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 68: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

SIP Services

● Setting up a call, SIP provides mechanisms ..

● Determine current IP address of callee:

● For caller to let callee know she wants to establish a call

● So caller and callee can agree on

●Maps mnemonic identifier to current IP address

● Call management:● So caller and callee can agree on media type, encoding

● To end call

● Call management:● Add new media streams during call● Change encoding during callg g g● Invite others ● Transfer, hold calls

10.68Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 69: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Setting up a call to known IP addressg p

● Alice’s SIP invite message indicates her port number, IP

Alice Bob

p ,address, encoding she prefers to receive (PCM µlaw)

● Bob’s 200 OK message indicates

167.180.112.24 193.64.210.89INVITE [email protected]=IN IP4 167.180.112.24m=audio 38060 RTP/AVP 0● Bob s 200 OK message indicates

his port number, IP address, preferred encoding (GSM)

Bob'sterminal rings

port 5060

0port 5060

200 OKc=IN IP4 193.64.210.89

m=audio 48753 RTP/AVP 3

● SIP messages can be sent over TCP or UDP; here sent over RTP/UDP. μ Law audio

ACKport 5060

RTP/UDP.● Default SIP port number is 5060.

port 38060

GSMport 48753

time time

10.69Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 70: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Setting up a call (more)g p ( )

● Codec negotiation:● Suppose bob doesn’t have PCM

● Rejecting a call● Bob can reject with replies● Suppose bob doesn t have PCM

µlaw encoder. ● Bob will instead reply with 606 not

acceptable reply listing his

● Bob can reject with replies ● “busy” ● “gone”

“payment required”acceptable reply, listing his encoders Alice can then send new invite message, advertising different encoder

● “payment required” ● “forbidden”

● Media can be sent over RTP or different encodersome other protocol

10.70Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 71: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Example of SIP message

INVITE sip:[email protected] SIP/2.0Vi SIP/2 0/UDP 167 180 112 24

p g

Here we don’t know Bob’s IP address. I t di t SIPVia: SIP/2.0/UDP 167.180.112.24

From: sip:[email protected]: sip:[email protected]: [email protected]

Intermediate SIPservers needed.

Alice sends receivesCall ID: [email protected]: application/sdpContent-Length: 885

Alice sends, receives SIP messages using SIP default port 506

c=IN IP4 167.180.112.24m=audio 38060 RTP/AVP 0

Alice specifies in Via:header that SIP client aud o 38060 / 0

Notes:

sends, receives SIP messages over UDP

● HTTP message syntax● SDP = session description protocol

C ll ID i i f ll

10.71Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

● Call-ID is unique for every call.

Page 72: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Name translation and user locataion

● Caller wants to call callee, but only has callee’s name or e-mail

● Result can be based on:● Time of day (work, home)y

address.● Need to get IP address of callee’s

current host:

● Time of day (work, home)● Caller (don’t want boss to call you

at home)St t f ll ( ll t tcurrent host:

●User moves around●DHCP protocol

● Status of callee (calls sent to voicemail when callee is already talking to someone)p

●User has different IP devices (PC, PDA, car device)

● Service provided by SIP servers:● SIP registrar server● SIP proxy server● SIP proxy server

10.72Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 73: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

SIP Registrarg

When Bob starts SIP client, client sends SIP REGISTER t B b’ i tmessage to Bob’s registrar server

(similar function needed by Instant Messaging)

Register Message:

REGISTER sip:domain.com SIP/2.0Via: SIP/2.0/UDP 193.64.210.89 From: sip:[email protected]: sip:[email protected]: 3600

10.73Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 74: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

SIP Proxyy

● Alice sends invite message to her proxy server● Contains address sip:[email protected]● Contains address sip:[email protected]

● Proxy responsible for routing SIP messages to callee● Possibly through multiple proxies.

● Callee sends response back through the same set of proxies.● Proxy returns sip response message to alice

Contains bob’s ip address● Contains bob’s ip address

● Proxy analogous to local DNS server

10.74Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 75: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Examplep

Caller [email protected] with places a

SIP registrarupenn.edu

call to [email protected]

(1) Jim sends INVITES

SIP proxyumass.edu

SIPregistrareurecom.fr

2

3 4message to umass SIPproxy. (2) Proxy forwardsrequest to upenn

i t

1 57

8registrar server. (3) upenn server returnsredirect response,indicating that it should

SIP client

68

9

indicating that it should try [email protected]

(4) umass proxy sends INVITE to eurecom registrar. (5) eurecom registrar forwards

SIP client217.123.56.89

197.87.54.21

( ) p y g ( ) gINVITE to 197.87.54.21, which is running keith’s SIP client. (6-8) SIP response sent back (9) media sent directly between clients.

10.75Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Note: also a SIP ack message, which is not shown.

Page 76: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Protocols for real-time interactive applicationsH.323applications

10.76Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 77: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Alternative to SIP: H.323

10.77Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 78: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Alternative to SIP: H.323

10.78Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 79: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Comparison: SIP vs. H.323p

● H.323 is another signaling protocol for real-time, interactive

● H.323 comes from the ITU (telephony)p ,

● H.323 is a complete, vertically integrated suite of protocols for multimedia conferencing:

( p y)● SIP comes from IETF: ● Borrows much of its concepts from

HTTPmultimedia conferencing: ● Signaling ● Registration

HTTP● SIP has Web flavor, whereas H.323

has telephony flavor g● Admission control ● Transport

C d

● SIP uses the KISS principle ● Keep it simple stupid.

● Codecs

● SIP is a single component ●Works with RTP, but does not ,

mandate it ● Can be combined with other

protocols services

10.79

protocols, services

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 80: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Providing multiple classes of serviceProviding multiple classes of service

10.80Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 81: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Providing Multiple Classes of Serviceg p

● Thus far: making the best of best effort service●One-size fits all service model●One size fits all service model

● Alternative: multiple classes of service● Partition traffic into classes●Network treats different classes of traffic differently● Analogy: VIP service vs regular service

●Granularity: differential service among multiple classes, not among individual connectionsHi t TOS bit●History: TOS bits

0111

10.81Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 82: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Multiple classes of service: Scenariop

R1 R2H1 H3

R2

H2H4

1.5 Mbps linkR1 output interfaceinterface queue

10.82Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 83: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Scenario 1: mixed FTP and audio

● Example: 1Mbps IP phone and FTP share 1.5 Mbps link●Bursts of FTP can congest router cause audio loss●Bursts of FTP can congest router cause audio loss●Want to give priority to audio over FTP

R1 R2

Principle 1Packet marking needed for router to distinguish between different classes; and new router policy to treat packets accordingly

10.83Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

to treat packets accordingly

Page 84: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Principles for QOS Guarantees (more)p Q ( )

● What if applications misbehave (audio sends higher than declared rate)●Policing: force source adherence to bandwidth allocations●Policing: force source adherence to bandwidth allocations

● Marking and policing at network edge:●Similar to ATM UNI (user network interface)

R11 Mbps phone R1 R2

1 5 Mbps link

p

1.5 Mbps link

packet marking and policing

Provide protection (isolation) for one class from othersPrinciple 2

10.84Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Provide protection (isolation) for one class from others

Page 85: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Principles for QOS Guarantees (more)p Q ( )

● Allocating fixed (non-sharable) bandwidth to flow: inefficient use of bandwidth if flows does not use its allocation

1 Mbps 1 Mbps logical linkR1

R2

pphone

1.5 Mbps link

0 5 Mbps logical link

Principle 3

0.5 Mbps logical link

While providing isolation, it is desirable to use resources as efficiently as possible

Principle 3

10.85Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

resources as efficiently as possible

Page 86: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Providing multiple classes of serviceScheduling and Policing MechanismsProviding multiple classes of service

10.86Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 87: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Scheduling and Policing Mechanismsg g

● Scheduling: choose next packet to send on link● FIFO (first in first out) scheduling: send in order of arrival to queue● 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

10.87Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 88: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Scheduling Policies: Priority basedg y

Priority scheduling: transmit highest priority queued packet ● multiple classes with different priorities● multiple classes with different priorities●Class may depend on marking or other header info, e.g. IP source/dest,

port numbers, etc..●Real world example?

10.88Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 89: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Scheduling Policies: Round Robing

● Round robin scheduling:●Multiple classes●Multiple classes● Cyclically scan class queues, serving one from each class (if available)● Real world example?

10.89Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 90: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Scheduling Policies: Still moreg

● Weighted fair queuing: ●Generalized round robin●Generalized round robin● Each class gets weighted amount of service in each cycle● Real-world example?

10.90Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 91: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Policing Mechanismsg

● Goal: Limit traffic to not exceed declared parameters

● Three common-used criteria: ● Average Rate: how many packets can be sent per unit time (in the long run)● Long term criteria● Crucial question: what is the interval length:

100 packets per sec or 6000 packets per min have same average!

● Peak Rate: e.g., 6000 packets per min. (ppm) avg.; 1500 ppm peak rate● Burst Size: max. number of packets sent consecutively (with no intervening idle)

10.91Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 92: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Policing Mechanismsg

● Token Bucket: Limit input to specified Burst Size and Average Rate.

● Bucket can hold b tokens● Tokens generated at rate r token/sec unless bucket full●Over interval of length t: number of packets admitted less than or equal to

(r t + b)

10.92

(r t + b)

Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 93: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Policing Mechanisms (more)g ( )

● Token bucket, WFQ combine to provide guaranteed upper bound on delay, i.e., QoS guarantee!, Q g

token rate, rarrivingtraffic

bucket size, bper-flow

t RWFQ

rate, R

D = b/Rmax

10.93Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 94: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Providing multiple classes of serviceDifferentiated ServicesProviding multiple classes of service

10.94Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 95: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

IETF Differentiated Services

● Want “qualitative” service classes● “Behaves like a wire”● Behaves like a wire● Relative service distinction: platinum, gold, silver

● Scalability: simple functions in network core, relatively complex functions d ( h )at edge routers (or hosts)

● Signaling●Maintaining per-flow router state●Maintaining per flow router state ●Difficult with large number of flows

● Do not define service classes, provide functional components to build i lservice classes

10.95Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 96: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Diffserv Architecture

● Edge router:● Per-flow traffic management h d lmarking● Per flow traffic management●Marks packets as in-profile and out-

profile

schedulingr

b

marking

● Core router:● Per class traffic management

...b

● Per class traffic management● Buffering and scheduling based on

marking at edgeP f i t i fil● Preference given to in-profile packets

10.96Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 97: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Edge-router Packet Marking g g

● Profile: pre-negotiated rate A, bucket size B● Packet marking at edge based on per-flow profile● Packet marking at edge based on per flow profile

Rate A

B

User packets

● Possible usage of marking:● Class-based marking: packets of different classes marked differentlyg p y● Intra-class marking: conforming portion of flow marked differently than non-

conforming one

10.97Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 98: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

QoS in the Internet: Differentiated ServicesQ

● Class-based approach (Differentiated Services, DiffServ): do without guarantees, only manage aggregated data streams

● Thus, the complexity in routers is shifted “at the edge” of the network, internal network routers can be kept simpler.

● Divide the network into domains. A domain is a part of the entire network, p ,which supports DiffServ. It consists of access routers for the domain (Ingress routers, yellow) and internal routers (core routers, blue).

● The domain defines service classes, ,each data flow is assigned to such aclass. With coming into the domain (at a Ingress Router), each packet is assigned a class,and in the network the forwarding bases on the class parameters ( h b h i )(per-hop behavior). Looking only at the aggregated dataflows, a better scalability as forIntServ is achieved

10.98

IntServ is achieved.

Page 99: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Application of DiffServ with IPpp

● Use of the Type of Service field in IPv4 for the classification (DSCP –Differentiated Service Code Point). The DSCP value defines the per-hop ) p pbehavior of the packet from one router to the next one.

Type ofVersion Total LengthIHL

Identification Fragment OffsetDF

MF

Type ofService

Prece-d D T R free

Source Address

ProtocolTime to Live Header Checksumdence D T R free

Source Address

Destination AddressDSCP free

The code point defines the transmission class, which informs a router, how it

10.99

has to treat the packet in forwarding.

Page 100: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Classification and Conditioningg

● Packet is marked in the Type of Service (TOS) in IPv4, and Traffic Class in IPv6

● 6 bits used for Differentiated Service Code Point (DSCP) and determine PHB that the packet will receive2 bi l d● 2 bits are currently unused

10.100Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 101: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Service Classes

● For DiffServ, amongst others the following classes (for specifying transmission behavior) are defined at the moment:)●Default Forwarding realizes the usual Best Effort transmission● Expedited Forwarding tries to emulate a rented line

A d F di i i i d di di b bili i d h● Assured Forwarding uses priorities and discarding probabilities used when an overload of a router is given

DSCP free

10.101

Page 102: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Expedited Forwardingp g

● Idea with Expedited Forwarding:● there are “regular” and “expedited” packets. Expedited packets are passed on in● there are regular and expedited packets. Expedited packets are passed on in

such a way, as if there would be no or only little further traffic. A minimum data transmission rate is guaranteed.

● Routers can manage two separated queues for these packet types (Weighted● Routers can manage two separated queues for these packet types (Weighted Fair Queuing).

● Possible: low loss rate/delay/jitter as well as a guaranteed data transmission rate

10.102

Page 103: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Assured Forwardingg

● Improves differentiation: Definition of four priority classes with own resources (at the moment; there also is room for more classes)( ; )

● For each class, three probabilities for discarding a packet are defined: low, medium, highTh l h 12 diff i l● Thus: altogether 12 different service classes

● Principle:● The priority class determines the portion of the transmission capacity of the● The priority class determines the portion of the transmission capacity of the

routers●During high load packets of lower priority would be discarded completely

F i k t f h i it l h ld h h t i● Fairness: packets of each priority class should have chances to survive● Therefore definition of the probabilities for each class: by suitable selection of

the probabilities, a small part of the lowest priority level still is still forwarded, while packets of higher priority classes are already discarded.

10.103

Page 104: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Assured Forwardingg

l f f h 1. Classification of the packets in service classes

2. Appropriate choice of 4. Weighted Fair Queuing in accordance to priority

pp pDSCP tags

3 Bring the data streams in a form according to their flow

accordance to priority classes

3. Bring the data streams in a form according to their flow specification. Exceeding the specifications leads to discarding data. If thereafter still too much data are present, discarding of packets in accordance with their

10.104

p , g pprobability

Page 105: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Classification and Conditioningg

● May be desirable to limit traffic injection rate of some class:●User declares traffic profile (e.g., Rate, burst size)●User declares traffic profile (e.g., Rate, burst size)● Traffic metered, shaped if non-conforming

10.105Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 106: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Forwarding (PHB)g ( )

● Per hop behavior (PHB) result in a different observable (measurable) forwarding performance behaviorg p

● PHB does not specify what mechanisms to use to ensure required PHB performance behaviorE l● Examples: ● Class A gets x% of outgoing link bandwidth over time intervals of a specified

lengthg● Class A packets leave first before packets from class B

10.106Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 107: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Forwarding (PHB)g ( )

PHBs being developed:● Expedited Forwarding: pkt departure rate of a class equals or exceeds● 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● each with three drop preference partitions

10.107Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 108: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Providing QoS guaranteesProviding QoS guarantees

10.108Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 109: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Principles for QOS Guarantees (more)p Q ( )

● Basic fact of life: can not support traffic demands beyond link capacityp y

R1R2

1 Mbps phone

1.5 Mbps link1 Mbps phone

Principle 4

phone

Call Admission: flow declares its needs, network may block call (e g busy signal) if it cannot meet needs

Principle 4

10.109Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

block call (e.g., busy signal) if it cannot meet needs

Page 110: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

QoS guarantee scenarioQ g

● Resource reservation●call setup, signaling (RSVP)● traffic, QoS declaration

per element admission control●per-element admission control

request/

QoS-sensitive

request/reply

QoS-sensitive scheduling (e.g.,

WFQ)

10.110Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 111: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

IETF Integrated Servicesg

● Architecture for providing QoS guarantees in IP networks for individual application sessionspp

● Resource reservation: routers maintain state info (a la VC) of allocated resources, QoS req’sAd i /d ll● Admit/deny new call setup requests:

Question: can newly arriving flow be admittedwith performance guarantees while not violatedwith performance guarantees while not violatedQoS guarantees made to already admitted flows?

10.111Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 112: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Call Admission

● Arriving session must:●Declare its QoS requirement●Declare its QoS requirement● R-spec: defines the QoS being requested

● Characterize traffic it will send into network T d fi t ffi h t i ti● T-spec: defines traffic characteristics

● Signaling protocol: needed to carry R-spec and T-spec to routers (where reservation is required)● RSVP

10.112Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 113: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Intserv QoS: Service models [RFC2211, RFC 2212]Q [ , ]

● Guaranteed service:●Worst case traffic arrival: leaky-

● Controlled load service:● "a quality of service closely●Worst case traffic arrival: leaky

bucket-policed source ● Simple (mathematically provable)

bound on delay [Parekh 1992 Cruz

● a quality of service closely approximating the QoS that same flow would receive from an unloaded network element."bound on delay [Parekh 1992, Cruz

1988]unloaded network element.

token rate, rarrivingtraffic

bucket size, bper-flow

t RWFQ

rate, R

10.113Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

D = b/Rmax

Page 114: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Signaling in the Internetg g

t kconnectionless (stateless) forwarding

by IP routersbest effort

service

no network signaling protocolsin initial IP design+ =

●New requirement: reserve resources along end-to-end path (end system, routers) for QoS for multimedia applications) Q pp

● RSVP: Resource Reservation Protocol [RFC 2205]● “ … allow users to communicate requirements to network in robust and efficient way.”

i e signaling !i.e., signaling !

● earlier Internet Signaling protocol: ST-II [RFC 1819]

10.114Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 115: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RSVP Design Goalsg

1. Accommodate heterogeneous receivers (different bandwidth along paths)p )

2. Accommodate different applications with different resource requirements

3 M k l i fi l i i h d i l i3. Make multicast a first class service, with adaptation to multicast group membership

4. Leverage existing multicast/unicast routing, with adaptation to4. Leverage existing multicast/unicast routing, with adaptation to changes in underlying unicast, multicast routes

5. Control protocol overhead to grow (at worst) linear in # receivers66. Modular design for heterogeneous underlying technologies

10.115Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 116: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RSVP: does not…

● Specify how resources are to be reserved● Rather: a mechanism for communicating needs● Rather: a mechanism for communicating needs

● Determine routes packets will take● That’s the job of routing protocols● Signaling decoupled from routing

● Interact with forwarding of packets● Separation of control (signaling) and data (forwarding) planes● Separation of control (signaling) and data (forwarding) planes

10.116Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 117: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

RSVP: Overview of operationp

● Senders, receiver join a multicast group●Done outside of RSVP●Done outside of RSVP● Senders need not join group

● Sender-to-network signaling● Path message: make sender presence known to routers● Path teardown: delete sender’s path state from routers

● Receiver-to-network signaling● Receiver-to-network signaling● Reservation message: reserve resources from sender(s) to receiver● Reservation teardown: remove receiver reservations

● Network-to-end-system signaling● Path error

Reservation error● Reservation error

10.117Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking

Page 118: Telematics Chapter 10: Multimedia Networking pg · Prof. Dr. Mesut Güneş cst.mi.fu-berlin.de Telematics Chapter 10: Multimedia Networking 10.24. Streaminggg Multimedia: Client Buffering

Summaryy

● Principles● Classify multimedia applications● Classify multimedia applications● Identify network services applications need●Making the best of best effort service

● Protocols and architectures ● Specific protocols for best-effort●Mechanisms for providing qos●Mechanisms for providing qos● Architectures for qos● Multiple classes of service● QoS guarantees, admission control

10.118Prof. Dr. Mesut Güneş ▪ cst.mi.fu-berlin.de ▪ Telematics ▪ Chapter 10: Multimedia Networking