Home › Topics › QoS: Designing, Verifying & Monitoring It › DSCP in the Wild

DSCP Markings in the Wild: Where They Get Set, Stripped, and Ignored


Here is the most common QoS ticket in existence. Someone configured priority queuing on the WAN router. The phones are supposedly marking their audio as high priority. And yet the router's counters show every single packet landing in the best-effort class. "We configured QoS and nothing is marked." Nobody did anything wrong, exactly; the marking simply did not survive the trip.


A DSCP marking is a label inside each packet. Like the sticker on a parcel it can be applied, ignored, peeled off, or replaced by anyone who handles the parcel along the way. This guide follows that sticker through a real network. It covers who puts it on, which devices believe it, and which quietly reset it to zero. It also shows how to prove what is happening with a packet capture at a few well-chosen points. By the end, "nothing is marked" will be a ten-minute diagnosis instead of a week of argument. If the four QoS jobs (classify, mark, queue, shape) are new to you, read QoS in Plain Language first.


In this guide

  • The sticker on the parcel: what DSCP actually is
  • Who sets the mark
  • Trust boundaries: the classic "nothing is marked" mystery
  • Where marks get stripped or ignored
  • Verifying marks with a capture
  • Common mis-markings
  • Where to check along the path
  • Where to go next

The sticker on the parcel: what DSCP actually is


Every IP packet carries one byte near the front of its header that was originally called Type of Service. In IPv6 the same byte is called Traffic Class. Six of its eight bits are the Differentiated Services Code Point, DSCP. It holds a value from 0 to 63 describing how the packet would like to be treated. The remaining two bits belong to a different mechanism (congestion notification) and are not part of the mark. Because the field lives in the IP header, it travels with the packet across every router on the path. That is what makes it useful and what makes it vulnerable, since every router can rewrite it.


Tools show the same mark in different costumes, and the costume change confuses everyone at least once. A settings page shows the DSCP name or decimal value (EF, or 46). A capture tool often shows the whole byte in hexadecimal. Because the DSCP bits sit at the top of the byte, the byte value is the DSCP value multiplied by four. EF is 46, binary 101110, which as a byte is 10111000, or 0xb8. Keep this table nearby:


NameDSCP (decimal)DSCP (binary)Whole byte in hexTypical use
EF461011100xb8Voice audio
AF41341000100x88Interactive video
AF31260110100x68Business-critical data
CS3240110000x60Call signaling
CS180010000x20Scavenger (backups, updates)
Default00000000x00Best effort — and what "stripped" looks like

A mark by itself does nothing. It is a request, and it only means something where a device has been told to read it and act on it. That is why "we configured QoS" and "the packets are marked" are two different claims, verified separately.


Who sets the mark


Three kinds of things write DSCP values, and the last writer wins.


  • Endpoints that mark themselves. Desk phones almost always mark their audio EF and their call signaling CS3 or similar, because they know what they are. Video systems and conferencing applications often mark too. On a general-purpose computer, though, this depends on the operating system. Some operating systems only honor an application's requested marking when an administrator policy allows it. Backup software almost never marks itself, which is a pity, because it is the traffic you most want labeled "lose me first."
  • Switches marking by policy. An access switch can write a mark based on where a packet came from. For example, everything from the voice VLAN becomes EF. Everything from the port the backup server is on becomes CS1. This is the most reliable place to mark, because the switch does not care what the endpoint thinks.
  • Routers and firewalls marking by rule. At the WAN edge a device can classify on addresses and ports and write a mark before queuing. It is the last-resort marker, and the place where over-broad rules do the most damage.

There is an important distinction between a device that marks and a device that trusts. A marking device overwrites whatever value arrived. A trusting device keeps it. A device that does neither either passes marks through untouched or resets them to 0, depending on its design and settings. Here is the practical rule. Pick one place to be the source of truth for each class. Write it down. And make every device between that point and the congested link trust it.


Trust boundaries: the classic "nothing is marked" mystery


A trust boundary is the point where your network decides to believe the sticker. Inside the boundary, marks are honored. Outside it, they are rewritten. The reason for the boundary is not paranoia. If every port trusted every mark, any laptop on the network could label its file-sharing traffic EF and jump the queue ahead of the phones. So the sensible design is that ports facing devices you control (phones, your own switches, servers you configured) trust the mark. In that design, ports facing user PCs, guests, and anything you did not set up rewrite it to 0.


Now the mystery. On a number of switch platforms, enabling QoS at all changes the default behavior of every port from "pass marks through untouched" to "untrusted: rewrite to 0." Before you enabled QoS, the phones' EF marks sailed through the switch simply because nothing was looking at them. After you enabled QoS, the switch started looking, found ports it had not been told to trust, and dutifully zeroed every mark. The phones are still marking. The router still has its priority queue. Between them, the switch is peeling every sticker off. That is the "we configured QoS and nothing is marked" ticket.


The fix is to set trust deliberately, and to remember that the boundary has more than one edge. The port facing the phone must trust. So must the uplink between the access switch and the next switch, and the next, all the way to the device with the queue. A mark that survives the access port and dies at the distribution switch is just as dead. Illustrative configuration (the exact syntax differs on every platform, but the three ideas are universal):


