Configuring Queuing and Scheduling

About Queuing and Scheduling

Traffic queuing is the ordering of packets and applies to both input and output of data. Device modules can support multiple queues, which you can use to control the sequencing of packets in different traffic classes. You can also set weighted random early detection (WRED) and taildrop thresholds. The device drops packets only when the configured thresholds are exceeded.

Traffic scheduling is the methodical output of packets at a desired frequency to accomplish a consistent flow of traffic. You can apply traffic scheduling to different traffic classes to weight the traffic by priority.

The queuing and scheduling processes allow you to control the bandwidth that is allocated to the traffic classes so that you achieve the desired trade-off between throughput and latency for your network.

Modifying Class Maps

System-defined queuing class maps are provided.


Note

The provided system-defined queuing class maps cannot be modified.


Congestion Avoidance

You can use the following methods to proactively avoid traffic congestion on the device:

  • Apply WRED to TCP or non-TCP traffic.

  • Apply tail drop to TCP or non-TCP traffic.

Congestion Management

For egress packets, you can choose one of the following congestion management methods:

  • Specify a bandwidth that allocates a minimum data rate to a queue.

  • Impose a minimum and maximum data rate on a class of traffic so that excess packets are retained in a queue to shape the output rate.

  • Allocate all data for a class of traffic to a priority queue. The device distributes the remaining bandwidth among the other queues.

For information about configuring congestion management, see the Configuring WRED on Egress Queues section.

Explicit Congestion Notification

ECN is an extension to WRED that marks packets instead of dropping them when the average queue length exceeds a specific threshold value. When configured with the WRED ECN feature, routers and end hosts use this marking as a signal that the network is congested to slow down sending packets.


Note

The ECN feature is not supported on the Cisco Nexus 9508 switch (NX-OS 7.0(3)F3(3)).



Note

Enabling WRED and ECN on a class on a network-qos policy implies that WRED and ECN is enabled for all ports in the system.



Note

On extended output queues (EOQ), the approximate fair-drop (AFD) feature for bandwidth management is always enabled. The WRED configuration is ignored on EOQs. The configuration for EOQs is based on the system queuing policy and not on the per port policy.


Traffic Shaping

Traffic shaping allows you to control the traffic going out of an interface in order to match its flow to the speed of the remote target interface and to ensure that the traffic conforms to policies contracted for it. You can shape traffic that adheres to a particular profile to meet downstream requirements. Traffic shaping eliminates bottlenecks in topologies with data-rate mismatches.

Traffic shaping regulates and smooths out the packet flow by imposing a maximum traffic rate for each port’s egress queue. Packets that exceed the threshold are placed in the queue and are transmitted later. Traffic shaping is similar to traffic policing, but the packets are not dropped. Because packets are buffered, traffic shaping minimizes packet loss (based on the queue length), which provides better traffic behavior for TCP traffic.

Using traffic shaping, you can control access to available bandwidth, ensure that traffic conforms to the policies established for it, and regulate the flow of traffic to avoid congestion that can occur when the egress traffic exceeds the access speed of its remote, target interface. For example, you can control access to the bandwidth when policy dictates that the rate of a given interface should not, on average, exceed a certain rate even though the access rate exceeds the speed.

Queue length thresholds are configured using the WRED configuration.


Note

Traffic shaping is not supported on ALE enabled device 40G front panel ports. When traffic shaping is configured for the system level, the setting is ignored and no error message is displayed. When traffic shaping commands are configured for the port level, the setting is rejected and an error message is displayed.


Prerequisites for Queuing and Scheduling

Queuing and scheduling have the following prerequisites:

  • You must be familiar with using modular QoS CLI.

  • You are logged on to the device.

Guidelines and Limitations

Queuing and scheduling have the following configuration guidelines and limitations:

  • show commands with the internal keyword are not supported.

  • The device supports a system-level queuing policy, so all ports in the system are impacted when you configure the queuing policy.

  • A type queuing policy can be attached to the system or to individual interfaces for input or output traffic.

  • Changes are disruptive. The traffic passing through ports of the specified port type experience a brief period of traffic loss. All ports of the specified type are affected.

  • Performance can be impacted. If one or more ports of the specified type do not have a queuing policy applied that defines the behavior for the new queue, the traffic mapping to that queue might experience performance degradation.

  • Traffic shaping might increase the latency of packets due to queuing because it falls back to store-and-forward mode when packets are queued.

  • Traffic shaping is not supported on the Cisco Nexus 9300 ALE 40G ports. For more information on ALE 40G uplink ports, see the Limitations for ALE 40G Uplink Ports on the Cisco Nexus 9000 Series Switches.

  • When configuring priority for one class map queue (SPQ), you need to configure the priority for QoS group 3. When configuring priority for more than one class map queue, you need to configure the priority on the higher numbered QoS groups. In addition, the QoS groups need to be adjacent to each other. For example, if you want to have two SPQs, you have to configure the priority on QoS group 3 and on QoS group 2.

  • For the following Cisco Nexus platform switches and line cards, the lowest value that the egress shaper can manage, per queue, is 100 Mbps:

    • Cisco Nexus 9200 platform switches

    • Cisco Nexus 9300-EX/FX/FX2 platform switches

    • Cisco Nexus 9700-EX/FX line cards

