Prerequisites for Policy-Based Queueing

Restrictions for Policy-Based Queueing

Ports on the WS-X6904-40G-2T switching modules can be configured with two priority queues (2p6q4t). Priority queue 1 has higher priority than priority queue 2.

The WS-X6904-40G-2T egress queues support QoS shaping.

– Shaping buffers traffic that exceeds the total egress port bandwidth. You can configure shaping on the egress queues and for egress traffic on the port.

– You configure shaping as a percentage of the total egress port bandwidth.

– Shaping can be configured only on the egress queues of WS-X6904-40G-2T ports. You cannot configure shaping on a port-channel interface.

– Ports with shaping configured can be members of an EtherChannel, but shaping can cause the egress traffic rate to vary significantly and cause significant differences between the member ports.

– You configure shaping with the shape average percent command. The show running-configuration command displays the shape average percent command, but the show policy-map type lan-queuing command displays the shaping configuration with the cir percentage command under the heading “Average Rate Traffic Shaping” heading.

The presence of a match dscp command or a match precedence command in a class map that is used in a queueing policy attached to a port enables DSCP-based queueing on the port in the direction that the queueing policy is attached.

Class maps that are used in queueing policies can contain any combination and number of match dscp , match precedence , or match cos commands.

You can attach one input and one output queueing policy to an interface, in addition to policies that configure marking or policing. To support per-queue shaping on WS-X6904-40G-2T egress nonprioritynonpriority queues, the output queueing policy on WS-X6904-40G-2T port egress queues supports child policies.

– If you attach a queueing policy in only one direction, the queueing configuration of the other direction is either the defaults or is defined by any configured global configuration mode queueing commands.

– You cannot configure any interface configuration mode queueing commands on a port that has a queueing policy attached.

Policy-based queueing is supported on all modules that Cisco IOS Release 15.1SY supports with the Supervisor Engine 2T-10GE.

Queueing policies are specific to particular port types because a queueing policy cannot contain any commands that are not supported by the port to which it will be attached (see the “Configuration Examples for Policy-Based Queueing” section). Commands not supported on a port are not ignored. You cannot successfully apply a policy with unsupported commands to a port.

For clarity, configure queueing policy names that correspond to the port type it supports; for example 1q2t_1q8t_ingress .

A policy-map class defined by a class command that uses a class map and that contains the policy-map class priority command configures the priority queue. (The priority queue is the highest-numbered queue.) The class-map filters the QoS values (CoS or DSCP) it is configured with to the priority queue.

Enabling SRR on a port disables the priority queue.

A policy-map class defined by a class command that uses a class map and that does not contain the policy-map class priority command configures the highest-numbered nonpriority queue. (If the port has a priority queue, the highest-numbered nonpriority queue is numbered one less than the priority queue. If the port does not have a priority queue, the highest-numbered queue is a nonpriority queue.) Subsequent such commands define the configuration of the remaining nonpriority queues in reverse numerical order. You cannot skip a queue, but configuration of all queues is not required. The class-map filters the QoS values it is configured with to the nonpriority queue being configured.

For each nonpriority queue, policy-map class queue-buffers or random-detect commands assign QoS values (CoS or DSCP) to thresholds within a queue. Thresholds are configured in numerical order. You cannot skip a threshold, but configuration of all threshold is not required. QoS values that are to be applied to the thresholds must be from the group of values that the class-map filters to the queue.

– The first queue-buffers or random-detect command assigns QoS values to the first threshold, and configures the percentage value applied to it.

– Subsequent queue-buffers or random-detect commands that are configured with the same percentage value assign additional QoS values to the first threshold.

– The next queue-buffers or random-detect command that is configured with a different percentage value assigns QoS values to the numerically next threshold, and configures the percentage value applied to it.

– Subsequent queue-buffers or random-detect commands that are configured with the same percentage value assign additional QoS values to the numerically next threshold.

– Each queue-buffers or random-detect command with a different percentage defines the next unconfigured threshold and any subsequent commands that repeat a percentage value assign additional QoS values to a configured threshold.

– All unconfigured thresholds are at 100%.

– All unassigned QoS labels are assigned to the highest-numbered threshold.

Port-Based Queue Types

Ingress and Egress Buffers and Queues

The Ethernet port ASICs have buffers that are divided into a fixed number of queues. When congestion avoidance is enabled, PFC QoS uses the traffic’s Layer 2 CoS value or, on some port types, the Layer 3 DSCP values, to assign traffic to the queues. The buffers and queues store frames temporarily as they transit the switch. PFC QoS allocates the port ASIC memory as buffers for each queue on each port.

The Ethernet ports support the following types of queues:

Nonpriority queues

Priority queues

The Ethernet ports support the following types of scheduling algorithms between queues:

Shaped round robin (SRR)—SRR allows a queue to use only the allocated bandwidth.

Deficit weighted round robin (DWRR)—DWRR keeps track of any lower-priority queue under-transmission caused by traffic in a higher-priority queue and compensates in the next round.

Weighted Round Robin (WRR)—WRR does not explicitly reserve bandwidth for the queues. Instead, the amount of bandwidth assigned to each queue is user configurable. The percentage or weight allocated to a queue defines the amount of bandwidth allocated to the queue.

