You are on page 1of 38

RTP/RTCP

NGN FACULTY,ALTTC GHAZIABD




Realtime Transport Protocol
(RTP)

RTP
REAL TIME TRANSPORT
PROTOCOL


Realtime Transport Protocol
(RTP)

MAIN FEATURES OF RTP
Real-time Transfer Protocol (RTP) provides end-
to-end delivery services for data (such as
interactive audio and video) with real-time
characteristics.
It was primarily designed to support multiparty
multimedia conferences. Now it is used for
different types of applications
RTP is a standard specified in RFC 1889.



Realtime Transport Protocol
(RTP)

WHAT WE MEANT ABOUT REAL
TIME?
The class of methods whose correctness depends not only
on whether the result is the correct one, but also on the time
at which the result is delivered.




Realtime Transport Protocol
(RTP)

EXAMPLE
We want to listen to a song. When we are
downloading it from a site, we don't care whether it
is downloaded at the same rate or not. we just
need a reliable download
But
what if want to listen to the song without downloading it?
Then we are not only interested to get the whole data but
also the rate at which you receive, otherwise the song loses
its charm. Here we need a real-time transmission.


Realtime Transport Protocol
(RTP)

Components of RTP
Real Time Protocol (RTP): It carries real-time data.
Real Time Control Protocol (RTCP): It monitors
the quality of service and conveys information
about the participants.


Realtime Transport Protocol
(RTP)

Simple Multicast Audio Conference
Initially the owner of the conference (say the leader
of a group) through some allocation mechanism
obtains a multicast group address and pair of
ports. One port is used for audio data, and the
other is used for control (RTCP) packets. This
address and port information is distributed to the
intended participants .
Each participant sends the audio data in small
chunks (say 20ms) or packets.


Realtime Transport Protocol
(RTP)

Simple Multicast Audio Conference
Each instance of the audio application (i.e. each
participant) in the conference periodically
multicasts a reception report plus the name of its
user on the RTCP (control) port.


Realtime Transport Protocol
(RTP)

Audio and Video Conference
If both audio and video media are used in a
conference, they are transmitted as separate RTP
sessions RTCP packets are transmitted for each
medium using two different UDP port pairs and/or
multicast addresses.


Realtime Transport Protocol
(RTP)

TRANSLATORS


Realtime Transport Protocol
(RTP)

MIXERS


Realtime Transport Protocol
(RTP)







Basic concepts:

SSRC

CSRC




The SSRC identifier carried in the RTP header and in
various fields of RTCP packets is a random 32-bit
number that is required to be globally unique within
an RTP session.
All RTP implementations must be prepared to detect
collisions and take the appropriate actions to resolve them.
If a source discovers at any time that another source is
using the same SSRC identifier as its own, it must send an
RTCP BYE packet for the old identifier and choose another
random one.
If a receiver discovers that two other sources are
colliding, it may keep the packets from one and discard the
packets from the other.
SRC Identifier Allocation


Realtime Transport Protocol
(RTP)
It is a protocol for end to end delivery
for the real time data.
Encapsulates audio or video inside RTP Packet
Timestamps packets to replay media in real time
Assigns sequence numbers to order packets in correct
Sequence at the receiver
Mixes multiple streams into one stream
Uses UDP as transport protocol
Voice

RTP

UDP

IP
IP Header UDP Header RTP Header Voice Payload
IP Packet
00010110010100


Realtime Transport Protocol
(RTP)

Sequence Number

Time stamp

Payload Type

Synchronization
Source Identifier
Miscellaneous field

RTP HEADER
RTP Fixed Header
RTP Fixed Header
P: Padding
X: Header Extension
CC: CSRC count
M: Marker of record
boundary
PT: Payload type; mapping can be

specified by profile of the
application
Sequence number: for each packet
can be used by the receiver to
detect loss or restore sequence.


Realtime Transport Protocol
(RTP)


version (V): 2 bits
This field identifies the version of RTP. The version is 2 upto
RFC 1889.
padding (P): 1 bit
If the padding bit is set, the packet contains one or more
additional padding octets at the end which are not part of the
payload. The last octet of the padding contains a count of how
many padding octets should be ignored. Padding may be
needed by some encryption algorithms with fixed block sizes or
for carrying several RTP packets in a lower-layer protocol data
unit.









Realtime Transport Protocol
(RTP)

Extension (X): 1 bit
If the extension bit is set, the fixed header is followed
by exactly one header extension.
CSRC count (CC): 4 bits
The CSRC count contains the number of CSRC
identifiers that follow the fixed header.
Marker (M): 1 bit
Marker bit is used by specific applications to serve a
purpose of its own. We will discuss this in more
detail when we study Application Level Framing.











Realtime Transport Protocol
(RTP)

