41
Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Embed Size (px)

Citation preview

Page 1: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Computer Networks:Multimedia Applications

Ivan Marsic

Rutgers University

Chapter 3 – Multimedia & Real-time Applications

Page 2: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Multimedia & Real-time Applications

Chapter 3

Page 3: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Topic:Traffic Sources & Models

Source CodingTraffic TypesTraffic Models

Birth and Death Processes

Page 4: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Source Coding vs. Channel Coding

Beans(Redundancy = pods)

Beans(No redundancy)

Beans(No redundancy)

Beans(Redundancy = can)

ErroneousCommunication Channel

Source Coding Channel Coding Decoding

Page 5: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Signal Digitalization

Source Coding – a simple example

Page 6: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Speech Signal Digitalization

Time (sec)0.007

0.4

0

0.4

Analog speech waveform Sampled signal Sampled & quantized signal

Am

plitu

de

Source Coding – also involves data compression (may be lossy)

Page 7: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

What is a Traffic Source

includes signal-processinghardware and software

Traffic Source

Network

signals

Arriving traffic(packets)

from another source

Page 8: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Traffic Model for Voice Source

CallIdle Talk

Page 9: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Birth and Death Processes

Time

Cum

ulat

ive

Num

ber

of a

rriv

als,

A(t

)N

umbe

r of

dep

artu

res,

B(t

)

A(t)

B(t)

N(t)

Time

N(t)

T1

T2

Page 10: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Topic:Delayed Playout for Jitter

Control

Delay

Delay Variation (Jitter)

Jitter Buffer

Page 11: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

How Delay Jitter Arises

8 7 6 5 4 3 2 1

Packets departing sourceSource Receiver

Network

8 6 7 5 3 4 2 1

Packets arriving at receiver

Time when packet departed (ms)

Pac

ket

nu

mb

er

1

0

2

3

5

4

6

7

8

20 40 60 80 100120140160

Pac

ket

nu

mb

er

1

0

2

3

5

4

6

7

8

20 40 60 80 100120140160

Transit delay experienced (ms) Time when packet arrived (ms)

1

0

2

3

5

4

6

7

8

20 40 60 80 100120

1

0

2

3

5

4

6

7

8

20 40 60 80 100120

1

0

2

3

5

4

6

7

8

20 40 60 80 100120140160180 200 220240260

1

0

2

3

5

4

6

7

8

20 40 60 80 100120140160180 200 220240260

(capture) (transport) (playout)

Page 12: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Solution: Delayed PlayoutP

ack

et

num

ber

1

2

3

4

5

6

7

8

Time [ms]0 20 40 60 80 10

012

014

016

018

020

0

Talk starts

First packet sent: t1 = 20 ms

220

240

260

Packetscreatedat source

Packetsarrivedat receiver

Missedplayout

q = 100 ms

Playoutschedule

r1 = 58 p1 = 120

Packet arrives at receiver

86753421

1 2 3 4 5 7 8

Packet removed frombuffer for playout

Time spentin buffer

Missedplayout

Time

Page 13: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Problem & Tradeoff to Make

• How to set the playout delay value?– Problem: Network delays change over time even

for the same endpoints

• Tradeoff:– Prefer to set the playout delay as small as

possible for real-time applications (telephony) because of human psychological characteristics

– But, small playout delay may cause too many packets to miss their playout deadline

• Solution: Adaptive playout delay

Page 14: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Recall from Chapter 2:TCP Retransmission Timer

Calculation

0

Measured RTT value

Occ

urr

ence

fre

qu

ency

of

mea

sure

d R

TT

val

ues

0 1

1

2

2

RTT distribution measuredduring quiet periods

RTT distribution measuredduring peak usage periods

0

TimeoutInterval

Cases for which theRTO timer will expiretoo early

(a)(b)

(c)

Measured RTT value

Page 15: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Play w/ playout delay qi

Adaptive Playout

… speech … silence … speech … silence … speech …

estimate playout delay qi+1

change playout delay qi+1

i

i+1

Problem: Cannot change playout delay during the speech

Solution: Change playout delay during the silence periods

Page 16: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Topic:Multicast Routing

Reverse Path Forwarding (RPF) Algorithm

Spanning Tree Algorithms

Page 17: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Multicast Routing

Unicast(a)

Source3 1.5 Mbps

2 1.5 M

bps

Multicast(b)

Source 1 1.5 Mbps1

1.5 Mbps

Page 18: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Superimposed Shortest Paths = Tree

Source

Receiver i

Router m Router n

Source

Receiver j

Router m Router n

Shortest path (Source Receiver i)

Shortest path (Source Receiver j)

Option (a)

Option (b)

Page 19: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Multicast Example 3.1

R1

R2

R3 R4

R6R7

R5

B

C

D

A

G

FE

R1

R2

R3 R4

R6R7

