Tip: type a SIP code like 488, or a problem like one-way audio. Use ↑ ↓ and Enter.

Call quality

VoIP QoS Explained: DSCP Markings and How to Prioritise Voice

On this page
  1. Where QoS makes a difference
  2. Marking, queuing and shaping
  3. DSCP values for voice, video and data
  4. Trust boundaries and re-marking
  5. Priority queuing for voice
  6. Shape just below the real line rate
  7. What happens to DSCP on the internet
  8. Wi-Fi: WMM and the voice access category
  9. Voice VLANs
  10. Verify that QoS is working

QoS for VoIP means marking voice packets (DSCP EF, value 46) and then making the device in front of your slowest link send those packets first. It only helps where packets queue up, which on most business networks is the internet uplink, so the work happens on your own router and switches, not on the internet.

Where QoS makes a difference

A queue only forms when packets arrive faster than an interface can send them. A gigabit LAN rarely congests; the WAN edge does all the time. When a 1 Gbps LAN feeds a 20 Mbps upload and someone starts a cloud backup, the upload queue fills and every voice packet waits behind bulk data. That wait is heard as jitter, and when the buffer overflows, as packet loss.

Upload is usually the problem: it is the smaller direction on asymmetric services, and the one you fully control, because your router decides what leaves the building first. Download congestion happens inside your ISP's equipment, where your markings are not used. Queues also build on busy switch uplinks, on Wi-Fi and in firewalls short of CPU.

Marking, queuing and shaping

QoS is three separate jobs. Confusing them is the usual reason a network with "QoS enabled" still has choppy calls.

  • Marking labels each packet with a class: for IP, the 6-bit DSCP field in the IPv4 ToS byte or the IPv6 Traffic Class. On its own it changes nothing; it is a note to the next device.
  • Queuing decides which packet leaves an interface next when there is a backlog. The classic design is a strict priority queue for voice and fair queues for everything else.
  • Shaping holds traffic to a set rate by buffering the excess, which lets you move the WAN queue into your own router. Policing is the blunt alternative: excess traffic is dropped or re-marked instead of delayed.

DSCP values for voice, video and data

These are the values most voice networks use. Some devices ask for the whole ToS byte instead of DSCP. The ToS value is DSCP × 4, which is why EF appears as 184 or 0xB8 in some settings screens and in tcpdump output.

TrafficClass (PHB)DSCPToS byteTreatment
RTP voice (audio)EF46184 (0xB8)Strict priority queue, capped
SIP signallingCS32496 (0x60)Guaranteed bandwidth, not priority
SIP signalling (alternative)AF3126104 (0x68)Guaranteed bandwidth, not priority
Interactive videoAF4134136 (0x88)Guaranteed bandwidth
Bulk or scavengerCS1832 (0x20)Whatever is left over
Everything elseCS0 / default00 (0x00)Best effort, fair queue