Buffer-boost

The buffer-boost feature enables the line card to use extra buffers. This capability is enabled by default on line cards such as the Cisco Nexus 9564PX.

  • The command to enable the buffer-boost feature is buffer-boost .

  • The command to disable the buffer-boost feature is no buffer-boost .

Generally, Cisco recommends not to disable the buffer-boost feature. However, disabling the buffer-boost is necessary when there is a need to port channel two different member ports from Cisco Nexus 9636PQ based line cards and Cisco Nexus 9564PX based line cards. However, Cisco does not recommend to port channel such a configuration between ACI capable leaf line cards and standalone line cards.


Note

Line cards like the Cisco Nexus 9636PQ and similar, do not offer the buffer-boost feature.


Order of Resolution

The following describes the order of resolution for the pause buffer configuration and the queue-limit for a priority-group.

  • Pause Buffer Configuration

    The pause buffer configuration is resolved in the following order:

    • Interface ingress queuing policy (if applied and pause buffer configuration specified for that class).

    • System ingress queuing policy (if applied and pause buffer configuration specified for that class).

    • System network-QoS policy (if applied and pause buffer configuration specified for that class).

    • Default values with regards to the speed of the port.

  • Queue-limit for Priority-Group

    The queue-limit for a priority-group is resolved in the following order:

    • Interface ingress queuing policy (if applied and queue-limit configuration specified for that class).

    • System ingress queuing policy (if applied and queue-limit configuration specified for that class).

    • The hardware qos ing-pg-share configuration provided value.

    • System default value.

Ingress Queuing

The following are notes about ingress queuing:

  • No default system ingress queuing policy exists.

  • The ingress queuing policy is used to override the specified pause buffer configuration.

  • When downgrading to an earlier release of Cisco NX-OS, all ingress queuing configurations have to be removed.

  • The ingress queuing feature is supported only on platforms where priority flow control is supported.

Configuring Queuing and Scheduling

Queuing and scheduling are configured by creating policy maps of type queuing that you apply to an egress interface. You cannot modify system-defined class maps, which are used in policy maps to define the classes of traffic to which you want to apply policies.

System-defined class maps match based on QoS groups that can be customized using a type qos policy. By default, there is no type QoS policy and all traffic matches to qos-group 0. One consequence is that all traffic will hit the system-defined default-class of type network-qos and type queuing (assigns 100% bandwidth to qos-group 0). Since system-defined classes of type queuing and type network-qos are predefined to match based on distinct qos-groups and cannot be modified, the way to ensure that traffic hits a given type queuing/network-qos class is to configure a type qos policy that sets the corresponding qos-group for that traffic. For traffic classified into a system-defined class map matching on a qos-group other than 0, create a type QoS policy that sets the QoS groups. Once the traffic has been mapped, it will be subject to the default type network-qos and type queuing policies that operate on the non-default qos-group X (X !=0). You may need to further customize those type queuing and type network-qos policies in order to ensure the desired actions (e.g. re-allocate some bandwidth). For more information on setting the qos-group, see “Example of set qos-groups” in the Using Modular QoS CLI chapter.

For information about configuring policy maps and class maps, see the Using Modular QoS CLI chapter.

You can configure the congestion-avoidance features, which include tail drop and WRED, in any queue.

You can configure one of the egress congestion management features, such as priority, traffic shaping, and bandwidth in output queues.


Note

WRED is not supported on ALE enabled device front panel 40G uplink ports. When WRED is configured for the system level, the setting is ignored and no error message is displayed. When WRED is configured at the port level, the setting is rejected and an error message displays.


The system-defined policy map, default-out-policy, is attached to all ports to which you do not apply a queuing policy map. The default policy maps cannot be configured.

Configuring Type Queuing Policies

Type queuing policies for egress are used for scheduling and buffering the traffic of a specific system class. A type queuing policy is identified by its QoS group and can be attached to the system or to individual interfaces for input or output traffic.


Note

Ingress queuing policy is used to configure pause buffer thresholds. For more details, see the Priority Flow Control section.


SUMMARY STEPS

  1. configure terminal
  2. policy-map type queuing policy-name
  3. class type queuing class-name
  4. priority
  5. no priority
  6. shape {kbps | mbps | gbps} burst size min minimum bandwidth
  7. bandwidth percent percentage
  8. no bandwidth percent percentage
  9. priority level level
  10. queue-limit queue size [dynamic dynamic threshold]

DETAILED STEPS

  Command or Action Purpose
Step 1

configure terminal

Enters global configuration mode.

Step 2

policy-map type queuing policy-name

Creates a named object that represents a set of policies that are to be applied to a set of traffic classes. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 3

class type queuing class-name

Associates a class map with the policy map, and enters configuration mode for the specified system class.

Step 4

priority

Specifies that traffic in this class is mapped to a strict priority queue.

Step 5

no priority

(Optional) Removes the strict priority queuing from the traffic in this class.

Step 6

shape {kbps | mbps | gbps} burst size min minimum bandwidth

Specifies the burst size and minimum guaranteed bandwidth for this queue.

Step 7

bandwidth percent percentage

