RTP/RTCP

VoIP 미디어 전송기술
(RTP/RTCP)
WIZnet
김구환
[email protected]
Contents
RTP/RTCP
AVT-WG
RTP
RTCP
Trends
Related URLs
-2-
VoIP forum
AVT-WG
RTP/RTCP
Audio/Video Transport Working Group
specify experimental protocols for real-time transmission of
audio and video over UDP and IP multicast
RTP
Mailing Lists
General Discussion:[email protected]
To Subscribe: [email protected]
Archive: ftp://nic.es.net/pub/mailing-lists/mail-archive/rem-conf
-3-
VoIP forum
RTP
RTP/RTCP
RTP goals
transmission realtime & not-reliable streaming data
focus on both unicast and multicast
RTP(Real-time Transport Protocol)
RTP is still an application layer protocol
end-to-end transport protocol for real-time data
(such as audio, video, simulation data)
not complete, but common in all real-time applications
Provide a suitable framework for any encoding
(complete protocol : RTP framework + payload format)
Transmission over any network connection
protocol-independent
not affected by any addressing(one-way RTCP in ADSL)
-4-
VoIP forum
RTP/RTCP
Protocol Stack for Multimedia conference
APPLICATIONS
APPLICATIONS
Audio
AudioConference,
Conference,Video
VideoConference,
Conference,Shared
SharedTools,
Tools,Session
SessionDirectory,
Directory,Conference
ConferenceControl
Control
RSVP
RTP/RTCP
SCCP
SIP SCIP
SDP
SDAP
HTTP SMTP
UDP
UDP
TCP
TCP
IP
IP
ICMP
ICMP
IGMP
IGMP
Integrated
Integrated Services
Services Forwarding
Forwarding
-5-
VoIP forum
RTP - Application
RTP/RTCP
Configuration for Audio and Video Conference
AUDIO
VIDEO
RTP
RT
CP
RTP
RT
CP
even
port
odd
port
even
port
odd
port
UDP
AUDIO
RTP
VIDEO
RT
CP
RTP
RT
CP
UDP
IP
IP
-6-
VoIP forum
RTP
RTP/RTCP
Dynamic payload type assignment(= Adaptive encoding)
payload type can be changed during transmission
Sync various streams
not in RTP/RTCP but in application level
need playback buffer or additional RTCP-like management stream
RTP timestamp
RTP uses a linear monotonical clock to provide higher level sync.
Higher rate than the smallest block size(Faster than audio sample
rate)
Flow & Congestion Control
by RTCP sender and receiver reports
interarrival jitter field in SR
measures jitter over a certain interval -> indicate congestion
Congestion Control
- monitor program ▷ only receive RTCP
- sender changes the format/compression or articulations
-7-
VoIP forum
RTP
RTP/RTCP
Packet Source Tracing
SSRC(Synchronization Source) - 32bit ID
network address independent
randomly chosen
globally unique within a particular RTP session
Mixer & Translator
Mixer - e.g. mixing of different video streams into one
Translator - e.g. network gateway or encoding format
changes
So, need for tracing the packet sources
Use CSRC(Contributing Source ID) in RTP header
-8-
VoIP forum
RTP/RTCP
(1)Mixer accepts each
64 Kbps stream
ISDN
receiver
MIXER
(2)...and combines all three
into a single 64 Kbps stream
Mixer lowers bandwidth requirements of overall conference
(1) Translator accepts
each 1 Mbps stream
Frame Relay
(1.5Mbps)
TRANSLATOR
Receiver
(2) ...and converts each to a
lower quality, 256 kbps stream
Translator lowers the bandwidth each source requires
-9-
VoIP forum
RTP/RTCP
SSRC: A
source A
SSRC: A
SSRC: B
SSRC: C
ISDN
SSRC: C
SSRC: B
source B
source C
MIXER: E
SSRC: E
CSRC: A,B,C
receiver
Mixer converts synchronization sources to contributing sources
source A
SSRC: A
Frame
Relay
SSRC: A
SSRC: B
SSRC: C
SSRC: C
SSRC: B
source B
source C
SSRC: A
SSRC: B
Receiver
TRANSLATOR: D
SSRC: C
Translator preserves the synchronization source ID
- 10 -
VoIP forum
RTP/RTCP
Tracing Sources
E6
E1
E6: 15
E1:17
M1
M1: 48(1,17)
E2:1
T1
M1: 48(1,17)
E4: 47
T2
E6: 15
M1: 48(1,17)
E4: 47
M3: 89(64,45)
E7
E4: 47
E2
E3
E4
E3: 64
M2
M2: 12(64)
M3
M3: 89(64,45)
E5: 45
source:SSRC(CSRC)
E5
- 11 -
VoIP forum
RTP
RTP/RTCP
Reliability
RTP is non-reliable protocol
Note that RTP itself does not provide any mechanism to ensure timely delivery
or provide other quality-of-service guarantees, but relies on lower-layer services
to do so. It does not guarantee delivery or prevent out-of-order delivery, nor
does it assume that the underlying network is reliable and delivers packets in
sequence.
RTP’s purpose is NOT to delivery data reliable or in time
It’s designed to transmit realtime streams.
No error detection or packet ordering
RTP usually works on top of UDP
▷ uses UDP’s checksums, multiplexing
top of TCP ▷ packet ordering, error free are guaranteed
One can choose the under layer protocol for desired application
RTP packet loss, out-of-order packets
16bit sequence #(random initial value)
RR feedback to sender - packet rate, jitter
- 12 -
VoIP forum
RTP
RTP/RTCP
Other
Addressing
RTP Session=(multicast addr + UDP port, RTP port,
RTCP port)
Multiplexing
done by lower layer
RTP level multiplexing is not be supported
Security
Depends on under layer protocols
Confidentiality
Authentication and Message Integrity
Encryption method for RTP, RTCP packet is provided
Compression
RTP header can be compressed for low-speed
connections
- 13 -
VoIP forum
RTP
RTP/RTCP
RTP fixed header fields
0
31
IP Header
UDP Header
Sequence Number
Timestamp
Synchronization Source ID
(first) Contributing Source ID
… .
(last) Contributing Source ID
V P X CC M
PT
V :Version=2 (2bit)
P : Padding (1bit)
X : Extension (1bit)
CC: Contributor Count
(4bit)
M :Marker (1bit)
PT:Payload Type (7bit)
Application Data
- 14 -
VoIP forum
RTP Payload Types
PT
Payload
0
PCMU audio
1016 audio
G721 audio
GSM audio
Unsassigned audio
DV14 audio (8 Khz)
DV14 audio (16 Khz)
LPC audio
PCMA audio
G722 audio
L16 audio (stereo)
L16 audio (mono)
TPS0 audio
VSC audio
MPA audio
G728 audio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
PT
RTP/RTCP
Payload
16-22 Unassigned audio
23
24
25
26
27
28
29
30
31
32
33
34-71
72-76
77-95
96-127
- 15 -
RGB8 video
HDCC video
CelB video
JPEG video
CUSM video
Nv video
PicW video
CPV video
H261 video
MPV video
MP2T video
Unassigned video
Reserved
Unassigned
dynamic
VoIP forum
RTP/RTCP
0
31
IP
Header
IP Header
UDP
Header
UDP Header
RTP
Header
Sequence Number
Timestamp
Synchronization Source ID
V P X CC M
PT
SBIT EBIT I V GOBN
H.261
Message
MBAP
QUANT
HMVD
VMVD
H.261 Stream
H.261 streams build on the basic RTP header
- 16 -
VoIP forum
RTP - Header Extension
RTP/RTCP
if X bit is set
variable-length header extension is appended to the
RTP header
first 16-bits of header extension are left open for
distinguishing ID or parameters for profile
length counts the # of 15
32-bit words in the extension
31
defined by profile
length
header extension
...
RTP header extension format
- 17 -
VoIP forum
RTCP
RTP/RTCP
Real-time Transport Control Protocol
RTCP can be optional extension of RTP
periodic transmission of control packets to all participants
Exchanges QoS informations (lost packet, jitter, delay,...)
▷ Adaptive encoding by application
RTCP Functions
QoS monitoring
used for adaptive encoding, and third party monitoring
carry a persistent transport level ID for an RTP source, CNAME
since SSRC may be changed(when SSRC conflict or program is
restarted), receiver require CNAME to keep track of each participant
control rate : scale up to a large # of participants
convey minimal session control information - loosely controlled
- 18 -
VoIP forum
RTCP - Packets
RTP/RTCP
RTCP Packet Format
Packet
Type
Name of packet
Functions
200
Sender Report(SR)
Tx and Rx statistics from active senders
201
Receiver Report(RR)
Rx statistic from not active senders
202
Source Description(SDES)
Source description items(CNAME)
203
Bye(BYE)
indicate end of participation
204
Application Specific(APP)
for application specific function
- 19 -
VoIP forum
RTCP - Transmission Interval & Bandwidth RTP/RTCP
Goal : scale automatically over session size
Rules
keep the overall traffic requirements for RTCP packets roughly
since all RTCP is sent via multicast, every system can keep track
as total # of systems increase,
the frequency of report messages has to be decreased
report generation is randomness
if reports are synchronized ▷ heavy peak load
each sender randomizes the calculated interval(> 5sec)
Interval between RTCP packets varies [1/2, 3/2] * interval
RTCP bandwidth < 5% of session bandwidth
- 20 -
VoIP forum
RTCP - Transmission Interval
RTP/RTCP
Rules cont’d
Senders are collectively allocated at least 1/4 of the control
traffic bandwidth▷newly joining participants will quickly receive
CNAME for senders
RTCP packet interval > 5 sec
Maintaining the Number of Session Members
Add valid list if multiple packets carry new SSRC are received
RTCP BYE packet or 30 minutes inactive ▷ Delete
All sites calculate RTCP report interval roughly
if no RTP, RTCP is received for 5*interval,
then mark inactive(if valid) or delete it(if not yet valid)
participant marked inactive will be counted until timeout 30 minutes
- 21 -
VoIP forum
RTCP - Transmission Interval
RTP/RTCP
Allocation of Source description bandwidth
SDES can slow down the rate
SDES : mandatory CNAME item + several SDES items
recommended that no more than 20% of the RTCP bandwidth
allocated to a single participant be used to carry the additional
information
SDES items are optional(except CNAME)
- 22 -
VoIP forum
RTCP - SR & RR Message
RTP/RTCP
Sender Report
SR is issued if a site has sent any data packets during the
interval since issuing the last report or the previous one,
otherwise the RR is issued.
Senders in a conference periodically transmit SR
no sending data ▷ no SR
Receiver Report
If conference participant is not sending data itself,
there is no need to generate SR
Instead, RTCP allows transmitting periodic RR
- 23 -
VoIP forum
RTP/RTCP
0
31
V P
이부분을
제외하면
RTCP receive
report(RR)
R Cnt
Ptype:200
SSRC of Sender
Length
NTP Timestamp
Sender’s Packet Count
Sender’sByte Count
SSRC of first source
% lost
Cummulative Packets Lost
Extended Highest Sequence Number Received
Interarrival Jitter
Time of Last Sender Report
Time Since Last Sender Report
SSRC of second source
% lost
Cummulative Packets Lost
Extended Highest Sequence Number Received
Interarrival Jitter
Time of Last Sender Report
Time Since Last Sender Report
Application Data
RTCP sender report(SR)
- 24 -
VoIP forum
RTCP - SDES Message
RTP/RTCP
Source Descriptions(SDES)
only source generates SDES
three level structure composed of
a header, zero or more chunks, and each chunk items
source generate SDES periodically
0
V P
31
R Cnt
Length
Ptype:202
SSRC or CSRC of first Source
SDES Items
SSRC or CSRC of first Source
SDES Items
SSRC or CSRC of first Source
SDES Items
- 25 -
VoIP forum
RTP/RTCP
Source Description Items
Val
Abbrev.
0
1
2
3
4
5
6
7
8
END
CNAME
NAME
EMAIL
PHONE
LOC
TOOL
NOTE
PRIV
Name
End of SDES list
Unique and unambiguous name for the source
Real user name of the source
Email address
Telephone number
Geographic location
Name of application or tool
Notice about the source
Private extensions
Example of CNAME items
7
CNAME=1
15
length
31
user and domain name ....
- 26 -
VoIP forum
RTP/RTCP
Example of SDES
CNAME=1 : [email protected]
NAME=2 : Kuhwan Kim
EMAIL=3 : [email protected]
PHONE=4 : +82-2-3453-9473
LOC=5
: Pusan Korea
TOOL=6 : Video tool 1.2
NOTE=7 : “My phone out of order !”
PRIV=8
: private extension
- 27 -
VoIP forum
APP Message
RTP/RTCP
Application specific message
message for application testing
V=2 P
subtype
PT=204
SSRC/CSRC
name(ASCII)
length
Application-dependent data
....
- 28 -
VoIP forum
BYE Message
RTP/RTCP
BYE
other participants would detect absence eventually
without BYE, but BYE tell them quickly
0
31
V P
S Cnt
Length
Ptype:203
SSRC of first Source
SSRC of Second Source
SSRC of last Source
R Length
Reason for Leaving
- 29 -
VoIP forum
RTP - Summary
RTP/RTCP
n RTP over UDP/IP
RTP/RTCP functions
payload type identification
sequence numbering
timestamping
delivery monitoring
multiplexing
checksum
multicasting
RTP does not provide
n Usages
resource reservation
timely delivery
guaranteed QoS delivery
out-of-order delivery prevention
underlying network is reliable
- 30 -
audio and video conferences
distributed simulation
modeling
real time control and
measurement
VoIP forum
Current Trends
RTP/RTCP
Current situation
ATM based
higher performance, but update all existing network
TCP/IP based RTP/RSVP
use existing network and existing protocol(TCP/IP)
Usage
router producers implements RSVP
RTP over ATM AAL5, IPv6 are in progress
WINSOCK 2 supports both ATM & RSVP/RTP Qos
schemes
RTP is widely used now
e.g. Netscape’s LiveMedia plug-ins
- 31 -
VoIP forum
RTP Implementations
Audio
Free Phone
NetMeeting
NeVoT
RAT
vat
Video
Intel Internet
Video Phone
IP/TV
NeViT
vic
Web Theater
Translator & Mixers
RTP/RTCP
Internet Phone
rtptrans
Netscape LiveMedia
RTP gateway
Microsoft NetMeeting
Tools
PSTN Interconnection
rtpdump
rtpmon
rtpplay
rtpsend
Libraries
Flashware
RADVision H.323
H.323 systems
Audio-o n-d e m a n d
Other conferencing
systems
Other older
implementations
RTP library
- 32 -
VoIP forum
Related URLs
RTP/RTCP
Audio/Video Transport (avt) Charter
http://www.ietf.cnri.reston.va.us/html.charters/avt-charter.html
RTP
http://www.CS.ORST.EDU/~kleinro/nacse/rtp/
About RTP and the AVT WG
http://www.cs.columbia.edu/~hgs/rtp/
Henning Schulzrinne
http://www.cs.columbia.edu/~hgs/
Internet KIG, TCP/IP-NG Working
Grouphttp://pec.etri.re.kr/tcpip-ng/
Getting RTP Software at IASI
http://www.iasi.rm.cnr.it/iasi/netlab/gettingSoftware.html
vat, rtptools,RTP Library offer free codes
http://www-nrg.ee.lbl.gov/vat/
http://www.iasi.rm.cnr.it/iasi/netlab/rtpReadme.html
RFC, ID
ftp://ds.internic.net/rfc/
ftp://ftp.ietf.org/internet-drafts/
- 33 -
VoIP forum