Real-time Transport Protocol

The Real-time Transport Protocol (RTP) is a standard network protocol designed to deliver streaming audio and video, as well as other real-time data, over IP networks like the internet.

Here's a breakdown of its key aspects:

  1. Purpose: RTP's main goal is to provide end-to-end delivery services for data with real-time characteristics. It handles the specific needs of continuous media streams, such as telephony, video conferencing, and streaming services.
  2. Functionality: It doesn't guarantee timely delivery or quality of service itself (that depends on the underlying network), but it provides the mechanisms needed by applications to handle real-time data:
    • Sequence Numbering: Each RTP packet has a sequence number. This allows the receiver to detect lost packets and reorder packets that arrive out of sequence.
    • Timestamps: Each packet has a timestamp indicating the sampling instant of the first piece of data in the packet. This allows the receiver to reconstruct the original timing, synchronize different media streams (like audio and video), and compensate for network jitter (variations in packet arrival delay).
    • Payload Type Identification: A field in the RTP header identifies the type of codec (e.g., H.264 for video, Opus or G.711 for audio) used for the data in the packet. This allows the receiver to use the correct decoder.
    • Source Identification (SSRC): Identifies the source of the RTP stream.
  3. Transport: RTP itself typically runs on top of the User Datagram Protocol (UDP). UDP is preferred over TCP for real-time applications because its lower overhead and lack of retransmission delays are better suited for media streams where occasional packet loss is often less disruptive than the delays caused by TCP's guaranteed delivery mechanisms.
  4. RTCP (Real-time Transport Control Protocol): RTP is almost always used in conjunction with RTCP. While RTP carries the actual media data, RTCP is used to send control information about the session and the data transmission. This includes:
    • Feedback on the quality of service (e.g., statistics on packet loss, jitter, round-trip delay time).
    • Session control information (e.g., participant identification). RTP and RTCP typically use adjacent UDP ports (RTP on an even port number, RTCP on the next higher odd port number).
  5. Applications: RTP/RTCP is a fundamental building block for many internet communication systems, including:
    • Voice over IP (VoIP) systems
    • Video conferencing applications (like Zoom, Teams, Google Meet)
    • IPTV and other media streaming services
    • WebRTC (Web Real-Time Communication)

In essence, RTP provides the standard packet format and necessary header information for sending real-time data, while RTCP provides feedback and control for managing the session quality. It's defined by the Internet Engineering Task Force (IETF) in RFC 3550.