Payload type (PT): 7 bits
This field identifies the format (e.g. encoding) of the RTP
payload and determines its interpretation by the application.
This field is not intended for multiplexing separate media.
Sequence number: 16 bits
The sequence number increments by one for each RTP data
packet sent, and may be used by the receiver to detect packet
loss and to restore packet sequence. The initial value of the
sequence number is random (unpredictable).








Realtime Transport Protocol
(RTP)

Timestamp: 32 bits
Reflects sampling instant of the first byte of data
Clock frequency can be specified by profile of payload
format documents for the application.
Example: for fixed-rate audio, clock may increment by
one for each sampling period.
SSRC: 32 bits
The SSRC field identifies the synchronization source. This
identifier is chosen randomly, with the intent that no two
synchronization sources within the same RTP session will have
the same SSRC identifier.









Realtime Transport Protocol
(RTP)

Synchronization in RTP
Receiver needs three key information for
synchronization :
1. synchronization source
2. packets in order
3. sampling instant of packets








Realtime Transport Protocol
(RTP)

Synchronization Source (SSRC)
The receiver may be receiving data from several
sources. So for proper arrangement it needs to
identify the source of individual packets which is
possible from the SSRC field.
Sequence Number
It is not enough to identify the source, the order is important
too. The sequence number increments by one for each RTP
data packet sent, and may be used by the receiver to detect
packet loss and to restore packet sequence. The loss or out-of-
order delivery occurs due network problems.









Realtime Transport Protocol
(RTP)

Synchronization Source (SSRC)
The receiver may be receiving data from several
sources. So for proper arrangement it needs to
identify the source of individual packets which is
possible from the SSRC field.
Sequence Number
It is not enough to identify the source, the order is important
too. The sequence number increments by one for each RTP
data packet sent, and may be used by the receiver to detect
packet loss and to restore packet sequence. The loss or out-of-
order delivery occurs due network problems.









Realtime Transport Protocol
(RTP)

Timestamp :

Several consecutive RTP packets may have equal
timestamps if they are (logically) generated at once,
e.g., belong to the same video frame.
or
As a audio/video session audio and video data are
transmitted using separate channels The receiver
matches the video data with corresponding audio
data using timestamp






RTP: Real-Time Transport Protocol

Type of the payload
o Audio
PCM A-law
PCM m-law
o Video
JPEG
H.261
MPEG


Media
Encapsulation

Application
RTP RTCP
Data
Control
UDP

IP

Ethernet

How RTP Works?
A header is attached to these RTP packets. These
RTP packets are sent to UDP, where a UDP header
is attached. The combined packet is the sent to IP,
where an IP header is attached and the resulting IP
datagram is routed to the destination.
At the destination, the various headers are used to
pass the packet to the appropriate application.
How RTP Works?
RTP can use many different voice and video coding
standards (e.g. G.711 G.723, G.729,H261 etc.). RTP
includes a mechanism which allocates a payload type
number to various coding schemes and provides high-
level descriptions of the coding techniques.
Thus pay load data can be correctly interpreted at
receiving end by knowing which coding scheme is
being used.

How RTP Works?
REAL TIME TRANSPORT CONTROL
PROTOCOL
RTCP
RTCP
Functions of RTCP:
It provides feedback on the quality of the data distribution.
Different types of packets are used.
It carries a persistent transport-level identifier for an
RTP source called the canonical name or CNAME.
SSRC may change from time to time but CNAME
remains the same. It is used to identify a participant
during the session.

RTCP
Primary function is to provide feedback on the
quality of data distribution.
Through sender and receiver reports;
For adaptive encoding (adaptive to network congestion);
Can be used to diagnose faults
RTCP carries a persistent transport-level
identifier for an RTP source, called canonical
name, CNAME.
Receivers use CNAME to keep track of each participant
And to synchronize related media streams (with the help of
NTP)

RTCP Packets
SR: sender reports; sending and reception
stat.
RR: receiver reports; for reception
statistics from multiple sources.
SDES: source description item, include
CNAME
BYE: indicates end of participation
APP: application specific functions
Compound RTCP Packets
A compound RTCP packet contains multiple
RTCP packets of the previous types.
Example:
SDES Packet
CNAME Item in SDES Packet
Mandatory
Provides a persistent identifier for a source.
Provides a binding across multiple media used by one
participant in a set of related RTP sessions. CNAME
should be fixed for that participant.
SSRC is bound to CNAME
BYE: Goodbye RTCP Packet
Mixers should forward the BYE packet
with SSRC/CSRC unchanged.
Conclusions
RTP defines transport support for common
functions of real-time applications.
Timing information: sampling period.
Synchronization source for playback
Payload types (encoding)
Quality reports: short-term and long-term packet loss, and jitters.
Participants indication: CNAME,
Multicast distribution support
Conversion: mixers and translators

Customizable to application or application classes.
Necessity of this feature is not clear.

You might also like