SIP Fundamentals
RTP and RTCP
RTP (RFC 3550) carries the actual audio/video payload between endpoints. RTCP is the companion protocol that reports stats (packet loss, jitter, round-trip time) on the same media stream. Both run on UDP, traditionally on ports 16384-32767.
RTP header anatomy
- Version: always 2.
- Payload Type (PT): 7 bits indicating codec (0=PCMU, 8=PCMA, 9=G722, 101=DTMF, etc.).
- Sequence number: increments by 1 per packet — lets the receiver detect loss.
- Timestamp: media-clock units (8000 for narrowband audio).
- SSRC: source identifier (random 32-bit per stream).
- Payload: 20ms of audio (for G.711, 160 bytes).
RTCP
RTCP runs on RTP_port+1 (or muxed via a=rtcp-mux). It carries:
- SR (Sender Report): packet count, byte count, NTP timestamp.
- RR (Receiver Report): jitter, packet loss, round-trip time.
- BYE: source leaves the session.
Use RTCP RR to diagnose call quality. If jitter > 30ms or loss > 2%, audio quality degrades.
SRTP
SRTP (RFC 3711) is RTP encrypted with AES-CTR and authenticated with HMAC-SHA1. Keys come from DTLS-SRTP (modern) or SDES (legacy). Visible on the wire as UDP/TLS/RTP/SAVP in SDP.
Related terms
SDP (Session Description Protocol)
DTLS-SRTP (Encrypted Media Keying)
SRTP (Secure RTP)
SDES (a=crypto SRTP keying)
G.711 (mu-law and A-law)
Opus
Ready to get a number?
Pick a DID in 130+ countries from $1.99/month. Activates instantly on most numbers.