Priority queueing—Strict priority queueing allows delay-sensitive data such as voice to be dequeued and sent before packets in other queues are dequeued, giving delay-sensitive data preferential treatment over other traffic. The switch services traffic in the strict-priority transmit queue before servicing the nonpriority queues. After transmitting a packet from a nonpriority queue, the switch checks for traffic in the strict-priority queue. If the switch detects traffic in the strict-priority queue, it suspends its service of the nonpriority queue and completes service of all traffic in the strict-priority queue before returning to the nonpriority queue.

The Ethernet ports provide congestion avoidance with these types of thresholds within a queue:

Weighted Random Early Detection (WRED)—On ports with WRED drop thresholds, frames with a given QoS label are admitted to the queue based on a random probability designed to avoid buffer congestion. The probability of a frame with a given QoS label being admitted to the queue or discarded depends on the weight and threshold assigned to that QoS label.

For example, if CoS 2 is assigned to queue 1, threshold 2, and the threshold 2 levels are 40 percent (low) and 80 percent (high), then frames with CoS 2 will not be dropped until queue 1 is at least 40 percent full. As the queue depth approaches 80 percent, frames with CoS 2 have an increasingly higher probability of being discarded rather than being admitted to the queue. Once the queue is over 80 percent full, all CoS 2 frames are dropped until the queue is less than 80 percent full. The frames the switch discards when the queue level is between the low and high thresholds are picked out at random, rather than on a per-flow basis or in a FIFO manner. This method works well with protocols such as TCP that can adjust to periodic packet drops by backing off and adjusting their transmission window size.

Tail-drop thresholds—On ports with tail-drop thresholds, frames with a given QoS label are admitted to the queue until the drop threshold associated with that QoS label is exceeded; subsequent frames of that QoS label are discarded until the threshold is no longer exceeded. For example, if CoS 1 is assigned to queue 1, threshold 2, and the threshold 2 watermark is 60 percent, then frames with CoS 1 will not be dropped until queue 1 is 60 percent full. All subsequent CoS 1 frames will be dropped until the queue is less than 60 percent full. With some port types, you can configure the nonpriority receive queue to use both a tail-drop and a WRED-drop threshold by mapping a CoS value to the queue or to the queue and a threshold. The switch uses the tail-drop threshold for traffic carrying CoS values mapped only to the queue. The switch uses WRED-drop thresholds for traffic carrying CoS values mapped to the queue and a threshold. All LAN ports of the same type use the same drop-threshold configuration.

The presence of a match dscp command or a match precedence command in a class map that is used in a queueing policy attached to a port configures DSCP-based queueing in the direction of the policy (ingress or egress) on that port.

(Required to configure multiple priority queues or shaping.) On WS-X6904-40G-2T ports, applies a policy-map class to one of the priority queues. Priority queue 1 has higher priority than priority queue 2.

Configuring a Queueing Policy Class Map

To configure a queueing policy class map, perform this task:

Command

Purpose

Step 1

Router(config)# class-map type lan-queuing match-any class_name

Creates a class map. Create a class map for the thresholds on each type of queue that you are configuring. Give the class map a name that allows you to easily associate it with the queue type and threshold for which you configure it.

(Optional) Configures the queueing policy class map to filter based on DSCP values and enables DSCP-based queueing on the port in the direction that the queueing policy is attached. You can enter multiple commands.

(Optional) Configures the queueing policy class map to filter based on precedence values and enables DSCP-based queueing on the port in the direction that the queueing policy is attached. You can enter multiple commands.

Step 5

Router (config-cmap)# end

Exits configuration mode.

This example shows how to create a class map named cos5 and how to configure filtering to match traffic with CoS 5:

Configuring a Priority Queue

1p1q4t,1p1q8t,1p7q2t,1p3q8t, 1p7q8t, and 1p7q4t ports have priority queues. To configure the priority queue, perform this task:

Command

Purpose

Step 1

Router(config-pmap)# class class_map_name

Creates a policy map class.

Step 2

Router(config-pmap-c)# priority

Applies the class map to the priority queue.

Note The priority queue is not supported if SRR is enabled.

Step 3

Router(config-pmap-c)# queue-buffers ratio weight

(Optional) Sets queue buffer size.

Step 4

Router(config-pmap-c)# end

(Optional) Exits policy map class configuration mode.

Configuring Nonpriority Queues

The first class class_map_name command that you enter that is not followed by the priority keyword configures the highest numbered nonpriority queue. Subsequent class class_map_name commands configure the remaining nonpriority queues in reverse numerical order (highest-numbered to queue #2). The class class-default command configures queue #1. To configure a nonpriority queue, perform this task:

Command

Purpose

Step 1

Router(config-pmap)# class { class_map_name | class-default }

Creates a policy map class.

Note

Enter a class map name to configure nonpriority queues numbered greater than one.

Enter the class-default keyword to configure queue #1.

Step 2

Router(config-pmap-c)# bandwidth [ remaining ] percent percentage

Allocates WRR or DWRR bandwidth.

Note

On WS-X6904-40G-2T ports, the bandwidth command must be configured if you configure any nondefault values for any other queueing commands on the port. (CSCtz05347 )

Not required on ports that have one queue.

The remaining keyword is required on ports that have a priority queue.