Академический Документы
Профессиональный Документы
Культура Документы
RTP protocol
Written by Ahmed Hesham Mostafa,Sec 1,Level 4,CS
Introduction
The Real-time Transport Protocol (RTP) defines a standardized packet format for
delivering audio and video over IP networks. RTP is used extensively in
communication and systems that involve streaming media, such as telephony,
video teleconference applications and web-based push to talk features. For these
it carries media streams controlled by H.323, MGCP, Megaco, SCCP, or Session
Initiation Protocol (SIP) signaling protocols, making it one of the technical
foundations of Voice over IP.
RTP is usually used in conjunction with the RTP Control Protocol (RTCP). While
RTP carries the media streams (e.g., audio and video), RTCP is used to monitor
transmission statistics and quality of service (QoS) and aids synchronization of
multiple streams. When both protocols are used in conjunction, RTP is originated
and received on even port numbers and the associated RTCP communication uses
the next higher odd port number.
Figure 1
-How data transfer from client and server in OSI model using RTP Protocol
Figure1 –transfer multimedia (Voice /video) between client and server via RTP
2
3
RTP Packet
RTP packet generation
3
4
RTP Header
4
5
Payload type field PT: 7 bits, this field identifies the payload type (audio,
video, image, text, html, etc.)
Sequence number field: 16 bits, its initial value is random and it
increments by 1 for each packet sent, it can be used to detect lost packets
Timestamp field: 32 bits, reflects the moment when the first byte of the
RTP packet has been sampled. Used to enable synchronization and the
calculation of the jitter at the destination.
SSRC field: 32 bits uniquely identify the source, its value is chosen
randomly by the application. The SSRC identifies the synchronization
source (simply called "the source"). This identifier is chosen randomly with
the intent that it is unique among all the sources of the same session.
CSRC field: 32 bits, identifies contributing sources.
RTP sessions
5
6
A participant may be active in multiple RTP sessions (e.g. one for audio and
one for video)
For each participant, the session is identified by a network address, a port
pair for sending data and a port pair for receiving data
Each port pair comprises two adjacent ports An even-numbered port for RTP
data packets
The next higher (odd-numbered) port for RTCP control packets
RTP translator or mixer can be used in a session to adapt the data
transmission to participant’s conditions
RTP sessions types
Multicast (between n nodes).
Unicast (peer 2 peer).
Unicast with Mixer/translator
multicast to unicast
Translator
Manage communications between entities that does not support the same
coding scheme
Mixer
6
7
Receive RTP packets from a group of sources and combine them into a
single output, possibly changing the encoding, before forwarding the
result
RTCP Protocol
Designed to be used with RTP and to control an RTP session and provide
feedback on the quality of the data distribution and allows one who is
observing problems to evaluate whether those problems are local or global.
RTP and RTCP packets belonging to the same session use the same
multicast address but different port number
RTCP port number = RTP port number + 1
RTCP packets are sent periodically to provide Periodic reporting of
reception quality (e.g. number of packets sent, number of packets lost, inter-
arrival jitter) ,Notification on changes in session membership and
Information needed to synchronize media streams
RTCP messages:
RTCP has five types of Messages (Reports):
7
8
RTCP Packets
RTCP Header
Version: Identifies the RTP version which is the same in RTCP packets
as in RTP data packets.
P – Padding: RTCP packet contains some additional padding octets at
the end which are not part of the control information. In a compound
RTCP packet, padding should only be required on the last individual
packet because the compound packet is encrypted as a whole.
RC- Reception report count: the number of reception report blocks
contained in this packet. A value of zero is valid.
Length: The length of this RTCP packet in 32-bit words minus one,
including the header and any padding
8
9
Length
RTCP SR Header
11
12
RTCP RR Header
An empty RR packet (RC=0) is put at the head of a compound RTCP packet when
there is no data transmission or reception to report.
12
13
13
14
Each participant uses two ports. One for audio data and the
other for control (RTCP) packets
Each participant sends audio data in small chunks of say 20 mS
duration
A RTP header is added which contains the timing field that
ensures that the chunks of data are continuously played for
every 20mS
Both audio and video are transmitted as two separate RTP
sessions.
Separate RTP and RTCP packets are transmitted for each
medium using two UDP port pairs and multicast addresses.
No direct coupling at the RTP level between the audio and
video sessions
14
15
15