QoS (Quality of Service) on older Cisco Catalyst switches is not as easy as configuring it on routers. The big difference is that on routers, QoS runs in software, while on our switches, it’s done in hardware. Since switching is done in hardware (ASICs) we also have to do our congestion management (queuing) in hardware. The downside of this is that QoS is in effect immediately. In this lesson, I will give you an overview of all the different commands and an explanation of how QoS works. If you are totally new to LAN QoS, do yourself a favor and watch this video:
The first 54 minutes are about classification, marking, and policing, so if you only care about congestion management and queuing you can skip the first part. Having said that, let’s walk through the different commands.
If your switch supports ingress queuing then on most switches (Cisco Catalyst 3560 and 3750) queue 2 will be the priority queue by default. Keep in mind that there are only 2 ingress queues. If we want we can make queue 1 the priority queue and we can also change the bandwidth. Here’s how to do it:
Switch(config)#mls qos srr-queue input priority-queue 1 bandwidth 20
The command makes queue one the priority queue and limits it to 20% of the bandwidth of the total internal ring bandwidth.
For our egress queuing, we have to enable the priority queue ourselves! It’s not enabled by default. Here’s how you can do it:
Switch(config)#interface fa0/1 Switch(config-if)#priority-queue out
The command above will enable the outbound priority queue for interface fa0/1. By default, queue 1 is the priority queue!
The queue-set is like a template for QoS configurations on our switches. There are 2 queue-sets that we can use and by default, all interfaces are assigned to queue-set 1. If you plan to make changes to buffers etc., it’s better to use queue-set 2 for this. If you change queue-set 1 you will apply you new changes to all interfaces.
This is how you can assign an interface to a different queue-set:
Switch(config)#interface fa0/2 Switch(config-if)#queue-set 2
Above we put interface fa0/2 in queue-set 2. Keep in mind that we only have queue-sets for egress queuing, not for ingress.
For each queue, we need to configure the assigned buffers. The buffer is like the ‘storage’ space for the interface, and we have to divide it among the different queues. This is how to do it:
mls qos queue-set output <queue set> buffers Q1 Q2 Q3 Q4
Above, you see the
mls qos command. First, we select the queue-set and then we can divide the buffers between queues 1,2,3 and 4. For queues 1,3 and 4 you can select a value between 0 and 99. If you type 0, you will disable the queue. You can’t do this for queue 2 because it is used for the CPU buffer. Let’s take a look at an actual example:
Switch(config)#mls qos queue-set output 2 buffers 33 17 25 25
This will divide the buffer space like this:
- 33% for queue 1.
- 17% for queue 2.
- 25% for queue 3.
- 25% for queue 4.
Besides dividing the buffer space between the queues, we also have to configure the following values per queue:
- Threshold 1 value
- Threshold 2 value
- Reserved value
- Maximum value
The command to configure these values looks like this:
mls qos queue-set output <queue-set> threshold <queue number> T1 T2 RESERVED MAXIMUM
First, you need to select a queue-set, select the queue number and finally configure a threshold 1 and 2 value, reserved value, and the maximum value.
Here’s an example:
Switch(config)#mls qos queue-set output 2 threshold 3 33 66 100 300
In the example above we configure queue-set 2. We select queue 3 and set the following values:
- Threshold 1 = 33%
- Threshold 2 = 66%
- Reserved = 100%
- Maximum = 300%
This means that threshold 1 can go up to 33% of the queue. Threshold 2 can go up to 66% of the queue. We reserve 100% buffer space for this queue and in case the queue is full we can borrow more buffer space from the common pool. 300% means we can get twice our queue size from the common pool.
Assign marked packets/frames to the correct queue
You now know how to configure the buffers and thresholds, but we still have to tell the switch which CoS and DSCP values have to go to which queue. Here’s the command for it: