Introduction Multimedia content and protocols RTP and RTCP
Advanced Networking
Multimedia networks Part 1
Fayssal BENDAOUD
f.bendaoud@esi-sba.dz
Options: SIW, IASD
November 5, 2024
1/40
Introduction Multimedia content and protocols RTP and RTCP
Outline
Introduction
Multimedia content and protocols
RTP and RTCP
RTP
RTCP
2/40
Introduction Multimedia content and protocols RTP and RTCP
Introduction
3/40
Introduction Multimedia content and protocols RTP and RTCP
Introduction
4/40
Introduction Multimedia content and protocols RTP and RTCP
Introduction
• AT first, simple applications of the Internet
• Email, remote connection, file transfer and sharing, web, etc.
• Now, Multimedia applications
• Video streaming, voice over IP, IPTV, etc.,
5/40
Introduction Multimedia content and protocols RTP and RTCP
Real time over IP
Problems
• Packet mode, multiplexing of several streams on the same link,
therefore risk of time lag (jitter).
• Retransmission of errors too slow, therefore TCP not suitable.
• Quality of service not ensured by the IP layer (do not confuse
with RSVP, reservation of resources over IP, which requires
suitable routers)
6/40
Introduction Multimedia content and protocols RTP and RTCP
Real time over IP
Solutions, basically
• RTP (Real-time Transport Protocol) - Used widely for delivering
audio and video over IP. Works with RTCP for monitoring and
signalling. Supports unicast and multicast.
• RTSP (Real Time Streaming Protocol) - A protocol similar to
HTTP but specifically for controlling delivery of streaming
media. Uses RTP for the transport.
7/40
Introduction Multimedia content and protocols RTP and RTCP
Multimedia
• Multimedia content refers to the combination of various media
elements, such as text, images, audio, video, and interactive
elements, to deliver information or entertainment in a dynamic
and engaging format.
8/40
Introduction Multimedia content and protocols RTP and RTCP
Needs for multimedia applications
Multimedia applications need
• Packet sequencing (ordering of packet is important)
• Temporal constraints: Timestamps of packets (data must be
processed within a specific time)
• Identification of users (security)
• QoS (loss rate, jitter delay, etc.).
9/40
Introduction Multimedia content and protocols RTP and RTCP
QoS constraints for multimedia applications
We need to guarantee these
• Minimum Data rate or Throughput.
• Loss rate/Error rate < threshold
• Latency (response time, delay) < threshold
• Jitter : stable
We need to apply a QoS management policy to protect these
applications.
10/40
Introduction Multimedia content and protocols RTP and RTCP
Limits of TCP/UDP protocols
• TCP is unsuitable due to the Real time constraint.
• TCP requires 100% reliability
• TCP promotes reliability at the expense of delays (TCP is slow)
• TCP only exists in unicast mode
• UDP:
• Unreliable transport service
• No knowledge of the loss rate or the order of packets.
• Sensitive applications with severe constraints need new
transport protocols
11/40
Introduction Multimedia content and protocols RTP and RTCP
Protocols for multimedia apps
12/40
Introduction Multimedia content and protocols RTP and RTCP
Mechanisms of RTP
• Detect packet loss, cope with reordering
• sequence number per media stream
• Determine variations in transmission delays
• media specific time stamp (e.g., 8 kHz for PCM audio)
• allows receiver to adapt playout point for continuous replay
• Source identification
13/40
Introduction Multimedia content and protocols RTP and RTCP
Characteristics of multimedia content
• Time-Sensitive
• End-to-end delay
• Delay variation: jitter
• Loss Tolerant
• Redundancy of information,
• Receiver adaptation
• The contrary of traditional applications
• Not time-sensitive
• Sensitive to losses
14/40
Introduction Multimedia content and protocols RTP and RTCP
Multimedia and networks
Several mechanisms and protocols:
• At the edge
• Coding (compression, packaging, etc.) MPEG, H261,
• End-to-end transport
• RTP/UDP
• Control messages
• RTCP
• User management, sessions, flows
• SIP, H323, RTSP
15/40
Introduction Multimedia content and protocols RTP and RTCP
Classes of multimedia applications
• Streaming pre-recorded audio and/or video
• YouTube
• Live audio and/or video streaming
• Video-conferencing, Internet TV, etc.
• ”Real-time” interactive audio and/or video applications
• IP telephony, Skype, Games.
16/40
Introduction Multimedia content and protocols RTP and RTCP
Streaming of stored media
• Videos on Demand (VoD). Media stored at the source and
transmitted to the client
• Streaming: the client starts ”play” before all the data has arrived.
Temporary storage through buffers.
• Time constraint: data must arrive in time to be played
continuously
• Note: If we wait for the complete flow, its then a file transfer
17/40
Introduction Multimedia content and protocols RTP and RTCP
Live media streaming
• Examples:
• Internet radio, TV on the Internet, Video-conferencing
• Streaming
• data is continuously transferred over the internet in real-time
• data is segmented into equal-length files and delivered to the
end-users
• Interactivity
• no fast-forward, pause, rewind possible
18/40
Introduction Multimedia content and protocols RTP and RTCP
RTP real time protocol
• RTP is a transport protocol in the Internet
• In layer 4, like TCP, but implemented over UDP
• RFCs 3550 and 3551 (July 2003 – original RFCs from 1996)
• RTP is for ”real-time” applications
• For example telephony, video-conferencing
• TCP is not suitable for these applications
19/40
Introduction Multimedia content and protocols RTP and RTCP
RTP real time protocol
• Real-Time Transport Protocol
• Designed to receive audio or video stream packets, but also other
applications (data broadcasting, remote control, etc.) to avoid
jitter, re-sequence the packets.
• Typically used over UDP
• Used in conjunction with RTCP: transport of information on the
quality of the transmission, on the identity of the participants, etc.
20/40
Introduction Multimedia content and protocols RTP and RTCP
RTP principles
• RTP allows the packets of a stream to be transported (generally
audio or video).
• The packet header allows to specify:
• the type of information transported
• useful time markers for synchronization
• sequence numbers to detect losses
• data source identifier(s)
21/40
Introduction Multimedia content and protocols RTP and RTCP
RTCP principles
• RTCP makes it possible to exchange information on the flows
transported by RTP:
• transmission and reception statistics
• source information
• end of the flow emitted by a source
• other application-specific information
22/40
Introduction Multimedia content and protocols RTP and RTCP
RTP and RTCP
23/40
Introduction Multimedia content and protocols RTP and RTCP
RTP sessions and applications
• RTP allows to send packets in a data stream. An application can
receive several RTP/RTCP streams simultaneously, and
aggregate them.
• In particular, we can imagine a ”mixer” which aggregates two or
more streams, possibly after transcoding some of them, and
re-transmits the result. RTP allows to indicate the different
sources.
24/40
Introduction Multimedia content and protocols RTP and RTCP
Structure of RTP packet
25/40
Introduction Multimedia content and protocols RTP and RTCP
Structure of RTP packet
• V: Version number (= 2 bits)
• P: Padding bit (1 bit – packet contains padding)
• X: Extension bit (1 bit can be used for additional control
information)
• M: marker 1 bit marks the border of the frame (e.g. from a voice
impulse in audio, the end of the frame in video)
26/40
Introduction Multimedia content and protocols RTP and RTCP
Structure of RTP packet
• CC: Contributor count: Number of contributing sources
• Payload Type number: represents the type of information coding
carried in the packet, allows the receiver to decode correctly.
• Sequence number: incremented with each packet sent to detect
packet losses.
• Timestamp: indicates the time when the first byte of the packet
was generated.
• Synchronization Source ID (SSRC): Identifies the
synchronization source of the RTP stream.
27/40
Introduction Multimedia content and protocols RTP and RTCP
Payload type
28/40
Introduction Multimedia content and protocols RTP and RTCP
Sequence number
• The length of this field is 16 bits. It is used to give serial numbers
to RTP packets.
• It helps in sequencing. The sequence number for first packet is
given a random number and then every next packet’s sequence
number is incremented by 1.
• This field mainly helps in checking lost packets and order
mismatch.
29/40
Introduction Multimedia content and protocols RTP and RTCP
Time stamp
• The length of this field is 32-bits. It is used to find relationship
between times of different RTP packets.
• The timestamp for first packet is given randomly and then time
stamp for next packets given by sum of previous timestamp and
time taken to produce first byte of current packet.
• The value of 1 clock tick is varying from application to another.
30/40
Introduction Multimedia content and protocols RTP and RTCP
SSRC Synchronisation Source
• This is a 32-bits field used to identify and define the source.
• The value for this source identifier is a random number that is
chosen by source itself.
• This mainly helps in solving conflict arises when two sources
started with the same sequencing number.
31/40
Introduction Multimedia content and protocols RTP and RTCP
Contributing source identifier
• This is also a 32-bits field used for source identification where
there is more than one source present in session.
• The mixer source use Synchronization source identifier and other
remaining sources (maximum 15) use Contributor identifier.
32/40
Introduction Multimedia content and protocols RTP and RTCP
Structure of RTCP
33/40
Introduction Multimedia content and protocols RTP and RTCP
RTCP SR (Sender Report)
34/40
Introduction Multimedia content and protocols RTP and RTCP
RTCP SR (Sender Report)
• RTCP SR (Sender Report) is a type of RTCP packet that is sent
by the sender of an RTP stream to report on the characteristics of
the stream.
• The RTCP SR packet is sent periodically by the sender of the
RTP stream to provide information about the characteristics of
the stream and to enable the other participants in the session to
adjust their reception parameters accordingly.
35/40
Introduction Multimedia content and protocols RTP and RTCP
RTCP RR (Receiver Report)
• The reception receiver report (RR) contain information about the
quality of service of the RTP stream as received by the other
participants in the session.
• The reception receiver report provide feedback on the quality of
service of the stream as experienced by the other participants,
allowing the sender to adjust its transmission parameters to
improve the quality of the stream.
36/40
Introduction Multimedia content and protocols RTP and RTCP
RTCP SDES (Source Description)
37/40
Introduction Multimedia content and protocols RTP and RTCP
RTCP SDES (Source Description)
• SDES (Source Description) is a type of RTCP packet that is used
to provide additional information about the participants in a
session. It is typically sent periodically by each participant in a
session to provide additional information about themselves and
to enable the other participants to identify them
• Version (2 bits): The version of the RTCP protocol being used.
Currently, the only version is 2.
• Padding (1 bit): Indicates whether the packet contains additional
padding bytes at the end.
38/40
Introduction Multimedia content and protocols RTP and RTCP
RTCP SDES (Source Description
• Item count (5 bits): The number of items in the packet.
• Packet type (PT) (8 bits): The RTCP packet type, which in this
case is set to 202 for SDES packets.
• Length (16 bits): The length of the RTCP packet in 32-bits
words, minus one.
• SSRC/CSRC (32 bits): The synchronization source identifier for
the participant being described.
• SDES items: A series of SDES items containing information
about the participant being described.
39/40
Introduction Multimedia content and protocols RTP and RTCP
Conclusion
• Multimedia applications sensitive to the characteristics of the
network
• Time constraints.
• TCP/UDP unsuitable to use RTP and RTCP
• UDP-based RTP for data transport provides the ability to order
packets
• RTCP: to have statistics on the state of the network (RTT, jitter,
etc.)
40/40