Real-Time Protocols

Work in progress. This note is still being written and incomplete.

Real-time multimedia applications rely on RTP, RTCP, and SIP for transport, feedback, and signalling.

Real-Time Transport Protocol (RTP)

RTP standardizes the packet structure for delivering real-time data such as audio and video over network transport.

  • RTP runs in end systems and is encapsulated directly inside UDP segments.
  • It extends UDP by adding payload identification, sequence numbers, and sampling timestamps.
+-------------------+-------------------+-------------------+-----------------------+
| IP Header (20 B)  | UDP Header (8 B)  | RTP Header (12 B) |  Audio/Video Payload  |
+-------------------+-------------------+-------------------+-----------------------+

RTP Header Fields

The fixed 12-byte RTP header:

0

4

8

16

32

V

P

X

CC

M

PT

Sequence Number

Timestamp

Synchronization Source (SSRC) Identifier

  • Payload Type (7 bits): Identifies the audio/video encoding format.
    • 0: PCM μ\mu-law (64 kbps64\text{ kbps})
    • 3: GSM (13 kbps13\text{ kbps})
    • 7: LPC (2.4 kbps2.4\text{ kbps})
    • 26: Motion JPEG
    • 31: H.261
    • 33: MPEG2 Video
  • Sequence Number (16 bits): Increments by 11 for each RTP packet sent. Detects loss and restores order.
  • Timestamp (32 bits): Sampling instant of the first RTP payload byte. Supports jitter removal and playout synchronisation.
    • For 8 kHz8\text{ kHz} audio, the timestamp clock increments by 11 every 125μs125\mu\text{s}. A 20ms20\text{ms} chunk increases the timestamp by 160160.
  • SSRC (32 bits): Identifies the RTP source within a session. Each stream in RTP session has distinct SSRC.

Real-Time Control Protocol (RTCP)

RTCP works in conjunction with RTP. While RTP delivers media data, RTCP transmits out-of-band control packets periodically to all participants in an RTP session.

  • RTP and RTCP use adjacent port numbers (e.g., RTP on UDP port PP, RTCP on UDP port P+1P+1).

Key RTCP Packet Types

  1. Receiver Report (RR): Sent by receivers; reports loss and jitter statistics.
  2. Sender Report (SR): SSRC, wall-clock time, RTP timestamp, packet count, and byte count.
  3. Source Description (SDES): Source metadata such as email address, sender's name, SSRC.

Stream Synchronization (Lip Sync)

In a video conference, separate RTP streams are generated for audio and video, each driven by its own sampling clock.

RTCP Sender Reports map media RTP timestamps to wall-clock time. Receivers use the mapping to align independent streams.

RTCP Bandwidth Scaling

RTCP limits control traffic to 5% of session bandwidth. Eg: For sending video at 2Mbps2\text{Mbps} session, RTCP traffic is limited to 100kbps100\text{kbps}.

  • 75% of RTCP bandwidth
    Shared by receivers.
  • 25% of RTCP bandwidth
    Reserved for active senders.

Each participant dynamically computes its RTCP transmission interval by dividing the average RTCP packet size by its allocated control bandwidth rate.

Session Initiation Protocol (SIP)

SIP is an application-layer signaling protocol designed by the IETF (Internet Engineering Task Force) for creating, modifying, and terminating multimedia sessions over IP networks.

Core Functions of SIP

  1. Address resolution: Maps SIP URIs to current IP addresses.
  2. Media capability negotiation: Agrees on codecs and media parameters using SDP (Session Description Protocol).
  3. Session management: Supports setup, rejection, hold, transfer, and new media streams.

Basic Call Setup Scenario

When Alice (167.180.112.24) calls Bob (193.64.210.89), the signaling and media flow look like this:

Alice 167.180.112.24 Bob 193.64.210.89 INVITE (Port 5060, SDP: PCM, Port 38060) (Ringing) 200 OK (Port 5060, SDP: GSM, Port 48753) ACK (Port 5060) RTP Media Stream SIP signaling RTP media stream
  1. INVITE: Alice supplies her media address, port, and codec.
  2. 200 OK: Bob returns his media address, port, and codec.
  3. ACK: Alice confirms setup.
  4. Data transfer: Endpoints exchange RTP media.

SIP Server Architecture

In real-world networks, users move between addresses and networks, so SIP needs servers that can locate and route calls.

1 / 5

  • SIP Registrar
    Keeps track of where users are currently reachable and returns their current address when asked.
  • SIP Proxy
    Receives the call, queries the registrar, and forwards the request to the callee.

SIP vs. H.323

H.323 is another signaling/communication protocol suite for real-time multimedia communication.

FeatureSIP (Session Initiation Protocol)H.323
Standardization bodyIETFITU-T
Design philosophyModular; follows KISS (Keep It Simple Stupid).Complete, vertically integrated suite.
SyntaxText-based HTTP-like syntax.Binary ASN.1 encoding.
FlexibilityCombines with web protocols and generic transport.Rigid admission and control state machines.
Written by September 16, 2026 4 min read
Was this helpful?