# Port facing a desk phone: believe its marks
interface access-port 12
  qos trust dscp

# Uplink to another switch you manage: keep believing them
interface uplink 1
  qos trust dscp

# Port facing an ordinary user PC: rewrite anything it sends to 0
interface access-port 20
  no qos trust

# Port facing the backup server: do not trust, mark it scavenger instead
interface access-port 30
  qos mark dscp cs1

Some switches offer a conditional form. They trust the port only while a phone is detected on it through a neighbor-discovery protocol. They fall back to untrusted when the phone unplugs and a laptop appears. It is a good option where phones and PCs share ports, but it is one more thing that can silently flip.


Tip: when you enable QoS on a switch for the first time, do it during a window. Immediately capture at the far side of the switch. If the marks that were present before are now 0, you have just found your trust boundary the hard way. In that case, you fix it before the first complaint.


Where marks get stripped or ignored


Untrusted switch ports are the most common sticker-peeler, but far from the only one. Each of the following can quietly turn a mark into 0, replace it, or disregard it.


Internet providers

Most internet providers treat DSCP as advisory at best, and many reset it to 0 at the edge of their network. This matters less than it sounds, because the queue you control is on your router, before the provider ever sees the packet. What you lose is the far end. Packets arrive at the other site marked 0. So the receiving router must classify them by addresses and ports instead. Private WAN services are different. They often honor a small set of classes, but they expect their values. Traffic marked with anything else gets the default treatment. Ask for the provider's class table and map to it at the edge.


VPN tunnels

A tunneled packet has two IP headers: the original inner one, and the outer one that carries it across the internet. After encryption, everything downstream sees only the outer header. So if the outer header says 0, your WAN router's queue sees 0. Many tunnel implementations copy the inner DSCP to the outer header by default. Some do not, and some cloud gateways never do. Two separate fixes exist and you may need both. Enable copying of the inner mark to the outer header. And make sure the device applies its queuing policy at a point where it can still see the inner header. The wider subject of what a healthy tunnel looks like is covered in Monitoring Site-to-Site VPN Tunnels.


Wi-Fi

An access point does not queue by DSCP directly. It translates the DSCP value into one of four wireless traffic categories — voice, video, best effort, background — using a mapping table. The wireless scheduler works with those categories. Two things go wrong. Downstream, the default mapping may not put your values where you expect. Some mappings look only at the top three bits, so an unusual value lands in a surprising category. Upstream, the client device chooses its own category. Many laptop drivers send everything as best effort no matter what the application marked. When the frame returns to the wire, the access point may rewrite the DSCP from the category or leave it alone. Treat every access point as a translation boundary in both directions and check its mapping table.


Virtual switches, hypervisors, and containers

Most virtual switches pass DSCP through untouched, which is fine. Some overlay networks encapsulate traffic between hosts, and the same inner-versus-outer question as VPNs applies. And a virtual machine's operating system can zero an application's marks just like a physical one can. Capture on the physical uplink of the host, not inside the VM, to see what is actually leaving.


Firewalls, proxies, and anything that terminates a connection

Address translation itself does not touch DSCP, but some firewalls have a "normalize" or "clear ToS" option that does, sometimes on by default. Worse is any device that terminates a connection and opens a new one on the other side. Examples include a web proxy, a content filter doing inspection, and a session border controller in front of the phone system. The packets leaving such a device are new packets, created by its own network stack. They carry whatever mark that stack applies — usually 0. The mark was not stripped; it never existed on the far side. Re-mark after the proxy, or exempt real-time traffic from it.


Verifying marks with a capture


All of the above is theory until you look at packets. The method: capture the same traffic at several points along the path and compare the DS field. Where the mark changes is the device that changed it. Useful capture points, in order:


  • At the source. A port mirror of the phone's switch port, or a capture on the PC if the application is doing the marking.
  • LAN side of the WAN router or firewall. A mirror of the port facing it, which tells you whether marks survived the switching layer.
  • WAN side. A capture on the router or firewall itself, or a mirror of its outside port. For tunnels this is where you see the outer header.
  • Far-site LAN. What arrived after the provider and the far-end devices had their say.

A command-line capture tool prints the DS byte in its verbose output. To watch a phone's audio leave the LAN and confirm it is marked EF (0xb8):


tcpdump -ni eth0 -v udp and host 10.10.20.31

12:04:31.118204 IP (tos 0xb8, ttl 64, id 3181, offset 0, flags [DF], proto UDP (17), length 214)
    10.10.20.31.16410 > 10.20.5.10.18072: UDP, length 186
12:04:31.138211 IP (tos 0xb8, ttl 64, id 3182, offset 0, flags [DF], proto UDP (17), length 214)
    10.10.20.31.16410 > 10.20.5.10.18072: UDP, length 186

The tos 0xb8 is the whole byte; consult the table above and that is EF. If the same capture at the LAN side of the router shows tos 0x0, the mark died in the switching layer. To see only marked packets, or only EF, filter on the byte directly. The mask 0xfc ignores the two congestion-notification bits so they cannot confuse the match:


