How to Debug QOS on switches and routers

Hi All,

Is there a simple way to test if a packet keeps its dscp end to end?
For example. How can I see that specific traffic (ip:port) keeps correct tag.
I tried ip flow on the router and mls qos on the switch but this does not always work as expected.

Is there an easy debug to test if traffic returns with correct tag?
If I use ping and set TOS, how can I see the return?

thanks
Steven

Hi Steven,

A simple method to verify this is to do it on a hop-by-hop basis, first from source to destination and then for the return traffic as well. On your routers (and most switches), you can use a policy map with no actions just to use it as a counter:

SW1(config)#class-map EF  
SW1(config-cmap)#match dscp ef

SW1(config)#policy-map COUNTER
SW1(config-pmap)#class EF

SW1(config)#interface GigabitEthernet 0/1
SW1(config-if)#service-policy input COUNTER

And monitor:

SW1#show policy-map interface GigabitEthernet 0/1
 GigabitEthernet0/1 

  Service-policy input: COUNTER

    Class-map: EF (match-all)  
      0 packets, 0 bytes
      5 minute offered rate 0000 bps
      Match:  dscp ef (46)

    Class-map: class-default (match-any)  
      0 packets, 0 bytes
      5 minute offered rate 0000 bps, drop rate 0000 bps
      Match: any

That is a simple way to test it. You can also use the show mls qos command on the 29xx/35xx switches to see incoming marked traffic:

SW1#show mls qos interface FastEthernet 0/1 statistics
FastEthernet0/1 (All statistics are in packets)

  dscp: incoming
-------------------------------

  0 -  4 :           0            0            0            0            0
  5 -  9 :           0            0            0            0            0
 10 - 14 :           0            0            0            0            0
 15 - 19 :           0            0            0            0            0
 20 - 24 :           0            0            0            0            0
 25 - 29 :           0            0            0            0            0
 30 - 34 :           0            0            0            0            0
 35 - 39 :           0            0            0            0            0
 40 - 44 :           0            0            0            0            0
 45 - 49 :           0            0            0            0            0
 50 - 54 :           0            0            0            0            0
 55 - 59 :           0            0            0            0            0
 60 - 64 :           0            0            0            0

Of course there are also some network monitoring tools that do this on a larger scale, checking your policy-maps or netflow.

Hi , I have question. as you mentioned switch will erase the QOS marking of all packet when we will enable the QOS on switch but default behavior of switch is to overwrite the DSCP value of the packet inside your frame according to the cos-to-dscp map.
so I confused what will happen? will erase or overwrite?
Waiting for your reply.
also what is the default DSCP value (in tos header) in packet and COS values in frame when PC sent the packet to router??

Hello Sourabh

According to Cisco, by default, if QoS is enabled on a switch and no other QoS parameters have been set:

Inside the dot1q frame tag, there are three bits called 802.1p priority bits available which are also called CoS. These bits are set to 0.
Then, the switch calculates DSCP value based on the CoS-DSCP map table. As per the table, the switch sets the DSCP value to 0. DSCP value is located at the IP header of the packet.

In summary, the CoS and DSCP values of the frame enter the switch set to 0 by default if the QoS is enabled on the switch.

So essentially the bits are all set to 0. Now you can call that “erased” or “overwritten” whatever the case may be.

As for DSCP and COS values in packets/frames from a PC, under most circumstances, these too are set to 0, unless a specific application on the PC makes changes to these.

I hope this has been helpful!

Laz