Mul$media Networking
#5 Real-‐Time Transport Protocol
Semester Ganjil 2012
Today’s Outline
•
RTP
–
protocol goals
–
mixers and translators
Real-‐Time Protocol (RTP)
•
End-‐to-‐end protocol
for applica$ons
RTP: Big Picture
Media Encapsula$on
RTP RTCP Applica$on
UDP
IPv4/6
Ethernet AAL5 ATM
ST-‐II
data
RTP: Big Picture
•
Real-‐Time Transport Protocol (RTP) = data +
control
•
data:
–
$ming,
–
loss detec$on,
–
content labeling,
–
talk spurts,
–
encryp$on
•
control:
(RTCP)
periodic with
T
∼
popula$on
–
QOS feedback
RTP: Goals
•
lightweight:
specifica$on and implementa$on
•
flexible:
provide mechanism, don’t dictate
algorithms
•
protocol-‐neutral:
UDP/IP,ST-‐II,IPX,ATM-‐AALx,...
•
scalable:
unicast, mul$cast from 2 to O(107)
•
separate control/data:
some func$ons may be
taken over by conference control protocol
•
secure:
support for encryp$on, possibly
RTP runs on top of UDP
Multmedia Networking
•
Applica$on layer protocol
•
RTP libraries provide transport-‐layer interface
that extends UDP:
•
port numbers, IP addresses
•
payload type iden$fica$on
•
packet sequence numbering
•
$me-‐stamping
•
Applica$ons that use RTP are:
•
Less sensi$ve to packet loss
•
Very sensi$ve to packet delays
•
UDP provides key services:
•
Mul$plexing
RTP Func$ons
•
segmenta$on/reassembly done by UDP (or similar)
•
re-‐sequencing (if needed)
•
loss detec$on for quality es$ma$on, recovery
•
intra-‐media synchroniza$on: remove delay jiker
through playout buffer
•
intra-‐media synchroniza$on: driling sampling clocks
•
inter-‐media synchroniza$on (lip sync between audio
and video)
•
quality-‐of-‐service feedback and rate adapta$on
opt.
opt.
opt.
timestamp
sequence number
synchronization source identifier (SSRC) M
contributing source identifiers (CSRC)
RTP header
number type time stamp
Synchronization Source ID
•
*mestamp field (32 bits long):
sampling instant of
number type time stamp
Synchronization Source ID
•
P:
padding (for encryp$on)
➠
last byte has
padding count
•
M:
marker bit; frame, start of talk spurt
➠
delay adjustment
•
CC:
content source count (for mixers)
•
CSRC:
iden$fiers of those contribu$ng to
(mixed into) packet
RTP header
payload type
sequence
number type time stamp
Synchronization Source ID
RTP example
contains sequence
Today’s Outline
•
RTP
–
protocol goals
–
mixers and translators
RTP: Mixers and Translators
•
mixer:
– several media stream ➠ one new stream (new encoding) – reduced bandwidth networks (dial-‐up)
– appears as new source, with own iden$fier
•
translator:
– single media stream
– may convert encoding
– protocol transla$on (na$ve ATM ↔ IP), firewall – all packets: source address = translator address
RTP: Mixers and Translators
SSRC=39 SSRC=17
192.35.149.52
128.119.40.186
192.26.8.84 192.20.225.101
SSRC=5
DVI4
L16
GSM
GSM SSRC=5
translator end system
end system
mixer
Today’s Outline
•
RTP
–
protocol goals
–
mixers and translators
–
control: awareness, QOS feedback
Control: awareness, QOS feedback
•
Packet loss, conges$on, jiker, delivery $mes
– Directly useful for control of adap$ve encodings – Iden$fy if problems are local or global
– Short-‐term and long-‐term sta$s$cal analysis
•
Self-‐adjus$ng network
– Each par$cipant eventually knows about the other
members
– Source descrip$on dynamically iden$fies who is sending – Ac$ve senders get more bandwidth
– Session bandwidth kept constant by adjus$ng
Real-‐Time Control Protocol (RTCP)
•
works in conjunc$on
with RTP
•
each par$cipant in RTP
session periodically
sends RTCP control
packets to all other
par$cipants
•
each RTCP packet
contains sender and/or
receiver reports
– report sta$s$cs useful to
applica$on: # packets sent, # packets lost, interarrival jiker
•
feedback used to control
performance
– sender may modify its
RTCP: packet types
•
stackable packets, similar to data packets
•
sender report (SR):
– bytes send ➠ es$mate rate; – $mestamp ➠ synchroniza$on
•
recep0on reports (RR):
– number of packets sent and expected ➠ loss, avg. inter-‐
arrival jiker, round-‐trip delay
•
source descrip0on(SDES):
– name, email, loca$on,...
– CNAME (canonical name = user@host) iden$fies user
across media
•
explicit leave (BYE):
in addi$on to $me-‐out
RTCP: packet structure
if encrypted: random 32-bit integer
RTCP: mul$ple mul$cast senders
each RTP session: typically a single mul$cast address;
every par$cipant: periodically mul$cast RTCP packet to same
group as data
RTP, RTCP packets dis$nguished from each other via dis$nct port
numbers
to limit traffic, each par$cipant reduces RTCP traffic as number of
conference par$cipants increases
RTCP RTP
RTCP RTCP
sender
RTCP: announcement interval
•
Goals:
–
es$mate current number of par$cipants & iden$$es
of par$cipants – dynamic
–
source descrip$on (“SDES”)
➠
who’s talking?
–
quality-‐of-‐service feedback
➠
adjust sender rate
–
to O(1000) par$cipants, few % of data
• ➠ randomized response with rate ↓ as members ↑
–
group size limited by tolerable age of status
–
gives ac$ve senders more bandwidth
RTCP: bandwidth scaling
RTCP aAempts to limit
its traffic to 5% of
session bandwidth
packet transmission period by calcula$ng avg RTCP
RTCP: bandwidth scaling
• sender period T:
T = # of senders
0.25 · 0.05 · session bw · avg. RTCP packet size
• receivers:
T = # of receivers
0.75 · 0.05 · session bw · avg. RTCP packet size
• next packet = last packet + max(5 s, T) · random(0.5. . . 1.5)
• randomization prevents “bunching”
RTCP sender reports (SR)
•
SSRC of sender:
iden$fies source of data
•
NTP *mestamp:
when report was sent
•
RTP *mestamp:
corresponding “RTP $me”
➠
lip sync
•
sender’s packet count:
total number sent
•
sender’s octet count:
total number sent
•
followed by zero or more receiver report
RTCP receiver reports (RR)
•
SSRC of source:
iden$fies who’s being reported on
•
frac*on lost:
binary frac$on
•
cumula*ve number of packets lost:
long-‐term loss
•
highest sequence number received
:
compare losses,
disconnect
•
inter-‐arrival jiAer:
smoothed inter-‐packet distor$on
•
LSR:
$me last SR heard
RTCP: round trip delay es$ma$on
lsr =0xb705:2000 (46853.125 s) dlsr=0x0005.4000 ( 5.250 s)
(5.25 s)
DLSR
A 0xb710:8000 (46864.500 s)
DLSR −0x0005:4000 ( 5.250 s)
LSR −0xb705:2000 (46853.125 s)
delay 0x 6:2000 ( 6.125 s) ntp_sec =0xb44db705
ntp_frac=0x20000000 (3024992016.125 s)
= sync different streams (audio, video,
RTCP: stream synchroniza$on
Today’s Outline
•
RTP
–
protocol goals
–
mixers and translators
–
control: awareness, QOS feedback
Media Adapta$on
•
Mul$media applica$ons can adjust their data rates:
•
Audio: (MPEG L3), encoding, sampling rate, mono/
stereo
encoding
sampling rate
bit rate
LPC
8,000
5,600
GSM
8,000
13,200
DVI4
8,000
32,000
µ-law
8,000
64,000
DVI4
16,000
64,000
a range of DVI4 and MPEG L3
Applica$on Control
•
networks without QoS or shared reserved link:
– adapt applica$on to available bandwidth
– share bandwidth fairly with TCP?
– lowest common denominator
RTP/RTCP Does NOT
•
Define media data formats or encodings
–
Need media specific profiles
•
Handle connec$on setups
–
Need other protocols like SIP or H.323
•
Handle resource reserva$on
–
Need other protocols like RSVP
•
Guarantee $mely data delivery or Quality of
Service
–
However, it does provide necessary data to
References
• RFC 3550 -‐ hkp://tools.ie{.org/html/rfc1889 • RFC 3551 -‐ hkp://tools.ie{.org/html/rfc3551
• Wikipedia:
– RTP -‐ hkp://en.wikipedia.org/wiki/Real-‐$me_Transport_Protocol – RTCP -‐ hkp://en.wikipedia.org/wiki/RTCP