R5

B

C

D

A

G

FE

Page 20: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Multicast – Solution

R2

R3

R4

R1

R5 R6R7

(a)

(b)

The shortest path multicast tree

R2

R3

R4

R1

R5 R6R7

p1

p2

p3

p3 p3

p2

p1

p1

D

E

F G

B

C

Packet will be forwarded

Packet not forwarded beyond receiving router

Key:

Packet forwarded to end host

Page 21: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Multicast Example

BB CC DD

R3R3

R8R8

R1R1

R2R2

R5R5R7R7

R6R6R4R4

AA

GG

EE

Source

FF

BB CC DD

R3R3

R8R8

R1R1

R2R2

R5R5R7R7

R6R6R4R4

AA

GG

EE

Source

FF

(a)

(b)

The shortest pathmulticast tree

R2

R3

R4

R1

R5

R6

R7

R8

Page 22: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Multicast: CBT Spanning Tree

(a)

R2

R3

R4

R1

R5

R6

R7

R8

CoreB C

D

A

G

E

F

JOIN

JOIN

JOIN

JOIN

R2

R3

R4

R1

R5

R6

R7

R8

CoreB C

D

A

G

E

F

ACK

JOIN

ACK

ACK

ACK

R2

R3

R4

R1

R5

R6

R7

R8

CoreB C

D

A

G

E

F R2

R3

R4

R1

R5

R6

R7

R8

CoreB C

D

A

G

E

F

JOIN

AC

K

JOIN

(b)

(c)

(d)

(a)

R2

R3

R4

R1

R5

R6

R7

R8

CoreB C

D

A

G

E

F

JOIN

JOIN

JOINJOIN

JOINJOIN

JOINJOIN

R2

R3

R4

R1

R5

R6

R7

R8

CoreB C

D

A

G

E

F

ACKACK

JOIN

JOIN

ACKACK

ACKACK

ACKACK

R2

R3

R4

R1

R5

R6

R7

R8

CoreB C

D

A

G

E

F R2

R3

R4

R1

R5

R6

R7

R8

CoreB C

D

A

G

E

F

JOIN

JOIN

AC

KA

CK

JOINJOIN

(b)

(c)

(d)

Page 23: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Data Packet Forwarding in CBT

R2

R3

R4

R1

R5

R6

R7

R8

Core

BC D

A G

E

F

R1 G

(a) (b)

R2

R3

R4

R1

R5

R6

R7

R8

Core

BC D

A G

E

F

G

G

Page 24: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Multicast: Spanning Tree Teardown

Teardown Teardown msgmsgTeardown Teardown msgmsg

R2R2

R5R5R7R7

R6R6R4R4

OLD Core

R2R2

R5R5R7R7

R6R6R4R4

NEW Core

(a) (b)Next hop

(to Core) = R7Next hop

(to Core) = R7

Page 25: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Topic:Differentiated Services

DiffServ Architecture

Page 26: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

DiffServ Architecture

Link Layer Protocol

Network Layer Protocol (IP)

Based on Source-Address and Destination-Address to get corresponding Policy

Check if packet is out of source’s declared profile

Discard bursts

Mark according to policy

Classify based on code point from PHB Table to get the corresponding physical and virtual queue

pre-marked or unmarked packet

Meter

Marker

Classifier

Classifier

Scheduler

Class n queue

Class 1 queue

Random Early Detection (RED) Queues

Policer and Shaper

Page 27: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Topic:Multimedia Protocols

Real-time Transport Protocol (RTP) RTP Control Protocol (RTCP) SIP, SDP, …

Page 28: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

RTP: Real-time Transport Protocol

RTP (Real-timeTransport Protocol)

Layer 2:

Network

Layer 1:

Link

Layer 3:

End-to-End

RTP

UDP

Layer 2:

Internet

Layer 1:

Link

Layer 3:

Transport

TCP/IP protocol suite:

IP

Page 29: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

RTP Header

7-bit payload type 16-bit sequence number

32-bit timestamp

contributing source (CSRC) identifiers (if any)

data

0 15 16 31

32-bit synchronization source (SSRC) identifier

2-bitver.num

12bytes

P

32-bit extension header (if any)

7 8

X4-bit

contrib.src count

M

2 3 4

padding (if any)8-bit pad count

(in bytes)

Page 30: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

RTP Header (2)

• P = padding bit indicates if packet is padded to a required size (e.g., for encryption)

• X = extension bit indicates an extension header; rarely used b/c appl. defines own hdr

• CSRC count = # contributing source IDs in the header, if any

• M = marks packets w/ significant events

• Payload type = payload format indicates encoding scheme used for audio, video, etc.

Page 31: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

RTP Header (3)

• Sequence number = used by receiver for delay jitter removal