Assigns a weight to the class. The class will receive the assigned percentage of interface bandwidth if there are no strict-priority queues. If there are strict-priority queues, however, the strict-priority queues receive their share of the bandwidth first. The remaining bandwidth is shared in a weighted manner among the class configured with a bandwidth percent. For example, if strict-priority queues take 90 percent of the bandwidth, and you configure 75 percent for a class, the class will receive 75 percent of the remaining 10 percent of the bandwidth.

Note 

Before you can successfully allocate bandwidth to the class, you must first reduce the default bandwidth configuration on class-default and class-fcoe.

Step 8

no bandwidth percent percentage

(Optional) Removes the bandwidth specification from this class.

Step 9

priority level level

(Optional) Specifies the strict priority levels for the Cisco Nexus 9000 Series switches. These levels can be from 1 to 7.

Step 10

queue-limit queue size [dynamic dynamic threshold]

(Optional) Specifies either the static or dynamic shared limit available to the queue for Cisco Nexus 9000 Series switches. The static queue limit defines the fixed size to which the queue can grow.

The dynamic queue limit allows the queue's threshold size to be decided depending on the number of free cells available, in terms of the alpha value.

Note 

Cisco Nexus 9200 Series switches only support a class level dynamic threshold configuration with respect to the alpha value. This means that all ports in a class share the same alpha value.

Configuring Congestion Avoidance

You can configure congestion avoidance with tail drop or WRED features. Both features can be used in egress policy maps.


Note

WRED and tail drop cannot be configured in the same class.


Configuring Tail Drop on Egress Queues

You can configure tail drop on egress queues by setting thresholds. The device drops any packets that exceed the thresholds. You can specify a threshold based on the queue size or buffer memory that is used by the queue.

SUMMARY STEPS

  1. configure terminal
  2. hardware qos q-noise percent value
  3. policy-map [type queuing] [match-first] [policy-map-name]
  4. class type queuing class-name
  5. queue-limit {queue-size [bytes | kbytes | mbytes] | dynamic value}
  6. (Optional) Repeat Steps 3 and 4 to assign tail drop thresholds for other queue classes.
  7. show policy-map [type queuing [policy-map-name | default-out-policy]]
  8. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

configure terminal

Example:
switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

hardware qos q-noise percent value

Example:
switch(config)# hardware qos q-noise percent 30

Tunes the random noise parameter. The default value is 20 percent.

This command is supported for Cisco Nexus 9200 and 9300-EX Series switches beginning with Cisco NX-OS Release 7.0(3)I4(4).
Step 3

policy-map [type queuing] [match-first] [policy-map-name]

Example:
switch(config)# policy-map type queuing shape_queues
switch(config-pmap-que)#

Configures the policy map of type queuing and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 4

class type queuing class-name

Example:
switch(config-pmap-que)# class type queuing c-out-q1
switch(config-pmap-c-que)#

Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in the previous System-Defined Type queuing Class Maps table.

Step 5

queue-limit {queue-size [bytes | kbytes | mbytes] | dynamic value}

Example:
switch(config-pmap-c-que)# queue-limit 1000 mbytes

Assigns a tail drop threshold based on the queue size in bytes, kilobytes, or megabytes or allows the queue’s threshold size to be determined dynamically depending on the number of free cells available. The device drops packets that exceed the specified threshold.

The valid values for byte-based queue size are from 1 to 83886080. The valid values for dynamic queue size are from 0 to 10 as follows:

For example, if you configure a dynamic queue size of 6, then the alpha value is ½. If you configure a dynamic queue size of 7, then the alpha value is 1.

To calculate the queue-limit consider the following:

queue-limit = (alpha/(1 + alpha)) x total buffers

For example, if you configure a queue-limit with a dynamic queue size of 7, then the queue-limit can grow up to (1/(1+1)) x total buffers. This means that queue-limit = ½ x total buffers.

Note 

Setting the threshold on ALE enabled devices is only supported for the system level. It is not supported for the port level.

Step 6

(Optional) Repeat Steps 3 and 4 to assign tail drop thresholds for other queue classes.

Step 7

show policy-map [type queuing [policy-map-name | default-out-policy]]

Example:
switch(config-pmap-c-que)# show policy-map type queuing shape_queues

(Optional) Displays information about all configured policy maps, all policy maps of type queuing, a selected policy map of type queuing, or the default output queuing policy.

Step 8

copy running-config startup-config

Example:
switch(config)# copy running-config
startup-config

(Optional) Saves the running configuration to the startup configuration.

Configuring WRED on Egress Queues

You can configure WRED on egress queues to set minimum and maximum packet drop thresholds. The frequency of dropped packets increases as the queue size exceeds the minimum threshold. When the maximum threshold is exceeded, all packets for the queue are dropped.


Note

WRED and tail drop cannot be configured in the same class.



Note

AFD and WRED cannot be applied at the same time. Only one can be used in a system.


SUMMARY STEPS

  1. configure terminal
  2. policy-map type queuing {[match-first] policy-map-name}
  3. class type queuing class-name
  4. random-detect [minimum-threshold min-threshold {packets | bytes | kbytes | mbytes} maximum-threshold max-threshold {packets | bytes | kbytes | mbytes} drop-probability value weight value] [threshold {burst-optimized | mesh-optimized}] [ecn | non-ecn]
  5. (Optional) Repeat Steps 3 and 4 to configure WRED for other queuing classes.

