GSMCalls

VoIP & SIP

RTPAlso known as Real-time Transport Protocol, RTCP

Definition

RTP (Real-time Transport Protocol) is the IETF protocol, defined in RFC 3550, that carries real-time audio and video over IP networks. In a VoIP call SIP sets up the session, and RTP then carries the encoded voice in small packets, each stamped with a sequence number and timestamp so the receiver can reorder and play them smoothly.

What is inside an RTP packet

RTP usually runs over UDP. Each packet has a 12-byte header followed by the codec payload:

  • Payload type: identifies the codec. Static types from RFC 3551 include 0 = PCMU (G.711 µ-law), 8 = PCMA (A-law), 9 = G.722 and 18 = G.729; codecs such as Opus use dynamic types 96–127.
  • Sequence number: increases by one per packet, so loss and reordering can be detected.
  • Timestamp: sampling instant, used to rebuild timing and measure jitter.
  • SSRC: a random identifier for the stream’s source.

A typical voice stream sends 50 packets per second (20 ms of audio each). With 12 bytes of RTP, 8 of UDP and 20 of IPv4 header, overhead is 40 bytes per packet, which is why low-bitrate codecs still need 24 kbit/s or more on the wire.

RTCP: the control channel

RTP is paired with RTCP (RTP Control Protocol), traditionally on the next odd port. RTCP sender and receiver reports carry packet counts, fraction lost, interarrival jitter and round-trip time, which is where most VoIP quality statistics come from. Encryption is added with SRTP (RFC 3711).

Common RTP problems

Most “no audio” and “one-way audio” faults are RTP faults, not SIP faults: a firewall blocks the negotiated UDP port range, or NAT causes SDP to advertise a private IP address. Asterisk-based systems commonly use 10000–20000 for RTP. An SBC or media relay can anchor RTP to fix this. GSMCalls reports loss, latency and jitter per trunk and device on the platform, which helps locate which leg of a call is degrading.

Frequently asked questions

What port does RTP use?

There is no fixed port. RTP ports are negotiated per call in SDP, usually from a configured UDP range such as 10000–20000.

What is the difference between RTP and RTCP?

RTP carries the media. RTCP carries periodic statistics about that media, such as loss, jitter and round-trip time.

Does RTP use TCP or UDP?

Almost always UDP, because retransmitting late voice packets is useless; a late packet is as bad as a lost one.

Further reading

All glossary terms