Voice over IP (VoIP) enables real-time, interactive voice communications over packet-switched IP networks. Because human conversation requires tight feedback loops, VoIP demands low end-to-end latency and specialized playout algorithms.
Conversational Performance Requirements
The end-to-end delay consists of sender packetization delay, network propagation and queuing delay, and receiver playout buffering delay.
- : Excellent quality; imperceptible delay to human callers.
- : Acceptable quality, though slight conversational interference may be felt.
- : Unacceptable; impairs interactive conversation.
Traffic Model: Talk Spurts and Silence Periods
Conversational voice alternates between active talk spurts and silent periods (pauses between words/sentences).
- During talk spurts, audio is sampled and packetized into fixed chunks (typically of audio).
- At PCM coding, a chunk contains of audio payload.
- Packets are generated and transmitted every during active periods. Silence suppression avoids sending packets during idle periods to save bandwidth.
Packet Loss in VoIP
A packet is considered lost in VoIP under two conditions:
- Network Loss: IP datagram is dropped by intermediate routers due to queue buffer overflow.
- Delay Loss: Datagram arrives at the receiver after its scheduled playout deadline.
Depending on the voice codec and loss concealment algorithm, VoIP applications can tolerate packet loss rates between 1% and 10%.
Receiver Playout Strategies
Network jitter causes packets sent at uniform intervals to arrive with variable spacing. The receiver uses a playout buffer to smooth out jitter.
Fixed Playout Delay
The receiver delays the playout of every chunk by a fixed duration relative to its generation timestamp .
- A chunk generated at timestamp is played out at time .
- Any chunk arriving after is discarded as a delay loss.
- Trade-off
Larger reduces delay loss but increases conversational latency.
Adaptive Playout Delay
To optimize latency, adaptive playout algorithms dynamically adjust the playout delay at the beginning of each talk spurt.
-
Network Delay Estimation:
The receiver calculates an Exponentially Weighted Moving Average (EWMA) of the network delay for packet : where is the arrival time, is the sending timestamp, and . -
Jitter Estimation:
The receiver estimates average delay variation : where . -
Playout Computation:
For the first packet in a talk spurt, playout deadline is set to: where (typically ) ensures a high probability of on-time arrival. -
Talk Spurt Adjustment:
Subsequent packets in the same talk spurt are played out at intervals of relative to . Playout delay changes only during silent periods, which are slightly compressed or elongated imperceptibly.
Loss Recovery Mechanisms
Because retransmission protocols like TCP add full Round-Trip Times (RTTs), VoIP applications use forward recovery mechanisms over UDP.
Forward Error Correction (FEC)
1. Simple XOR FEC
For every group of original audio chunks, the sender generates a redundant chunk by XORing the chunks. The sender transmits packets.
- Bandwidth overhead increases by a factor of .
- If at most one chunk in the group of is lost, the receiver reconstructs it.
- Introduces playout delay equal to chunk durations.
2. Piggybacked Lower-Quality FEC
The sender piggybacks a lower-resolution version of previous chunks along with the current primary chunk.
- Example
Primary stream uses PCM; redundant stream attaches GSM audio of packet to packet . - If packet is lost, the receiver plays back the GSM version received in packet .
- Non-consecutive packet drops are concealed with minimal quality loss.
Packet | Primary (PCM) | Piggybacked (GSM) | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Packet i-1 | Chunk i-1 | Chunk i-2 | |||||||||||||||||||||||||||||
Packet i | Chunk i | Chunk i-1 | |||||||||||||||||||||||||||||
Interleaving
Instead of adding redundant bits, interleaving splits audio chunks into smaller units and shuffles them across different packets.
- If a packet is lost in transit, the loss is spread across multiple chunks as tiny missing fragments rather than losing an entire continuous chunk.
- Human perception easily bridges small isolated gaps.
- Advantage
Zero bandwidth overhead. - Disadvantage
Increases playout buffering delay proportional to the interleaving depth.
Peer-to-Peer VoIP: Skype
Skype relies on a proprietary peer-to-peer (P2P) network architecture to scale global voice and video calls.
- Skype Clients (SC)
Standard user endpoints running the Skype application. - Supernodes (SN)
Well-connected peers with public IP addresses and high bandwidth that execute routing and directory lookup functions. - Login Server
Centralized server used strictly for user authentication and user-to-IP directory mapping.
The directory data of online users is distributed across the Supernode overlay in Skype. Each client also keeps a local host cache (a list of reachable Supernode IP:port pairs) that it uses to connect to the overlay.
Call Setup and Directory Lookup
- Client connects to a known Supernode via TCP.
- Client authenticates with the central Skype Login Server.
- To place a call, SC queries the SN overlay network to locate the current IP address of the callee.
- Once the callee’s IP address is retrieved, a direct peer-to-peer audio stream is established. Calls are not routed through the Supernodes - they are used only to find the callee.
NAT Traversal Using Relays
When both caller and callee are behind Network Address Translation (NAT) devices or firewalls that reject incoming unsolicited UDP/TCP connections, direct P2P connection fails.
NAT prevents outside peer from initiating connection directly to insider peer who’s behind the NAT.
Relay Solution:
- Both clients establish outbound TCP/UDP connections to a mutually accessible Supernode acting as a relay.
- Audio and video traffic is routed through the relay Supernode, enabling seamless calls across restrictive NAT boundaries.