• Timestamp = used with seq. num. to detect pkt loss. Also to synchronize packets from different sources. Represents the sampling (creation) time of the 1st byte. Possible that successive packets have the same timestamp. E.g., a single video frame is transmitted in multiple RTP packets.

• SSRC identifier = unique synchronization source ID randomly chosen. Same for all packets from the same src/device. Enables receiver to group packets for playback.

• CSRC identifiers = list of contributing sources for the packet payload. Used when a mixer combines several streams of packets. Allows the receiver to identify the original senders.

Page 32: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

RTCP Header Format

Common sender/receiver REPORT message header:

All report messages have the same 8 byte header» version number (same as RTP)» padding indicator» reception report count (5 bits)» RTCP message type (8 bits)» RTCP message length (16 bits)» SSRC for the sender of this report (32 bits)

Page 33: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Compound RTCP Packet Format

0 15 16 317 82 31

FirstRTCPpacket

IP header

UDP header

RTCP packet type RTCP packet length (in 32-bit words)ver. P reports count

RTCP packet type-specific information

RTCP packet type RTCP packet length (in 32-bit words)ver. P reports count

RTCP packet type-specific information

SecondRTCPpacket

Com

poun

d R

TC

P p

ack

et

Page 34: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Reception Report Blocks

• Each sender and receiver report should contain a reception report block for each synchronization source heard from since the last RTCP report

• Contents:– source identifier for the block (SSRC)– fraction of RTP packets from this source lost since the

last report– cumulative number of lost packets– extended highest sequence number received– estimated average RTP packet interarrival time jitter– last SR timestamp received from this source– delay since receiving the last SR report from this source

Page 35: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

RTCP Receiver Report Format

0 15 16 317 82 31

packet type = ‘201’ packet length (in 32-bit words)

SSRC of this reporter

ver. P reports countheader

cumulative number of packets lost

SSRC_1 (SSRC of first source)

reportblock

1

extended highest sequence number received

interarrival jitter

last SR (LSR)

fraction lost

delay since last SR (DLSR)

report block 2. . .

profile-specific extensions

Page 36: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

RTCP Sender Report Format

0 15 16 317 82 31

cumulative number of packets lost

SSRC_1 (SSRC of first source)

reportblock

1

extended highest sequence number received

interarrival jitter

last SR (LSR)

packet type = ‘200’ packet length (in 32-bit words)

SSRC of this reporter

NTP timestamp, least significant word (seconds fraction)

NTP timestamp, most significant word (seconds)

ver. P reports countheader

senderinfo

RTP timestamp

sender’s packet count

sender’s byte count

fraction lost

delay since last SR (DLSR)

report block 2. . .

profile-specific extensions

Page 37: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Inter-arrival Time Jitter

Sender

Receiver

Perfect delivery Delay jitter

senti senti 1

recvi recvi 1

Page 38: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Example for RTT computation

DLSR= 0x0006:353f ( 6.013 s)LSR = 0xc1fc:3d2f (49660.239 s)

SenderReport (SR)

RTT propagation delay

[31 Dec 1999 23:59:56.239 UTC]ntp_sec = 0xbc17c1fcntp_frac= 0x3d2f1aa0(3155673596.239 s)

A 0xc209:da1c (49673.852 s)DLSR -0x0006:353f ( 6.013 s)LSR -0xc1fc:3d2f (49660.239 s)

RTT delay 0x0007:9999 ( 7.600 s)

[01 Jan 2000 00:00:09.852 UTC]ntp_sec = 0xbc17c209ntp_frac= 0xda1cac08(3155673609.852 s)

ReceiverReport (RR)

Sender SSRC_n

Receiver SSRC_r

processing delay DLSR

ntp_sec = 0xbc17c1fcntp_frac= 0x3d2f1aa0(3155673596.239 s)

16-bit time of RR arrival at sender:

16-bit time of SR departure from sender:

16-bit processing delay at receiver:

round-trip propagation delay:

Page 39: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

Algorithm for RTCP Reporting Interval

(number of senders > 0) AND (# senders < (25% of total # participants))

(average RTCP packet size) (# senders)

0.25 (RTCP bandwidth)

Interval ofSender Reports =

(average RTCP packet size) (# receivers)

0.75 (RTCP bandwidth)

Interval ofReceiver Reports =

This participantsender or receiver

?

[true] [false]

?

[sender] [receiver]

(avg. RTCP pkt. size) (# participants)

RTCP bandwidth

Interval ofReports =

Page 40: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

RTCP Bandwidth Allocation

Page 41: Computer Networks: Multimedia Applications Ivan Marsic Rutgers University Chapter 3 – Multimedia & Real-time Applications

VoIP Phone Call Session

Forward SIP signaling

Forward RTP media

Forward RTCP monitoring

Logical channels between the caller and callee during a VoIP call

Caller CalleeReverse SIP signaling

Reverse RTP media

Reverse RTCP monitoring