VoIP Infrastructure Guide
VoIP QoS Configuration
8 min read · Updated April 2026
VoIP quality problems on shared networks — jitter, packet loss, choppy audio — are almost always fixed by QoS. Quality of Service prioritizes voice packets over data so calls get through cleanly even when the network is busy.
1. Why VoIP needs QoS
VoIP is extremely sensitive to network conditions. RTP packets must arrive within tight timing windows — jitter above 40ms causes audio degradation, and packet loss above 1% causes choppy calls. On a shared network without QoS, a single large file transfer or video stream can starve voice traffic and destroy call quality.
QoS solves this by marking voice packets with a high-priority DSCP value and configuring routers to serve those packets first, before data traffic. Even on a congested network, voice gets through.
2. DSCP EF marking for VoIP
DSCP (Differentiated Services Code Point) is a 6-bit field in the IP header that marks packet priority. For VoIP:
| Traffic Type | DSCP Class | DSCP Value | Binary |
| RTP media (voice/video) | EF (Expedited Forwarding) | 46 | 101110 |
| SIP signaling | CS3 or AF31 | 24 or 26 | 011000 |
| General data | BE (Best Effort) | 0 | 000000 |
Mark RTP traffic on Linux/Asterisk
; Mark outbound RTP with DSCP EF (46)
iptables -t mangle -A OUTPUT -p udp --sport 10000:20000 -j DSCP --set-dscp 46
iptables -t mangle -A OUTPUT -p udp --dport 10000:20000 -j DSCP --set-dscp 46
; Mark SIP signaling with CS3 (24)
iptables -t mangle -A OUTPUT -p udp --sport 5060 -j DSCP --set-dscp 24
iptables -t mangle -A OUTPUT -p tcp --sport 5061 -j DSCP --set-dscp 24
Mark in Asterisk directly
; In asterisk.conf
[options]
tos_sip=cs3 ; DSCP for SIP signaling
tos_audio=ef ; DSCP for RTP audio
tos_video=af41 ; DSCP for RTP video
cos_sip=3 ; 802.1p CoS for SIP
cos_audio=5 ; 802.1p CoS for audio
3. Priority queuing strategies
LLQ (Low Latency Queuing) — recommended for VoIP
LLQ gives a strict priority queue for EF traffic. Voice packets are always served before data. The voice queue has a bandwidth guarantee and a maximum to prevent it from starving data entirely.
; Cisco IOS — LLQ for VoIP
policy-map VOIP-QOS
class VOIP-RTP
priority 512 ! Strict priority, 512 kbps guaranteed
class VOIP-SIP
bandwidth 64 ! Guaranteed bandwidth for signaling
class class-default
fair-queue ! WFQ for everything else
class-map VOIP-RTP
match dscp ef
class-map VOIP-SIP
match dscp cs3
tc/HTB on Linux
; Linux traffic control — priority queue for VoIP
tc qdisc add dev eth0 root handle 1: htb default 30
tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit burst 15k
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 10mbit burst 15k prio 1 ; Voice
tc class add dev eth0 parent 1:1 classid 1:30 htb rate 90mbit burst 15k prio 3 ; Data
tc filter add dev eth0 parent 1: prio 1 u32 match ip dscp 0x2e 0xfc flowid 1:10
4. VLAN separation for VoIP
Putting voice on a dedicated VLAN is the most reliable QoS approach — it physically separates voice traffic from data at the switch level, not just at the router.
- Create a dedicated Voice VLAN (e.g., VLAN 10) on your switches
- Configure IP phones to use the Voice VLAN (most phones auto-detect via LLDP/CDP)
- Set 802.1p CoS=5 on the Voice VLAN for layer 2 priority
- Configure inter-VLAN routing with QoS policies on the router/L3 switch
- Ensure PBX has a NIC on the Voice VLAN or a trunk port with both VLANs
; Cisco switch — voice VLAN configuration
interface FastEthernet0/1
switchport mode access
switchport access vlan 20 ! Data VLAN for PC
switchport voice vlan 10 ! Voice VLAN for phone
spanning-tree portfast
5. WAN QoS for VoIP
WAN links are where QoS matters most — they're typically the bottleneck. Key principles:
- Bandwidth allocation — reserve 20-30% of WAN bandwidth for voice, never more than 75% of total
- Each G.711 call uses ~87 kbps (including IP/UDP/RTP overhead). G.729 uses ~32 kbps.
- Upload is often the limiting factor — asymmetric internet links have less upload bandwidth
- Apply QoS before the bottleneck — mark and queue on the LAN side of the WAN router, not after
For SD-WAN deployments, most platforms have voice-aware QoS policies built in. Configure the voice application category to use EF marking and strict priority delivery.
6. Verifying QoS is working
; Check DSCP marking on outbound packets
tcpdump -i eth0 -n -v udp port 10000 | grep "tos"
; Look for: tos 0xb8 (= DSCP EF decimal 46, hex 2e, shifted left 2 = 0xb8)
; Verify queue statistics
tc -s qdisc show dev eth0
; Check Asterisk DSCP settings
asterisk -r
core show settings | grep -i tos
The key test: run a speed test while on a VoIP call. With QoS properly configured, the call should remain clear even at 100% bandwidth utilization. Without QoS, the call will degrade or drop.
Frequently asked questions
What DSCP value should I use for VoIP?
Use DSCP EF (Expedited Forwarding, value 46) for RTP media packets and DSCP CS3 (value 24) or AF31 (value 26) for SIP signaling. DSCP EF ensures voice packets get strict priority treatment in router queues. In Asterisk set tos_audio=ef in asterisk.conf. In Linux use iptables mangle to mark UDP packets in the RTP port range with DSCP 46.
How much bandwidth does a VoIP call use?
A G.711 (PCMU/PCMA) VoIP call uses approximately 87 kbps per call including IP, UDP, and RTP headers. G.729 uses approximately 32 kbps per call. Opus at full quality uses around 510 kbps but can be configured as low as 6 kbps. For QoS planning, calculate concurrent calls times per-call bandwidth and reserve that plus 20% headroom on your WAN link.
What is the difference between DSCP and 802.1p QoS?
DSCP operates at Layer 3 (IP header) and is preserved end-to-end across routed networks. 802.1p CoS operates at Layer 2 (Ethernet frame) and only applies within a switched VLAN segment — it is stripped at router boundaries. For VoIP, use both: 802.1p CoS=5 for within the LAN/VLAN, and DSCP EF=46 for WAN and routed segments.
Getting jitter or packet loss on VoIP calls?
Upload your PCAP to SIPSymposium. The analyzer extracts RTCP reports, measures jitter and packet loss, and identifies whether the issue is network congestion that QoS would fix.