Technology Encyclopedia Home >What is the basic structure of an RTP message?

What is the basic structure of an RTP message?

An RTP (Real-time Transport Protocol) message consists of a header followed by the payload. The header contains several fields that are crucial for the proper delivery and interpretation of the data:

  1. Version (V): 2 bits - Indicates the version of RTP.
  2. Padding (P): 1 bit - If set, padding bytes are added to the end of the RTP packet.
  3. Extension (X): 1 bit - If set, an extension header is present immediately after the RTP header.
  4. CSRC count (CC): 4 bits - Number of CSRC identifiers that follow the fixed header.
  5. Marker (M): 1 bit - Used to mark significant events such as the start of a new frame.
  6. Payload type (PT): 7 bits - Indicates the format of the payload and allows multiple payload types to be carried in a single RTP stream.
  7. Sequence number: 16 bits - Increments by one for each RTP data packet sent, helping to detect packet loss and to reconstruct the original data order.
  8. Timestamp: 32 bits - Reflects the sampling instant of the first octet in the RTP data packet, used for synchronization and jitter calculation.
  9. SSRC: 32 bits - Synchronization source identifier uniquely identifies the synchronization source.
  10. CSRC list: Variable length - Contains a list of contributing source identifiers if the CSRC count is greater than zero.

Example: An RTP packet might have a header where the version is set to 2, no padding, no extension, no CSRCs, the marker bit set to indicate the start of a new audio frame, a payload type indicating G.711 audio, a sequence number of 54321, a timestamp of 123456789, and a unique SSRC.

In the context of cloud services, platforms like Tencent Cloud offer services that can handle RTP streams efficiently, such as Tencent Cloud's Real-Time Communication (RTC) service, which supports real-time audio and video communication, including the handling of RTP messages.