IT-Pathways Header Switch QOS Explained
IT-Pathways.com - IT Careers
Switch QOS Explained





Enabling Quality of Service on Cisco switches turns on a number of queues, buffers and packet COS and DSCP rewriting mechanisms that may need to be managed in order to achieve your desired results. QOS is enabled by typing the global command: mls qos

When QOS is enabled on a Cisco 3750 series switch SRR queues are enabled. SRR stands for Shaped Round Robin queui Older switch models used WRR which stands for Weighted Round Robin queuing. These queuing strategies include 2 x input queues and 4 x output queues. COS or DSCP mappings are used to provide interpoerability between different markings and to assign packets to a respective queue.


Related Pages and Further Reading

DSCP-COS Mappings Explained

Quality of Service for Voice

Quality of Service on Networks

Monitoring server performance

Router monitoring

Why does IPSLA score a MAX MOS of 4.06

Network Performance Monitoring


Similarities to QOS on Routers

Switch Quality of Service is a different prospect to the QOS that you may be accustom to on routers. For example, switches run Shaped Round Robin (SRR) or Weighted Round Robin (WRR) queuing. This type of queuing is more closely related to Custom queuing on routers in terms of the way that the queue is serviced. But when a priority queue is enabled on the switch then the behaviour is more like a hybrid between priority queuing and custom queuing on routers.


Maps and Thresholds

Maps have two primary purposes;

  • Create associations between QOS markings.
  • Assign packets to input and output queues.

QOS Maps are explained here.


Thresholds

Thresholds are used to configure WTD (Weighted Tail Drop) which is used for congestion avoidance. On routers the equivalent congestion avoidance mechanism is WRED.

Three thresholds are allowed. Thresholds one and two are configurable and threshold three is not. For example, you may configure threshold 1 to begin dropping packets when the queue is 10% full and increase the rate of drops until the queue reaches 20%. The second threshold may be set to begin dropping packets when the queue is 30% increasing the rate as it approaches 50% capacity. In this case, less desirable packets would be assigned to threshold 1 as they begin to drop first and are all dropping by the time threshold 2 kicks in.


Inbound and Outbound Traffic

The allocation of queues, buffers and mappings can be categorized by two distinct directions - Input and Output.
Switch Queuing
Ingress Queues

Just like the COS-DSCP map, the input queues service incoming packets. All packets are allocated to a queue by associating COS values to either of the queues 

Syntax: mls qos srr-queue input cos-map queue 1 threshold 1 0 1 2 3

This commands is saying to allocate packets with COS value 0, 1, 2 or 3 to queue 1. Once queue 1 begins to fill packets are to be dropped at the rates defined by threshold 1.

All packets must be assigned to either of two input queues. Each queue is given a weight. They are then serviced based on their weight allocations.

Syntax: mls qos srr-queue input bandwidth weight1 weight2


Egress Queues

Just like the DSCP-COS map, output queues are applied to outgoing packets.

Syntax: mls qos srr-queue output cos-map queue 1 threshold 2 0 1 2 4

This command is saying to allocate packets with COS value of 0, 1, 2 and 4 to queue 1. Once queue 1 begins to fill packets are to be dropped at the rates defined by threshold 2.

All packets must be assigned to either of four output queues. Each queue is given a weight. They are then serviced based on their weight allocations.

Although these examples have used the COS value to allocate packets, DSCP values can also be used. If both COS and DSCP maps are used and there is a conflict (for example the COS map assign a packet to Q1 but according to the DSCP map the packet should be in Q2) then the DSCP map overrides the COS assignment.


Trust Boundaries

On Cisco switches, when QOS is not enabled then packet markings are forwarded as is. That is if a packet is marked COS 5 as it arrives at the interface, then it will be forwarded with the same COS value of 5 when it leaves the switch.

When 'mls qos' is entered (hence enabling qos) - the behaviour changes. The switch then applies the concept of trust boundaries to every interface. Unless you specifically enable an interface to trust markings then all markings will be re-written to 0.

Trust boundaries can be set to trust COS, IP precendence or DSCP values as required. They can also be set up to trust these values only when a Cisco phone is plugged into the port. The switch will know when a phone is plugged in through the CDP protocol so you must ensure that CDP is enabled on the port in order for the command to work.

In order to enable trust boundaries on an interface, the following interface command should be used:

mls qos trust [cos | device cisco-phone | dscp | ip-precedence]
Switch Trust Boundaries
Key Catalyst Switch QOS Design Considerations

On Cisco switches there are a number of key differences that should be noted.

- (Cisco 3750G as an example) The priority queue is unrestricted and can use the entire interface bandwidth. Unlike routers, there is no percentage parameter to cap the amount of bandwidth that is serviced by the queue.

- (Cisco 3750G as an example) Although the bandwidth limit command is available to restrict output from an interface, it only applies to Queues 2, 3 and 4. Queue 1 which is the queue that becomes priority when the priority command is applied is not affected by bandwidth limit command.

On an interface you can configure Queue1 to be treated as a priority queue using the following command.

config-if#priority-queue out

In order to manipulate which packets are placed in each queue the following mappings should be examined to see which DSCP packet markings are mapped against output queues. In this instance DSCP 46 is mapped against Queue1.

mls qos srr-queue output dscp-map queue 1 threshold 3  46
mls qos srr-queue output dscp-map queue 2 threshold 2 10 20  (DSCP 10 & 20 are placed into queue 2 in the event of congestion).