DETAILED STEPS

  Command or Action Purpose
Step 1

configure terminal

Example:
switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

policy-map type queuing {[match-first] policy-map-name}

Example:
switch(config)# policy-map type queuing p1
switch(config-pmap-que)#

Configures the policy map of type queuing and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 3

class type queuing class-name

Example:
switch(config-pmap-que)# class type queuing c-out-q1
switch(config-pmap-c-que)#

Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in the previous System-Defined Type queuing Class Maps table.

Step 4

random-detect [minimum-threshold min-threshold {packets | bytes | kbytes | mbytes} maximum-threshold max-threshold {packets | bytes | kbytes | mbytes} drop-probability value weight value] [threshold {burst-optimized | mesh-optimized}] [ecn | non-ecn]

Example:
switch(config-pmap-c-que)# random-detect
minimum-threshold 10 mbytes
maximum-threshold 20 mbytes

Configures WRED on the specified queuing class. You can specify minimum and maximum thresholds used to drop packets from the queue. You can configure these thresholds by the number of packets, bytes, kilobytes, or megabytes. The minimum and maximum thresholds must be of the same type. The thresholds are from 1 to 52428800.

Note 

The minimum-threshold and maximum-threshold parameters are not supported on the Cisco Nexus 9300 platform switches and Cisco Nexus 9564TX and 9564PX line cards.

When random-detect is configured under policy-map the default thresholds and drop probabilities are as following:

  1. On newer platforms, the threshold is 0 and then the drop probabilities would be enforced irrespective of buffer utilization.

  2. On older platforms, the threshold is min 100KB, max 120KB.

The drop probabilities are consistently 10% and 90% for burst-optimized and mesh-optimized respectively on all platforms

Step 5

(Optional) Repeat Steps 3 and 4 to configure WRED for other queuing classes.

(Optional)

Configuring Congestion Management

You can configure only one of the following congestion management methods in a policy map:

  • Allocate a minimum data rate to a queue by using the bandwidth and bandwidth remaining commands.

  • Allocate all data for a class of traffic to a priority queue by using the priority command. You can use the bandwidth remaining command to distribute remaining traffic among the nonpriority queues. By default, the system evenly distributes the remaining bandwidth among the nonpriority queues.

  • Allocate a minimum and maximum data rate to a queue by using the shape command.

In addition to the congestion management feature that you choose, you can configure one of the following queue features in each class of a policy map:

Configuring Bandwidth and Bandwidth Remaining

You can configure the bandwidth and bandwidth remaining on the egress queue to allocate a minimum percentage of the interface bandwidth to a queue.


Note

When a guaranteed bandwidth is configured, the priority queue must be disabled in the same policy map.


SUMMARY STEPS

  1. configure terminal
  2. policy-map type queuing {[match-first] policy-map-name}
  3. class type queuingclass-name
  4. Assign a minimum rate of the interface bandwidth or assign the percentage of the bandwidth that remains:
    • Bandwidth percent:

      bandwidth {percent percent}
    • Bandwidth remaining percent:

      bandwidth remaining percent percent
  5. (Optional) Repeat Steps 3 and 4 to assign tail drop thresholds for other queue classes.
  6. exit
  7. show policy-map [type queuing [policy-map-name | default-out-policy]]
  8. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

policy-map type queuing {[match-first] policy-map-name}

Example:

switch(config)# policy-map type queuing shape_queues
switch(config-pmap-que)#

Configures the policy map of type queuing and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 3

class type queuingclass-name

Example:

switch(config-pmap-que)# class type queuing c-out-q1
switch(config-pmap-c-que)#

Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in the previous System-Defined Type queuing Class Maps table.

Step 4

Assign a minimum rate of the interface bandwidth or assign the percentage of the bandwidth that remains:

  • Bandwidth percent:

    bandwidth {percent percent}
  • Bandwidth remaining percent:

    bandwidth remaining percent percent

Example:

  • Bandwidth percent:

    switch(config-pmap-c-que)# bandwidth percent 25
  • Bandwidth remaining percent:

    switch(config-pmap-c-que)# bandwidth remaining percent 25
  • Bandwidth percent:

    Assigns a minimum rate of the interface bandwidth to an output queue as the percentage of the underlying interface link rate. The range is from 0 to 100.

    The example shows how to set the bandwidth to a minimum of 25 percent of the underlying link rate.

  • Bandwidth remaining percent:

    Assigns the percentage of the bandwidth that remains to this queue. The range is from 0 to 100.

    The example shows how to set the bandwidth for this queue to 25 percent of the remaining bandwidth.

Step 5

(Optional) Repeat Steps 3 and 4 to assign tail drop thresholds for other queue classes.

Step 6

exit

Example:

switch(config-cmap-que)# exit
switch(config)#

Exits policy-map queue mode and enters global configuration mode.

Step 7

show policy-map [type queuing [policy-map-name | default-out-policy]]

Example:

switch(config-pmap-c-que)# show policy-map type queuing shape_queues

(Optional) Displays information about all configured policy maps, all policy maps of type queuing, a selected policy map of type queuing, or the default output queuing policy.

Step 8

copy running-config startup-config

Example:

switch(config)# copy running-config
startup-config

(Optional) Saves the running configuration to the startup configuration.

Configuring Bandwidth and Bandwidth Remaining for FEX

You can configure the bandwidth and bandwidth remaining on the ingress and egress queue to allocate a minimum percentage of the interface bandwidth to a queue.


Note

When a guaranteed bandwidth is configured, the priority queue must be disabled in the same policy map.


Before you begin

Before configuring the FEX, enable feature-set fex .

SUMMARY STEPS

  1. configure terminal
  2. policy-map type queuing {[match-first] policy-map-name}
  3. class type queuingclass-name
  4. Assign a minimum rate of the interface bandwidth or assign the percentage of the bandwidth that remains:
    • Bandwidth percent:

      bandwidth {percent percent}
    • Bandwidth remaining percent:

      bandwidth remaining percent percent
  5. (Optional) Repeat Steps 3 and 4 to assign tail drop thresholds for other queue classes.
  6. exit
  7. show policy-map [type queuing [policy-map-name | default-out-policy]]
  8. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

policy-map type queuing {[match-first] policy-map-name}

Example:

switch(config)# policy-map type queuing shape_queues
switch(config-pmap-que)#

Configures the policy map of type queuing and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 3

class type queuingclass-name

Example:

switch(config-pmap-que)# class type queuing c-out-q1
switch(config-pmap-c-que)#

Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in the previous System-Defined Type queuing Class Maps table.

Step 4

Assign a minimum rate of the interface bandwidth or assign the percentage of the bandwidth that remains:

  • Bandwidth percent:

    bandwidth {percent percent}
  • Bandwidth remaining percent:

    bandwidth remaining percent percent

Example:

  • Bandwidth percent:

    switch(config-pmap-c-que)# bandwidth percent 25
  • Bandwidth remaining percent:

    switch(config-pmap-c-que)# bandwidth remaining percent 25
  • Bandwidth percent:

    Assigns a minimum rate of the interface bandwidth to an output queue as the percentage of the underlying interface link rate. The range is from 0 to 100.

    The example shows how to set the bandwidth to a minimum of 25 percent of the underlying link rate.

  • Bandwidth remaining percent:

    Assigns the percentage of the bandwidth that remains to this queue. The range is from 0 to 100.

    The example shows how to set the bandwidth for this queue to 25 percent of the remaining bandwidth.

Step 5

(Optional) Repeat Steps 3 and 4 to assign tail drop thresholds for other queue classes.

Step 6

exit

Example:

switch(config-cmap-que)# exit
switch(config)#

Exits policy-map queue mode and enters global configuration mode.

Step 7

show policy-map [type queuing [policy-map-name | default-out-policy]]

Example:

switch(config-pmap-c-que)# show policy-map type queuing shape_queues

(Optional) Displays information about all configured policy maps, all policy maps of type queuing, a selected policy map of type queuing, or the default output queuing policy.

Step 8

copy running-config startup-config

Example:

switch(config)# copy running-config
startup-config

(Optional) Saves the running configuration to the startup configuration.

Example

This example shows how to configure the interface bandwidth:


switch(config)# policy-map type queuing inq
switch(config-pmap-que)# class type queuing c-in-q3
switch(config-pmap-c-que)# bandwidth percent 30
switch(config-pmap-que)# class type queuing c-in-q2
switch(config-pmap-c-que)# bandwidth percent 20
switch(config-pmap-que)# class type queuing c-in-q1
switch(config-pmap-c-que)# bandwidth percent 10
switch(config-pmap-que)# class type queuing c-in-q-default
switch(config-pmap-c-que)# bandwidth percent 40

Configuring Priority

If you do not specify the priority, the system-defined egress pq queues behave as normal queues. For information on the system-defined type queuing class maps, see the "Using Modular QoS CLI" section.

You can configure only one level of priority on an egress priority queue. You use the system-defined priority queue class for the type of module to which you want to apply the policy map.

For the nonpriority queues, you can configure how much of the remaining bandwidth to assign to each queue. By default, the device evenly distributes the remaining bandwidth among the nonpriority queues.


Note

When a priority queue is configured, the other queues can only use the remaining bandwidth in the same policy map.



Note

When configuring priority for one class map queue (SPQ), you need to configure the priority for QoS group 3. When configuring priority for more than one class map queue, you need to configure the priority on the higher numbered QoS groups. In addition, the QoS groups need to be adjacent to each other. For example, if you want to have two SPQs, you have to configure the priority on QoS group 3 and on QoS group 2.


SUMMARY STEPS

  1. configure terminal
  2. policy-map type queuing {[match-first] policy-map-name}
  3. class type queuing class-name
  4. priority [level value]
  5. class type queuingclass-name
  6. bandwidth remaining percent percent
  7. (Optional) Repeat Steps 5 to 6 to assign the remaining bandwidth for the other nonpriority queues.
  8. exit
  9. show policy-map [type queuing [policy-map-name | default-out-policy]]
  10. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

policy-map type queuing {[match-first] policy-map-name}

Example:

switch(config)# policy-map type queuing priority_queue1
switch(config-pmap-que)#

Configures the policy map of type queuing and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 3

class type queuing class-name

Example:

switch(config-pmap-que)# class type queuing c-out-q1
switch(config-pmap-c-que)#

Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in the previous System-Defined Type queuing Class Maps table.

Step 4

priority [level value]

Example:

switch(config-pmap-c-que)# priority

Selects this queue as a priority queue. Only one priority level is supported.

Step 5

class type queuingclass-name

Example:

switch(config-pmap-que)# class type queuing c-out-q2
switch(config-pmap-c-que)#

(Optional) Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in the previous System-Defined Type queuing Class Maps table.

Choose a nonpriority queue where you want to configure the remaining bandwidth. By default, the system evenly distributes the remaining bandwidth among the nonpriority queues.

Step 6

bandwidth remaining percent percent

Example:

switch(config-pmap-c-que)# bandwidth remaining percent 25

(Optional) Assigns the percent of the bandwidth that remains to this queue. The range is from 0 to 100.

Step 7

(Optional) Repeat Steps 5 to 6 to assign the remaining bandwidth for the other nonpriority queues.

Step 8

exit

Example:

switch(config-cmap-que)# exit
switch(config)#

Exits policy-map queue mode and enters global configuration mode.

Step 9

show policy-map [type queuing [policy-map-name | default-out-policy]]

Example:

switch(config)# show policy-map type queuing priority_queue1

(Optional) Displays information about all configured policy maps, all policy maps of type queuing, a selected policy map of type queuing, or the default output queuing policy.

Step 10

copy running-config startup-config

Example:

switch(config)# copy running-config
startup-config

(Optional) Saves the running configuration to the startup configuration.

Configuring Priority for FEX


Note