# anything with a non-zero DSCP
tcpdump -ni eth0 'ip[1] & 0xfc != 0'

# only EF (DSCP 46, byte 0xb8)
tcpdump -ni eth0 'ip[1] & 0xfc == 0xb8'

In a graphical analyzer the equivalent display filters are ip.dsfield.dscp != 0 and ip.dsfield.dscp == 46 (for IPv6, ipv6.tclass.dscp). Add the DSCP field as a column and the whole conversation becomes a single glance. If you have never set up a capture or a column before, Wireshark fundamentals covers the mechanics.


Two cautions. A capture on the sending host shows what the operating system handed to the network card, not necessarily what reached the wire. A mirror port shows the wire. And a capture taken on a firewall may run before or after its own marking rules. So when a firewall's capture disagrees with a mirror of its outside port, believe the mirror.


Common mis-markings


Missing marks are one failure. Wrong marks are the other, and they are sneakier, because everything looks configured. These are the ones that turn up again and again:


  • Everything marked EF by an over-eager application. One example is a conferencing client that marks its screen sharing and file transfers EF alongside its audio. Another is a consumer "gaming mode" that marks every packet from a device as top priority. Because the priority queue is capped, this drowns the real voice packets in it; priority-queue drops are the signature.
  • Backups or replication marked high. A well-meaning administrator decides the nightly replication is "important" and marks it AF31. It is important. It is also enormous and indifferent to delay, which is the definition of scavenger traffic. It starves the interactive users the class was created for.
  • Stale address-based rules. A rule marks traffic to the old phone server's address. The server moves, the address is reused by a file server, and file transfers inherit EF. Address-based rules need an owner and a review date.
  • Signaling unmarked. Audio is EF but call-setup traffic is 0. So under load calls sound fine once connected but take ages to ring or fail to set up.
  • Different values for the same class at different sites. One site uses AF31 for business-critical, another uses AF21, and the WAN routers at each end disagree about what arrived. A written class table, identical everywhere, is the cure.
  • Two markers that disagree. The switch marks by VLAN. Then a catch-all rule on the router re-marks "everything else" to 0 and, thanks to a too-broad match, catches the phones as well. The last writer wins, and the last writer is wrong.

Where to check along the path


When a mark goes missing or wrong, walk the path from the source to the congested link and check each device against this table. Most investigations end by the third row.


Point on the pathWhat to look atWhat "wrong" looks likeUsual fix
Endpoint (phone, PC, server)Capture on the host or mirror its portDSCP 0 leaving the sourceApplication or OS policy; or mark at the switch and stop depending on the endpoint
Access switch portPort trust state; per-port QoS counters if offeredMarks present before the switch, gone after itTrust DSCP on ports facing phones and infrastructure
Switch-to-switch uplinksTrust state on both ends of every uplinkMarks survive the access switch, die at the next oneTrust on uplinks too; the boundary has many edges
Wireless access pointDSCP-to-category mapping table; client behavior upstreamCorrect on the wire, wrong category over the air; upstream marks arriving as 0Adjust the mapping; accept that client upstream marking is not fully yours
Router or firewall, LAN sidePer-class match counters; captureA class shows zero matches while the traffic is clearly flowingMarks are not arriving; walk back upstream, or classify by address and port as a fallback
VPN tunnel, outer headerCapture on the WAN sideInner header EF, outer header 0Enable inner-to-outer copying; apply queuing where the inner header is visible
Provider hand-off and far siteCapture on the far-site LANEverything arrives as 0Expected on the internet. Classify by address and port at the far end; ask a private WAN provider which values it honors
Proxy, filter, or session border controllerCapture on both sides of itMarked going in, unmarked coming outRe-mark after the device, or exempt real-time traffic from inspection

One habit makes this table unnecessary most of the time. Use it whenever you add or change a device on the path. That could be a new switch, a firewall replacement, a new access point model, or a new tunnel. Capture before and after and compare the DS field. The device that strips your marks announces itself immediately.


Where to go next


DSCP is a request written into each packet. It is honored only where a device has been told to honor it, and rewritable by every device in between. Marks are set by endpoints, switches, or routers, with the last writer winning. They are reset by untrusted switch ports, most internet providers, and tunnels that do not copy the inner header. They are also reset by proxies that create new packets and Wi-Fi's translation into wireless categories. The only way to know what is on the wire is to capture at more than one point and compare.


With trustworthy marks in hand, the next step in this topic is to build the policy that uses them (Designing a Simple QoS Policy for a Small Network). Then watch the per-class counters that show whether the queues are engaging (Monitoring Queue Drops). And prove the whole chain under load (Proving QoS Works End to End). Everything in this series is gathered on the QoS: Designing, Verifying & Monitoring It pillar page.


Put this into practice with SysPeep Monitor

Verifying DSCP is capture work, and no monitoring tool does it for you. What monitoring does is point your captures at the right place. SysPeep Monitor discovers your switches, routers, and firewalls. It polls interface utilization and discard counters over SNMP. It alerts on the links that actually congest. So you spend your mirror-port time where the queues are.

Download Free TrialLearn About SysPeep