For signalling, RFC 4594 (the IETF's DiffServ guidelines) suggests CS5, while much vendor guidance uses CS3 or AF31. Any works if the whole network agrees. Keep SIP out of the strict-priority queue: it is bursty and needs protection from drops, not the lowest latency.

Trust boundaries and re-marking

Something must set DSCP, and each device on the path decides whether to believe it. Where you start believing markings is the trust boundary.

  • Phones mark their own traffic. Desk phones have separate DSCP settings for RTP and SIP, commonly 46 and 24 or 26; check yours. The PBX or SBC should mark what it sends too.
  • Windows softphones need a policy. Windows generally ignores DSCP that applications set themselves, so create a policy-based QoS rule (Group Policy) matching the softphone or its ports.
  • Switches trust, re-mark or clear. Trust ports facing phones and the PBX and re-mark everything else to 0, or a PC can mark its downloads EF and jump the queue. Some switches trust only when they detect a phone.
  • Watch for silent clearing. On some managed switches, globally enabling QoS makes every port untrusted and rewrites DSCP to 0 until you configure trust. If voice leaves the phone as 46 and reaches the router as 0, suspect a switch in between.
  • Re-mark by address when you cannot trust the endpoint. On the router, match traffic to and from your PBX or SIP provider and set EF yourself. This also catches devices that never mark.

Priority queuing for voice

Low Latency Queuing (LLQ) combines a strict priority queue with weighted queues for other classes. Voice always goes first, waiting only for the packet already being sent. The priority queue is capped so a misbehaving device cannot starve the link: during congestion, priority traffic over the cap is dropped. Cisco's long-standing guidance is to keep strict-priority traffic to about a third of the link.

Size the cap from peak concurrent calls × per-call bandwidth, plus headroom: twenty G.711 calls is about 1.75 Mbps on Ethernet. Use the VoIP bandwidth calculator to include PPPoE, VLAN or VPN overhead.

Shape just below the real line rate

A router with a 1 Gbps port to a fibre ONT on a 50/20 Mbps service never fills its own interface; the queue forms upstream, in equipment that ignores your rules. So marking and queuing alone achieve nothing there. Shape outbound traffic to slightly less than the real upload rate, so your router becomes the bottleneck and owns the queue.

  1. Measure sustained upload throughput at quiet and busy times; use the measured rate, not the advertised one.
  2. Set the shaper to around 85–95% of that figure. Lower is safer but wastes capacity; if latency still climbs under load, go lower.
  3. Inside the shaper, put RTP in the priority class, SIP in a guaranteed class and everything else in a fair queue.
  4. For downloads, shaping inbound traffic slightly below the download rate works indirectly: delaying excess TCP traffic makes senders slow down, draining the ISP's queue. It is less precise, and useless against a UDP flood.

On Linux-based routers and OpenWrt, SQM with fq_codel or CAKE controls bufferbloat well inside a shaper, and CAKE's diffserv4 mode puts EF traffic in its voice tin.

Example: Cisco IOS hierarchical policy

The parent policy shapes to 18 Mbps (about 90% of a measured 20 Mbps upload) and the child queues inside it. Syntax varies by platform and release.

class-map match-any VOICE
 match dscp ef
class-map match-any SIGNALLING
 match dscp cs3 af31
!
policy-map WAN-CHILD
 class VOICE
  priority percent 30
 class SIGNALLING
  bandwidth percent 5
 class class-default
  fair-queue
!
policy-map WAN-SHAPER
 class class-default
  shape average 18000000
  service-policy WAN-CHILD
!
interface GigabitEthernet0/0/0
 service-policy output WAN-SHAPER

Example: MikroTik RouterOS sketch

Mangle rules turn DSCP into packet marks, and an HTB queue tree on the WAN interface shapes and prioritises. HTB is not strict priority, but a guaranteed rate (limit-at) plus the top priority gives voice first claim. Replace ether1 with your WAN interface (for example pppoe-out1).

/ip firewall mangle
add chain=postrouting out-interface=ether1 dscp=46 action=mark-packet new-packet-mark=voice passthrough=no
add chain=postrouting out-interface=ether1 dscp=24 action=mark-packet new-packet-mark=sip passthrough=no
add chain=postrouting out-interface=ether1 dscp=26 action=mark-packet new-packet-mark=sip passthrough=no
add chain=postrouting out-interface=ether1 action=mark-packet new-packet-mark=bulk passthrough=no
/queue tree
add name=wan-up parent=ether1 max-limit=18M
add name=voice parent=wan-up packet-mark=voice priority=1 limit-at=3M max-limit=18M
add name=sip parent=wan-up packet-mark=sip priority=2 limit-at=256k max-limit=18M
add name=bulk parent=wan-up packet-mark=bulk priority=8 max-limit=18M

If FastTrack is enabled, fasttracked connections skip the mangle rules, so voice never gets its mark. Exclude voice from the FastTrack rule, or disable FastTrack.

What happens to DSCP on the internet

Once packets reach the public internet, assume the markings are ignored: ISPs commonly reset DSCP to 0 or carry it unused. QoS still pays off because it fixes the part you own, the uplink queue, where most VoIP jitter on business connections starts.

The exceptions are private WANs (MPLS and some SD-WAN services) and ISPs that sell voice with the access line, which may honour or map your markings by contract; ask for their class mapping and mark to match. Check tunnels too: IPsec normally copies DSCP to the outer header, but not every VPN does by default.

Wi-Fi: WMM and the voice access category

Wi-Fi has its own prioritisation, WMM (based on IEEE 802.11e), with four access categories: voice (AC_VO), video (AC_VI), best effort (AC_BE) and background (AC_BK). Higher categories wait less before transmitting, so they win more airtime.

Access points map DSCP to a Wi-Fi user priority, and that to an access category. A common shortcut copies the top three bits of DSCP, which turns EF (46) into user priority 5, and user priority 5 sits in the video category, not voice. RFC 8325 recommends mapping EF to user priority 6 (AC_VO). If your AP lets you edit the map, check where 46 lands.

WMM cannot fix weak coverage or a crowded channel. Prefer 5 GHz and design for strong signal; many vendor voice design guides target −67 dBm or better.

Voice VLANs

A voice VLAN is not QoS, but it makes QoS easier: you can trust markings per VLAN and give phones their own DHCP scope and firewall rules. Phones usually learn the VLAN through LLDP-MED, where the switch advertises the voice VLAN ID, 802.1p priority (commonly 5) and DSCP (46); through CDP on Cisco networks; or through a vendor-specific DHCP option (132 is common) that tells a phone booting in the data VLAN to move. Small sites can set it in the provisioning file.

Verify that QoS is working

  1. Check markings hop by hop. Capture at the phone's switch port, on the router's LAN side and on its WAN side. In Wireshark, filter with ip.dsfield.dscp == 46, or right-click the DSCP field and choose Apply as Column. With tcpdump -v, EF packets show tos 0xb8. The SIP capture guide covers where to capture.
  2. Send a marked test stream. On Linux, ping -Q 184 host sends ICMP marked EF, which helps find the device that clears markings.
  3. Test under load. Hold a call, saturate the upload with a large transfer, and record jitter and loss from the phone's call statistics, with QoS off and then on. Enter both sets of figures in the MOS calculator to compare.
  4. Read the queue counters. Drops in the voice class mean its cap is too small.

If latency still climbs under load with the shaper on, the shaper rate is above the real bottleneck; lower it in steps until ping times stay flat during a full upload. For measuring the results in detail, see jitter, latency and packet loss explained.

Try the MOS Call Quality Estimator

Estimate MOS and R-factor from latency, jitter, packet loss and codec, with tips to fix bad calls.

Keep reading