Priority for FEX is not supported on the Cisco Nexus 9508 switch (NX-OS 7.0(3)F3(3).


If you do not specify the priority, the system-defined egress pq queues behave as normal queues. For information on the system-defined type queuing class maps, see the "Using Modular QoS CLI" section.

You can configure only one level of priority on an egress priority queue. You use the system-defined priority queue class for the type of module to which you want to apply the policy map.

For the nonpriority queues, you can configure how much of the remaining bandwidth to assign to each queue. By default, the device evenly distributes the remaining bandwidth among the non-priority queues.


Note

When a priority queue is configured, the other queues can only use the remaining bandwidth in the same policy map.



Note

When configuring priority for one class map queue (SPQ), you need to configure the priority for QoS group 3. When configuring priority for more than one class map queue, you need to configure the priority on the higher numbered QoS groups. In addition, the QoS groups need to be adjacent to each other. For example, if you want to have two SPQs, you have to configure the priority on QoS group 3 and on QoS group 2.


Before you begin

Before configuring the FEX, enable feature-set fex .

SUMMARY STEPS

  1. configure terminal
  2. policy-map type queuing {[match-first] policy-map-name}
  3. class type queuing class-name
  4. priority [level value]
  5. class type queuing class-name
  6. bandwidth remaining percent percent
  7. (Optional) Repeat Steps 5 to 6 to assign the remaining bandwidth for the other nonpriority queues.
  8. exit
  9. show policy-map [type queuing [policy-map-name | default-out-policy]]
  10. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

policy-map type queuing {[match-first] policy-map-name}

Example:

switch(config)# policy-map type queuing priority_queue1
switch(config-pmap-que)#

Configures the policy map of type queuing and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 3

class type queuing class-name

Example:

switch(config-pmap-que)# class type queuing c-out-q3
switch(config-pmap-c-que)#

Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in the previous System-Defined Type queuing Class Maps table.

Step 4

priority [level value]

Example:

switch(config-pmap-c-que)# priority

Selects this queue as a priority queue. Only one priority level is supported.

Note 

FEX QoS priority is supported only on the c-out-q3 class map.

Step 5

class type queuing class-name

Example:

switch(config-pmap-que)# class type queuing c-out-q3
switch(config-pmap-c-que)#

(Optional) Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in the previous System-Defined Type queuing Class Maps table.

Choose a nonpriority queue where you want to configure the remaining bandwidth. By default, the system evenly distributes the remaining bandwidth among the nonpriority queues.

Step 6

bandwidth remaining percent percent

Example:

switch(config-pmap-c-que)# bandwidth remaining percent 25

(Optional) Assigns the percent of the bandwidth that remains to this queue. The range is from 0 to 100.

Step 7

(Optional) Repeat Steps 5 to 6 to assign the remaining bandwidth for the other nonpriority queues.

Step 8

exit

Example:

switch(config-cmap-que)# exit
switch(config)#

Exits policy-map queue mode and enters global configuration mode.

Step 9

show policy-map [type queuing [policy-map-name | default-out-policy]]

Example:

switch(config)# show policy-map type queuing priority_queue1

(Optional) Displays information about all configured policy maps, all policy maps of type queuing, a selected policy map of type queuing, or the default output queuing policy.

Step 10

copy running-config startup-config

Example:

switch(config)# copy running-config
startup-config

(Optional) Saves the running configuration to the startup configuration.

Example

This example shows how to configure the level of priority:


switch(config)# policy-map type queuing inq_pri
switch(config-pmap-que)# class type queuing c-in-q3
switch(config-pmap-c-que)# priority
switch(config-pmap-que)# class type queuing c-in-q2
switch(config-pmap-c-que)# bandwidth remaining percent 20
switch(config-pmap-que)# class type queuing c-in-q1
switch(config-pmap-c-que)# bandwidth remaining percent 40
switch(config-pmap-que)# class type queuing c-in-q-default
switch(config-pmap-c-que)# bandwidth remaining percent 40

Configuring Traffic Shaping

You can configure traffic shaping on an egress queue to impose a minimum and maximum rate on it.


Note

Configuring traffic shaping for a queue is independent of priority or bandwidth in the same policy map.



Note

The system queuing policy is applied to both internal and front panel ports. When traffic shaping is enabled on the system queuing policy, traffic shaping is also applied to the internal ports. As a best practice, do not enable traffic shaping on the system queuing policy.



Note

Traffic shaping is not supported on the Cisco Nexus 9300 40G ports.



Note

The lowest value that the egress shaper can manage, per queue, is 100 Mbps on Cisco Nexus 9200 series, 9300-EX/FX/FX2, and 9700-EX/FX switches.


Before you begin

Configure random detection minimum and maximum thresholds for packets.

SUMMARY STEPS

  1. configure terminal
  2. policy-map type queuing {[match-first] policy-map-name}
  3. class type queuing class-name
  4. shape min value {bps | gbps | kbps | mbps | pps} max value {bps | gbps | kbps | mbps | pps}
  5. (Optional) Repeat Steps 3 and 4 to assign tail drop thresholds for other queue classes.
  6. show policy-map [type queuing [policy-map-name | default-out-policy]]
  7. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

policy-map type queuing {[match-first] policy-map-name}

Example:

switch(config)# policy-map type queuing shape_queues
switch(config-pmap-que)#

Configures the policy map of type queuing and then enters policy-map mode for the policy-map name you specify. Policy-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 3

class type queuing class-name

Example:

switch(config)# class type queuing c-out-q-default
switch(config-pmap-c-que)#

Configures the class map of type queuing and then enters policy-map class queuing mode. Class queuing names are listed in the previous System-Defined Type queuing Class Maps table.

Step 4

shape min value {bps | gbps | kbps | mbps | pps} max value {bps | gbps | kbps | mbps | pps}

Example:

switch(config-pmap-c-que)# shape min 10 bps max 100 bps

Assigns a minimum and maximum bit rate on an output queue. The default bit rate is in bits per second (bps).

The example shows how to shape traffic to a minimum rate of 10 bits per second (bps) and a maximum rate of 100 bps.

Note 

Most scenarios where traffic shaping is needed requires the configuration of only the max shaper value. For instance, if you want traffic shaped and limited to a maximum desired rate, configure the min shaper value as 0 and the max shaper value as the maximum desired rate.

You should only configure the min shaper value for specific scenarios where a guaranteed rate is desired. For instance, if you want traffic to have a guaranteed rate, configure the min shaper value as the guaranteed rate and the max value as something greater than guaranteed rate (or the maximum of the port speed rate).

Step 5

(Optional) Repeat Steps 3 and 4 to assign tail drop thresholds for other queue classes.

Step 6

show policy-map [type queuing [policy-map-name | default-out-policy]]

Example:

switch(config)# show policy-map type queuing shape_queues

(Optional) Displays information about all configured policy maps, all policy maps of type queuing, a selected policy map of type queuing, or the default output queuing policy.

Step 7

copy running-config startup-config

Example:

switch(config)# copy running-config
startup-config

(Optional) Saves the running configuration to the startup configuration.

Applying a Queuing Policy on a System

You apply a queuing policy globally on a system.

SUMMARY STEPS

  1. configure terminal
  2. system qos
  3. service-policy type queuing output {policy-map-name | default-out-policy}

DETAILED STEPS

  Command or Action Purpose
Step 1

configure terminal

Example:

switch# configure terminal
switch(config)#

Enters global configuration mode.

Step 2

system qos

Example:

switch (config)# system qos
switch (config-sys-qos)#

Enters system qos mode.

Step 3

service-policy type queuing output {policy-map-name | default-out-policy}

Example:

switch (config-sys-qos)# service-policy type queuing map1

Adds the policy map to the input or output packets of system.

Note 

The output keyword specifies that this policy map should be applied to traffic transmitted from an interface.

Note 

To restore the system to the default queuing service policy, use the no form of this command.

Verifying the Queuing and Scheduling Configuration

Use the following commands to verify the queuing and scheduling configuration:

Command

Purpose

show class-map [type queuing [class-name]]

Displays information about all configured class maps, all class maps of type queuing, or a selected class map of type queuing.

show policy-map [type queuing [policy-map-name | default-out-policy]]

Displays information about all configured policy maps, all policy maps of type queuing, a selected policy map of type queuing, or the default output queuing policy.

show policy-map system

Displays information about all configured policy maps on the system.

Controlling the QoS Shared Buffer

The QoS buffer provides support per port/queue and shared space. You can control the QoS buffer that is shared by all flows by disabling or restricting reservations.

The hardware qos min-buffer command is used to control the QoS shared buffer.

hardware qos min-buffer [all|default|none]

  • all

    Current behavior where all reservations are enabled ON).

  • default

    Enables reservations only for qos-group-0.

  • none

    Disables reservations for all qos-groups.

