Classification and Marking on Cisco Switch

Hi Alfredo,

QoS on switches can be a pain…first of all, if you don’t have “mls qos” enabled then it won’t do any packet rewriting but it will still be queuing.

Take a look at this post, there I explain how queuing works and there’s a great video that explains QoS on the switches:

https://networklessons.com/quality-of-service/how-to-configure-queuing-on-cisco-catalyst-3560-and-3750-switch/

Here’s an example of a production 3560 switch here without “mls qos” enabled, you can see it’s queuing:

SWITCH#show mls qos interfac GigabitEthernet 0/1 statistics
GigabitEthernet0/1 (All statistics are in packets)

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

0 - 4 : 178414745 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
dscp: outgoing
-------------------------------

0 - 4 : 14636069 0 0 0 17401786
5 - 9 : 0 0 0 0 0
10 - 14 : 0 0 0 0 0
15 - 19 : 0 0 0 59194045 0
20 - 24 : 0 0 0 0 0
25 - 29 : 0 44 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 275 0
50 - 54 : 0 0 0 0 0
55 - 59 : 0 0 0 0 0
60 - 64 : 0 0 0 0
cos: incoming
-------------------------------

0 - 4 : 349353181 0 0 0 0
5 - 7 : 0 0 0
cos: outgoing
-------------------------------

0 - 4 : 471256874 0 0 0 0
5 - 7 : 532 0 51009
output queues enqueued:
queue: threshold1 threshold2 threshold3
-----------------------------------------------
queue 0: 0 0 0
queue 1: 0 1135332 8306773
queue 2: 0 0 0
queue 3: 0 0 461977806

output queues dropped:
queue: threshold1 threshold2 threshold3
-----------------------------------------------
queue 0: 0 0 0
queue 1: 0 0 0
queue 2: 0 0 0
queue 3: 0 0 0

Policer: Inprofile: 0 OutofProfile: 0

Before you make any changes, you should figure out a couple of things:

  1. Are there any drops? If so, which interfaces?
  2. What packets are being dropped? what queue and what threshold?

Here you can see the drops:

SWITCH#show platform port-asic stats drop g0/1

Interface Gi0/1 TxQueue Drop Statistics
Queue 0
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 1
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 2
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 3
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 4
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 5
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 6
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0
Queue 7
Weight 0 Frames 0
Weight 1 Frames 0
Weight 2 Frames 0

This interface isn’t dropping anything but perhaps on your switch, you do see drops. If you see them then you need to figure out what kind of traffic goes into what queues:

SWITCH#show mls qos maps cos-output-q
Cos-outputq-threshold map:
cos: 0 1 2 3 4 5 6 7
------------------------------------
queue-threshold: 2-1 2-1 3-1 3-1 4-1 1-1 4-1 4-1
SWITCH#show mls qos maps dscp-output-q
Dscp-outputq-threshold map:
d1 :d2 0 1 2 3 4 5 6 7 8 9
------------------------------------------------------------
0 : 02-01 02-01 02-01 02-01 02-01 02-01 02-01 02-01 02-01 02-01
1 : 02-01 02-01 02-01 02-01 02-01 02-01 03-01 03-01 03-01 03-01
2 : 03-01 03-01 03-01 03-01 03-01 03-01 03-01 03-01 03-01 03-01
3 : 03-01 03-01 04-01 04-01 04-01 04-01 04-01 04-01 04-01 04-01
4 : 01-01 01-01 01-01 01-01 01-01 01-01 01-01 01-01 04-01 04-01
5 : 04-01 04-01 04-01 04-01 04-01 04-01 04-01 04-01 04-01 04-01
6 : 04-01 04-01 04-01 04-01

With the drops in the queues and the tables above, you can figure out what is being dropped. For example, COS 0 and DSCP 0 (unmarked packets) go to Queue 2 Threshold 1. Here are the default values on the switch:

SWITCH#show mls qos interface g0/1 queueing
GigabitEthernet0/1
QoS is disabled. When QoS is enabled, following settings will be applied
Egress Priority Queue : disabled
Shaped queue weights (absolute) : 25 0 0 0
Shared queue weights : 25 25 25 25
The port bandwidth limit : 100 (Operational Bandwidth:100.0)
The port is mapped to qset : 1

When there is congestion, by default each queue gets 25% of the bandwidth. Here you can find the buffers and thresholds:

SWITCH#show mls qos queue-set 1
Queueset: 1
Queue : 1 2 3 4
----------------------------------------------
buffers : 25 25 25 25
threshold1: 100 200 100 100
threshold2: 100 200 100 100
reserved : 50 50 50 50
maximum : 400 400 400 400

Now let’s look at your configurations:

srr-queue bandwidth share 10 10 60 20
priority-queue out
mls qos trust cos
auto qos trust

Your queues will get:

Q1 = 10%
Q2 = 20%
Q3 = 60%
Q4 = 20%

Unmarked traffic goes to Q2 by default and I’m guessing the ‘bulk’ of your traffic is untagged (printing / file sharing) so if you see drops there, reducing the queue isn’t going to help. Your voice traffic goes to Q1 by default, enabling the priority queue is a good idea. Depending on what you see in your output, I think you probably need to increase Q2, not Q3.

srr-queue bandwidth share 1 30 35 5
priority-queue out
mls qos trust device cisco-phone
mls qos trust cos
service-policy input AUTOQOS-SRND4-CISCOPHONE-POLICY
auto qos voip cisco-phone

 

Enabling the priority queue is a good idea, by default Q1 will be the priority queue. COS 5 and DSCP 46 packets go to Q1 by default.

You also want to think about the threshold/buffers. This is the ‘storage space’ of your queue. If you increase it then you can store more in the queue…when it’s full, it will drop packets. Let’s say you have a lot of unmarked traffic, in this case I would remap it from T1 to T3.

Also when you test this, use queue-set 2…by default all interfaces are mapped to queue-set 1.

You need to figure out your traffic pattern, your drops and then come up with a ‘plan’ for your queues and buffers. Implement it and then check if things have improved or not.

Rene