videocalling
RTP (Real-time Transport Protocol)

RTP (Real-time Transport Protocol)

協定

The standard network protocol for delivering audio and video over IP networks.

What is RTP?

The Real-time Transport Protocol (RTP) is the standard internet protocol for delivering real-time streaming media (audio and video). It provides end-to-end network transport functions suitable for applications transmitting real-time data.

How RTP Works

RTP usually runs over UDP (User Datagram Protocol) because speed is more critical than reliability for live media. It adds a small header to each data packet containing:

  • Sequence Number: Allows the receiver to put packets back in the correct order and detect packet loss.
  • Timestamp: Allows the receiver to play back audio and video in the correct timing (synchronization) and calculate jitter.
  • Payload Type: Tells the receiver which codec (e.g., Opus, VP8) to use to decode the data.

RTP vs. RTCP

RTP is almost always used alongside RTCP (RTP Control Protocol). While RTP carries the actual media streams, RTCP monitors transmission statistics and Quality of Service (QoS) and aids synchronization of multiple streams.

RTP in WebRTC

WebRTC uses a secure version called SRTP (Secure Real-time Transport Protocol). SRTP encrypts the RTP payload, ensuring that no one can eavesdrop on your call, while preserving the header information needed for routing.