The show hardware qos min-buffer command is used to display the current buffer configuration.

Monitoring the QoS Packet Buffer

The Cisco Nexus 9000 Series device has a 12-MB buffer memory that divides into a dedicated per port and dynamic shared memory. Each front-panel port has four unicast queues and four multicast queues in egress. In the scenario of burst or congestion, each egress port consumes buffers from the dynamic shared memory.

You can display the real-time and peak status of the shared buffer per port. All counters are displayed in terms of the number of cells. Each cell is 208 bytes in size. You can also display the global level buffer consumption in terms of consumption and available number of cells.


Note

Monitoring the shared buffer on ALE enabled devices is not supported for the port level.



Note

In the examples shown in this section, the port numbers are Broadcom ASIC ports.


This example shows how to clear the system buffer maximum cell usage counter:

switch# clear counters buffers
Max Cell Usage has been reset successfully

This example shows how to set a buffer utilization threshold for a specific module:

switch(config)# hardware profile buffer info port-threshold module 1 threshold 10
Port threshold changed successfully


Note

The buffer threshold feature is not enabled for ports if they have a no-drop class configured (PFC).



Note

The configured threshold buffer count is checked every 5 seconds against all the buffers used by that port across all the queues of that port.



Note

You can configure the threshold percentage configuration for all modules or for a specific module, which is applied to all ports. The default threshold value is 90% of the switch cell count of shared pool SP-0. This configuration applies to both Ethernet (front panel) and internal (HG) ports.



Note

The buffer threshold feature is not supported for ACI capable device ports.


This example shows how to display the interface hardware mappings:

eor15# show interface hardware-mappings 
Legends:
       SMod  - Source Mod. 0 is N/A
       Unit  - Unit on which port resides. N/A for port channels
       HPort - Hardware Port Number or Hardware Trunk Id:
       FPort - Fabric facing port number. 255 means N/A
       NPort - Front panel port number
       VPort - Virtual Port Number. -1 means N/A

--------------------------------------------------------------------
Name       Ifindex  Smod Unit HPort FPort NPort VPort
--------------------------------------------------------------------
Eth2/1     1a080000 4    0    13    255   0     -1   
Eth2/2     1a080200 4    0    14    255   1     -1   
Eth2/3     1a080400 4    0    15    255   2     -1   
Eth2/4     1a080600 4    0    16    255   3     -1   
Eth2/5     1a080800 4    0    17    255   4     -1   
Eth2/6     1a080a00 4    0    18    255   5     -1   
Eth2/7     1a080c00 4    0    19    255   6     -1   
Eth2/8     1a080e00 4    0    20    255   7     -1   
Eth2/9     1a081000 4    0    21    255   8     -1   
Eth2/10    1a081200 4    0    22    255   9     -1   
Eth2/11    1a081400 4    0    23    255   10    -1   
Eth2/12    1a081600 4    0    24    255   11    -1   
Eth2/13    1a081800 4    0    25    255   12    -1   
Eth2/14    1a081a00 4    0    26    255   13    -1   
Eth2/15    1a081c00 4    0    27    255   14    -1   
Eth2/16    1a081e00 4    0    28    255   15    -1   
Eth2/17    1a082000 4    0    29    255   16    -1   
Eth2/18    1a082200 4    0    30    255   17    -1   
Eth2/19    1a082400 4    0    31    255   18    -1   
Eth2/20    1a082600 4    0    32    255   19    -1   
Eth2/21    1a082800 4    0    33    255   20    -1   
Eth2/22    1a082a00 4    0    34    255   21    -1   
Eth2/23    1a082c00 4    0    35    255   22    -1   
Eth2/24    1a082e00 4    0    36    255   23    -1 

Configuration Examples for Queuing and Scheduling

In this section, you can find examples of configuring queuing and scheduling.


Note

The default system classes type queuing match based on qos-group (by default all traffic matches to qos-group 0, and this default queue gets 100% bandwidth). Create a type QoS policy that first sets the qos-group in order to drive the correct matching for the type queuing classes and policies.


Example: Configuring WRED on Egress Queues

The following example shows how to configure the WRED feature on an egress queue:

configure terminal
  class-map type queuing match-any c-out-q1
    match qos-group 1
  class-map type queuing match-any c-out-q2
    match qos-group 1
  policy-map type queuing wred
    class type queuing c-out-q1
      random-detect minimum-threshold 10 bytes maximum-threshold 1000 bytes
    class type queuing c-out-q2
      random-detect threshold burst-optimized ecn

Example: Configuring Traffic Shaping

The following example shows how to configure traffic shaping using 1000 packets per second (pps)::

configure terminal
  class-map type queuing match-any c-out-q1
    match qos-group 1
  class-map type queuing match-any c-out-q2
    match qos-group 1
policy-map type queuing pqu
	class type queuing c-out-q1
		shape min 100 pps max 500 pps
	class type queuing c-out-q2
		shape min 200 pps max 1000 pps
show policy-map type queuing pqu