Voice over IP
Follow one phone call over the internet. SIP sets it up through a SIP server: Bob's phone registers, Alice's phone sends INVITE with an SDP offer, Bob's phone rings and answers 200 OK, and ACK confirms. Then the voice goes straight from phone to phone as RTP packets over UDP, one every 20 ms, marked EF so routers send them first, smoothed by a jitter buffer and kept under about 150 ms of delay.
5 quick questions
Pick an answer to see why. Your score saves with your progress.
01What does SIP do in a phone call over IP?
SIP (RFC 3261) is the signalling: INVITE, 180 Ringing, 200 OK, ACK and BYE. The sound itself travels separately, in RTP packets.
02How do the two phones agree on a codec and the port for the sound?
SDP (RFC 8866) describes the media; the offer/answer model (RFC 3264) lets the answer keep only codecs the offer listed, here G.711 µ-law (PCMU).
03Why is voice sent over UDP rather than TCP?
Each RTP packet holds 20 ms of sound that must be played on time. A late packet is as useless as a lost one, so voice prefers speed over resending.
04What does a jitter buffer do?
Packets leave every 20 ms but arrive with uneven gaps (jitter). Holding them, here for 40 ms, lets the phone play one every 20 ms; a bigger buffer smooths more but adds delay.
05About how much one-way delay does ITU-T G.114 recommend staying under for a call?
Above roughly 150 ms one way, people start talking over each other. Packetisation, the network and the jitter buffer all add to it.
Glossary
- VoIP
- Voice over IP: phone calls carried as IP packets instead of over a dedicated phone line.
- SIP
- Session Initiation Protocol: the messages that set a call up and end it (REGISTER, INVITE, 180, 200 OK, ACK, BYE).
- SIP server
- A registrar that remembers where each phone is, and a proxy that forwards call requests to it.
- SDP
- Session Description Protocol: the text inside SIP messages that lists codecs, the address and the port for the sound.
- Codec
- The method that turns sound into bytes and back; G.711 sends 64 kb/s of sound.
- RTP
- Real-time Transport Protocol: carries the sound in small UDP packets with a sequence number and a timestamp.
- Jitter
- Uneven gaps between packet arrivals, although they were sent evenly.
- EF
- Expedited Forwarding, DSCP value 46: a mark that asks routers to send these packets first.
Notes and sources
- Names are RFC 2606 examples; 192.0.2.10, 198.51.100.20, 203.0.113.5 and 192.0.2.1 are RFC 5737 documentation addresses. Tags, Call-ID, SSRC, RTP start values, arrival times, the network delay and the buffer size are illustrative.
- The phones have public addresses here. Behind home NAT a phone's private address in SDP is unreachable, so real phones use STUN and ICE (RFC 8445) or a media relay.
- A real REGISTER is usually challenged first (401 Unauthorized) and repeated with a password digest; SIP over TLS uses port 5061 and SRTP (RFC 3711) encrypts the voice.
- Responses retrace the Via headers through the proxy. ACK and BYE go straight to the other phone because this proxy did not add Record-Route; many do, and then stay in the signalling path.
- DSCP marks are kept only inside networks that agree to honour them; across the public internet they are often ignored or reset.
- RFC 3261: SIP: Session Initiation Protocol
- RFC 8866: SDP: Session Description Protocol
- RFC 3264: An Offer/Answer Model with SDP
- RFC 3550: RTP: A Transport Protocol for Real-Time Applications
- RFC 3551: RTP Profile for Audio and Video Conferences
- RFC 3246: An Expedited Forwarding PHB
- ITU-T G.114: One-way transmission time
- ITU-T G.711: Pulse code modulation of voice frequencies
Quiz Unlocks after the last step.