Configuring QoS

This chapter contains the following sections:

Information About Quality of Service

The configurable Cisco NX-OS quality of service (QoS) features allow you to classify the network traffic, prioritize the traffic flow, and provide congestion avoidance.

The default QoS configuration on the device provides best-effort service for Ethernet traffic. QoS can be configured to provide additional classes of service for Ethernet traffic. Cisco NX-OS QoS features are configured using Cisco Modular QoS CLI (MQC).

In the event of congestion or collisions, Ethernet will drop packets. The higher level protocols detect the missing data and retransmit the dropped packets.

Modular QoS CLI

The Cisco Modular QoS CLI (MQC) provides a standard set of commands for configuring QoS.

You can use MQC to define additional traffic classes and to configure QoS policies for the whole system and for individual interfaces. Configuring a QoS policy with MQC consists of the following steps:

  1. Define traffic classes.
  2. Associate policies and actions with each traffic class.
  3. Attach policies to logical or physical interfaces as well as at the global system level.

MQC provides two command types to define traffic classes and policies:

class-map

Defines a class map that represents a class of traffic based on packet-matching criteria. Class maps are referenced in policy maps.

The class map classifies incoming packets based on matching criteria, such as the IEEE 802.1p class of service (CoS) value. Unicast and multicast packets are classified.

policy-map

Defines a policy map that represents a set of policies to be applied on a class-by-class basis to class maps.

The policy map defines a set of actions to take on the associated traffic class, such as limiting the bandwidth or dropping packets.

You define the following class-map and policy-map object types when you create them:

network-qos

Defines MQC objects that you can use for system level related actions.

qos

Defines MQC objects that you can use for classification.

queuing

Defines MQC objects that you can use for queuing and scheduling at egress and for configuring buffer threshold and priority group mapping at ingress.


Note

The qos type is the default for the class-map and policy-map commands, but not for the service-policy which requires that you specify an explicit type.


You can attach policies to interfaces or EtherChannels as well as at the global system level by using the service-policy command.

You can view all or individual values for MQC objects by using the show class-map and show policy-map commands.

An MQC target is an entity (such as an Ethernet interface) that represents a flow of packets. A service policy associates a policy map with an MQC target and specifies whether to apply the policy on incoming or outgoing packets. This mapping enables the configuration of QoS policies such as marking, bandwidth allocation, buffer allocation, and so on.

System Classes

The system qos is a type of MQC target. You use a service policy to associate a policy map with the system qos target. A system qos policy applies to all interfaces on the switch unless a specific interface has an overriding service-policy configuration. The system qos policies are used to define system classes, the classes of traffic across the entire switch, and their attributes.

If service policies are configured at the interface level, the interface-level policy always takes precedence over system class configuration or defaults.

Default System Classes

The device provides the drop system class.

By default, the software classifies all unicast and multicast Ethernet traffic into the default drop system class. This class is identified by qos-group 0.

This class is created automatically when the system starts up (the class is named class-default in the CLI). You cannot delete this class and you cannot change the match criteria associated with the default class.

Information About Policy Types

The device supports a number of policy types. You create class maps in the policy types.

There are three policy types:

  • Network-qos

  • Queuing

  • QoS

The following QoS parameters can be specified for each type of class:

  • Type network-qos—A network-qos policy is used to instantiate system classes and associate parameters with those classes that are of system-wide scope.

    • Classification—The traffic that matches this class is as follows:

      • QoS Group—A class map of type network-qos identifies a system class and is matched by its associated qos-group.

    • Policy—The actions that are performed on the matching traffic are as follows:


      Note

      A network-qos policy can only be attached to the system QoS target.


      • MTU—The MTU that needs to be enforced for the traffic that is mapped to a system class.


        Note

        The Cisco Nexus device supports one MTU for traffic for all classes for all ports. However, you can have different MTUs for different classes. The MTUs are used for PFC buffer calculation.
      • Set CoS value—This configuration is used to mark 802.1p values for all traffic mapped to this system class.

      • Congestion Control WRED—Weighted random early detection (WRED) anticipates and avoids congestion before congestion occurs. WRED drops packets, based on the average queue length that exceeds a specific threshold value, to indicate congestion. You can configure congestion avoidance with WRED in egress policy maps. By default, tail-drop is the congestion control mechanism. To enable WRED, use the congestion-control random-detect command in network-qos policy map mode.

      • ECN—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 explicit congestion notification (ECN) feature, routers and end hosts use this marking as a signal that the network is congested to slow down sending packets. To enable an ECN, use the congestion-control random-detect ecn command in the network-qos policy map mode.

        ECN is supported on all types of Cisco Nexus 3000 series switches.


        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.
      • No drop—No drop specifies lossless service for the system class.

  • Type queuing—The Cisco Nexus device supports type queuing in the ingress and egress directions. Egress type queuing policies are used to define the scheduling characteristics of the queues. Ingress type queuing policies are used to define the pause buffer thresholds, priority group, and queue limit.


    Note

    Some configuration parameters when applied to an EtherChannel are not reflected on the configuration of the member ports.


    • Classification—The traffic that matches this class is as follows:

      • QoS Group—A class map of type queuing identifies a system class and is matched by its associated QoS group.

    • Policy—The actions that are performed on the matching traffic are as follows:


      Note

      These policies can be attached to the system qos target or to any interface.


      • Egress queuing policy—The egress queuing policy is used to configure egress queues on the device.

        • Bandwidth—Sets the guaranteed scheduling deficit weighted round robin (DWRR) percentage for the system class.

        • Priority—Sets a system class for strict-priority scheduling. Only one system class can be configured for priority in a given queuing policy. For Cisco Nexus 3132 and 3172 switches, there are three strict priority levels.

        • Shape and minimum guarantee—Specifies the burst size and minimum guaranteed bandwidth for this queue.

        • Queue limit—Specifies either the static or dynamic queue limit for Cisco Nexus 3100 Series switches. The static queue limit defines the fixed size to which the queue can grow.

      • Ingress queuing policy—The ingress queuing policy is used to define the pause buffer thresholds, priority group, and queue limit.

        • Pause buffer threshold—Sets the pause and resume buffer threshold settings for ingress traffic.

        • Priority group—Classifies the traffic and monitors statistics on no-drop classes.

        • Queue limit—Sets the shared buffer usage per priority group.

    You can configure the threshold for using shared buffers both at ingress and egress based on the alpha value, which is derived from the index. The index ranges from 0 to 9 for Cisco Nexus 3000 series switches and from 0 to 10 for Cisco Nexus 3100 platform switches. At ingress, the alpha value is used to calculate the per port, per priority group share of the buffers available from the current free pool. At egress, the alpha value is used to calculate the per port, per queue share of the buffers available from the current free pool.

    For the Cisco Nexus 3000 series switches, the alpha values are as follows:

    Index Alpha Value
    0 1/64
    1 1/32
    2 1/16
    3 1/8
    4 1/4
    5 1/2
    6 1
    7 2
    8 4

    9

    Note 

    Index 9 is not applicable for Cisco Nexus 34180YC.

    Cisco Nexus 34180YC has an index range from 0 to 8.

    8

    For the Cisco Nexus 3100 platform switches, the alpha values are as follows:

    Index Alpha Value
    0 1/128
    1 1/64
    2 1/32
    3 1/16
    4 1/8
    5 1/4
    6 1/2
    7 1
    8 2

    9

    Note 

    Index 9 is not applicable for Cisco Nexus 34180YC.

    Cisco Nexus 34180YC has an index range from 0 to 8.

    4

    10

    Note 

    Index 10 is not applicable for Cisco Nexus 34180YC.

    Cisco Nexus 34180YC has an index range from 0 to 8.

    8
  • To determine the default shared alpha value, use one of the following commands:

    • For Cisco NX-OS 6.x, use the test hardware internal bcm-usd bcm-diag-shell command to determine the default shared alpha value.

      For example:

      
      switch# test hardware internal bcm-usd bcm-diag-shell
      Available Unit Numbers: 0
      bcm-shell.0> d chg MMU_THDU_XPIPE_CONFIG_QUEUE
      MMU_THDU_XPIPE_CONFIG_QUEUE.mmu0[0]:
      <Q_SHARED_LIMIT_CELL=7,Q_SHARED_ALPHA_CELL=7,Q_MIN_LIMIT_CELL=0xb,
      Q_LIMIT_DYNAMIC_CELL=1,Q_COLOR_LIMIT_DYNAMIC_CELL=1,DATA=0x000000000c00160007>
    • For Cisco NX-OS 7.x, use the bcm-shell module 1 command to determine the default shared alpha value.

      For example:

      
      switch# bcm-shell module 1
      Available Unit Numbers: 0
      bcm-shell.0> d chg MMU_THDU_XPIPE_CONFIG_QUEUE
      MMU_THDU_XPIPE_CONFIG_QUEUE.mmu0[0]:
      <Q_SHARED_LIMIT_CELL=7,Q_SHARED_ALPHA_CELL=7,Q_MIN_LIMIT_CELL=0xb,
      Q_LIMIT_DYNAMIC_CELL=1,Q_COLOR_LIMIT_DYNAMIC_CELL=1,DATA=0x000000000c00160007>
  • In dynamic mode, the amount of shared buffer a port can consume based on the alpha parameter is the queue's threshold: alpha value * (number of unused cells in the buffer). In general, as the number of unused cells decreases (ie. the buffer becomes fuller), the queue's threshold reduces.

  • Type qos—A type QoS policy is used to classify traffic that is based on various Layer 2, Layer 3, and Layer 4 fields in the frame and to map it to system classes.


    Note

    Some configuration parameters when applied to an EtherChannel are not reflected on the configuration of the member ports.


    • Classification—The traffic that matches this class are as follows:

      • Access Control Lists—Classifies traffic based on the criteria in existing ACLs.

      • Class of Service—Matches traffic based on the CoS field in the frame header.

      • DSCP—Classifies traffic based on the Differentiated Services Code Point (DSCP) value in the DiffServ field of the IP header.

      • IP Real Time Protocol—Classifies traffic on the port numbers used by real-time applications.

      • Precedence—Classifies traffic based on the precedence value in the type of service (ToS) field of the IP header.

    • Policy—The actions that are performed on the matching traffic are as follows:


      Note

      This policy can be attached to the system or to any interface. It applies to input traffic only.
      • QoS Group—Sets the QoS group that corresponds to the system class this traffic flow is mapped to.

        The Cisco Nexus 3000 Series switches support:

        • Eight QoS groups

        • Eight queues for unicast

        • Four queues for multicast

          Note 

          Cisco Nexus 34180YC has eight queues for both unicast and multicast.

        The Cisco Nexus 3100 platform switches support:

        • Eight QoS groups

        • Eight queues for unicast

        • Eight queues for multicast

        For Cisco Nexus 3100 platform switches, each QoS group is mapped to one multicast queue. The mapping is QoS group 0 mapped to multicast queue 1, QoS group 1 mapped to multicast queue 2, and so forth.

MTU

The Cisco Nexus device supports one MTU for all classes for all ports.

When configuring MTU, follow these guidelines:

  • For the Cisco Nexus device, the MTU is controlled by the value configured on the class default.

  • Enter the system jumbomtu command to define the upper bound of any MTU in the system. The system jumbo MTU has a default value of 9216 bytes. The minimum MTU is 1500 bytes and the maximum MTU is 9216 bytes.

  • The system class MTU sets the MTU for all packets in the class. The system class MTU cannot be configured larger than the global jumbo MTU.

  • The default system class has a default MTU of 1500 bytes. You can configure this value.

  • You can specify the MTU value for either a single Layer 3 interface or a range of Layer 3 interfaces. When you change the Layer 3 interface MTU value to the jumbo MTU value (1500 bytes or greater), you must also change the network QoS MTU value to 1500 bytes or greater.

  • You can set the MTU per class of the network-qos policy. The MTU that is set is used to decide the buffer allocations for PFC. On a need basis, you can configure some classes to have an MTU of 9216 and some to have an MTU of 1500, depending on the type of traffic expected on that class. This will help the system configure the PFC buffers when a class is configured as a no-drop-class.
  • On Cisco Nexus 3500 Switches, MTU for all classes must be same as the one configured for the default-class.

Trust Boundaries

The trust boundary is enforced by the incoming interface as follows:

  • By default, all Ethernet interfaces are trusted interfaces.The 802.1p CoS and DSCP are preserved unless the marking is configured. There is no default CoS to queue and DSCP to queue mapping. You can define and apply a policy to create these mappings. By default, without a user defined policy, all traffic is assigned to the default queue.


    Note

    For Cisco Nexus 34180YC, all ports are trusted interfaces.


  • Any packet that is not tagged with an 802.1p CoS value is classified into the default drop system class. If the untagged packet is sent over a trunk, it is tagged with the default untagged CoS value, which is zero.

  • You can override the default untagged CoS value for an Ethernet interface or port channel.

After the system applies the untagged CoS value, QoS functions the same as for a packet that entered the system tagged with the CoS value.

Ingress Classification Policies

You use classification to partition traffic into classes. You classify the traffic based on the packet property (CoS field) or the packet header fields that include IP precedence, Differentiated Services Code Point (DSCP), and Layer 2 to Layer 4 parameters. The values used to classify traffic are called match criteria.

Traffic that fails to match any class is assigned to a default class of traffic called class-default.

Priority Groups for No-Drop Classes

In Cisco Nexus 3000 series switches and Cisco Nexus 3100 platform switches, packets are handled as cells. Each cell holds 208 bytes of data. One packet can be split into many cells, but each cell can contain a maximum of one packet. Priority groups are groups of cells on which the PFC thresholds are applied. They apply only to no-drop classes and are used for classifying traffic and monitoring statistics.


Note

For Cisco Nexus 34180YC, the maximum amount of data in a cell is 80 bytes.


You can associate a no-drop class with a priority group number in the input queuing policy map to guarantee MTU buffers for the specified traffic class. The pause thresholds for the no-drop class are applied on the priority group.

By default, the priority group number is assigned by the system. You can override it by using the priority-group command.


Note

You cannot have multiple no-drop classes mapped to the same priority group.

Egress Queuing Policies

You can associate an egress policy map with an Ethernet interface to guarantee the bandwidth for the specified traffic class or to configure the egress queues.

Each Ethernet interface supports up to eight queues, one for each system class. The queues have the following default configuration:

  • In addition to these queues, control traffic that is destined for the CPU uses strict priority queues. These queues are not accessible for user configuration.


    Note

    For Cisco Nexus 34180YC, queue 7 is used for CPU traffic and is user configurable. However, as a best practice do not change queue 7 from strict priority to any other type of scheduling. Congesting queue 7 with data traffic leads to control packet loss.


  • Standard Ethernet traffic in the default drop system class is assigned a queue. This queue uses WRR scheduling with 100 percent of the bandwidth.

If you add a system class, a queue is assigned to the class. You must reconfigure the bandwidth allocation on all affected interfaces. Bandwidth is not dedicated automatically to user-defined system classes.

You can configure one strict priority queue for Cisco Nexus 3000 series switches and Cisco Nexus 3500 platform switches. This queue is serviced before all other queues except the control traffic queue (which carries control rather than data traffic).


Note

Cisco Nexus 34180YC supports a maximum of seven priority queues.


You can configure up to three strict priority queues with multiple priority levels on Cisco Nexus 3100 platform switches.


Note

Cisco Nexus 34180YC supports a maximum of seven priority queues.


QoS for Traffic Directed to the CPU

The device automatically applies QoS policies to traffic that is directed to the CPU to ensure that the CPU is not flooded with packets. Control traffic, such as bridge protocol data units (BPDU) frames, is given higher priority to ensure delivery.

QoS Configuration Guidelines and Limitations

To maintain optimal switch performance, follow these guidelines when configuring system classes and policies:

  • Starting with Release 7.0(3)I2(1), the show queuing interface ethernet slot/chassis_number command displays two more options: module and summary in the output. These additional options do not have any functionality impact. See the following example of the output:
    # show queuing interface eth1/1 ?
      <CR>     
      ,        Multi range separator
      -        Range separator
      .        Sub interface separator
      >        Redirect it to a file
      >>       Redirect it to a file in append mode
      module   Slot/module                                              
      summary  Summary
      |        Pipe command output to filter
  • Prior to Release 7.0(3)I2(1), the switch prompt for policy-map type network-qos was switch(config-pmap-nq)#. Starting with Release 7.0(3)I2(1), the new switch prompt for policy-map type network-qos is switch(config-pmap-nqos)#. The change in the switch prompt is required to be taken care of in the scripts.

  • Prior to Release 7.0(3)I2(1), if a non-existing class was configured under a policy-map, an error message would be displayed. Starting with Release 7.0(3)I2(1), if a non-existing class is configured under a policy-map, a new class-map is created and the prompt changes from config-pmap-nqos to config-cmap-nqos as displayed in the following example:
    
    switch(config)# show class-map type network-qos 
    
      Type network-qos class-maps
      ===========================
      class-map type network-qos pfcCos2
        match qos-group 2
      class-map type network-qos pfcCos3
        match qos-group 3
      class-map type network-qos pfcCos5
        match qos-group 5
      class-map type network-qos class-default
        match qos-group 0
    
    switch(config)# 
    switch(config)# policy-map type network-qos pfcCos
    switch(config-pmap-nqos)# class type network-qos pfcCos                                                  
    switch(config-cmap-nqos)# show class-map type network-qos 
    
      Type network-qos class-maps
      ===========================
      class-map type network-qos pfcCos                                                                                              
      class-map type network-qos pfcCos2
        match qos-group 2
      class-map type network-qos pfcCos3
        match qos-group 3
      class-map type network-qos pfcCos5
        match qos-group 5
      class-map type network-qos class-default
        match qos-group 0
    
    switch(config-cmap-nqos)#
  • Starting with Release 7.0(3)I2(1), the command show queuing interface displays the queues even without applying the network-qos policy.

  • The output of the show queuing interface command displays an option for the internal HiGig2 interface. These interfaces are not relevant and the additional option does not have any functional impact.

  • Starting with Release 7.0(3)I2(1), the output format and the fields of the show policy-map interface <> type queuing CLI command have been updated. For Class-map (queuing), the following fields are displayed: policy, bandwidth percent, queue dropped pkts, and queue depth in bytes.

  • Prior to Release 7.0(3)I2(1), removing the default bandwidth configuration from the default queuing class used to set the bandwidth to 50%. Starting with Release 7.0(3)I2(1), removing the default bandwidth configuration sets the bandwidth to the default value of 100%. You can set the bandwidth to 50% by configuring bandwidth percent 50. You can use the no bandwidth <bw-input> CLI command to remove the bandwidth configuration.

  • Prior to Release 7.0(3)I2(1), only priority level 1 was supported in the pmap configuration. Starting with Release 7.0(3)I2(1), you can configure priority levels 2 and 3 in the pmap configuration. Release 7.0(3)I2(1) supports only the functionality for priority level 1 for Cisco Nexus 3000 Series platforms even though both priority level 2 and 3 are allowed in the pmap configuration in the Cisco Nexus 3000 Series platforms. Cisco Nexus 3100 Series platforms support priority level 1, 2, 3 with functionality perspective.

  • Starting with Release 7.0(3)I2(1), the output format and the fields of the show queuing interface eth <> CLI command have been updated. The output displays all qos-groups, control qos group, SPAN qos-group, and pfc statistics.The xon drops, xoff drops, and the HW MTU fields are not displayed in the new format.

  • ECN is supported on the Cisco Nexus 3000 series switches and the Cisco Nexus 3132 switch. It is not supported on Cisco Nexus 3172 switches.

  • WRED and ECN configuration is not supported on a class mapped to qos-group 1 for Cisco Nexus 3000 Series switches. However, WRED and ECN configuration is supported on a class mapped to qos-group 1 for the Cisco Nexus 3132 switch.

  • Starting with Release 6.0(2)U5(1), the queue-limit CLI under the queuing policy is enhanced to support zero egress queue size to drop all packets on the queue. In scenarios where a particular type of traffic needs to be dropped without using the drop ACLs, the traffic can be mapped to a dedicated egress queue and then the queue-size 0 bytes can be applied using this enhancement. As a result, all UC and MC traffic mapped to the queue gets dropped completely.

  • Starting with Release 6.0(2)U5(1), the switch allows different modes of min-buffer allocation that can reduce the overall min-buffers allocated per port, in turn increasing the shared pool size. If the shared pool size is higher, the burst absorption capability of the switch is better.

When configuring EtherChannels, note the following guidelines:

  • The service policy configured on an EtherChannel applies to all member interfaces.

Configuring System Classes

Configuring Class Maps

You can create or modify a class map with the class-map command. The class map is a named object that represents a class of traffic. In the class map, you specify a set of match criteria for classifying the packets. You can then reference class maps in policy maps.


Note

The class map type default is type qos and its match criteria default is match-all.


Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map [type {network-qos | qos | queuing}] class-map name

Creates or accesses a named object that represents the specified class of traffic.

Class-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

The three class-map configuration modes are as follows:

  • network-qos—Network-wide (global) mode. CLI prompt: switch(config-cmap-nq)#

  • qos—Classification mode; this is the default mode. CLI prompt: switch(config-cmap-qos)#

  • queuing—Queuing mode. CLI prompt: switch(config-cmap-que)#

Step 3

(Optional) switch(config)# class-map [type qos] [match-all | match-any] class-map name

(Optional)

Specifies that packets must match any or all criteria that is defined for a class map.

  • match-all—Classifies traffic if packets match all criteria that is defined for a specified class map (for example, if both the defined CoS and the ACL criteria match).

  • match-any—Classifies traffic if packets match any criteria that is defined for a specified class map (for example, if either the CoS or the ACL criteria matches).

Class-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 4

(Optional) switch(config)# no class-map [type {network-qos | qos | queuing}] class-name

(Optional)

Deletes the specified class map.

Note 

You cannot delete the system-defined class map: class-default.

Class-map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Configuring ACL Classification

You can classify traffic by matching packets based on an existing access control list (ACL). Traffic is classified by the criteria defined in the ACL. The permit and deny ACL keywords are ignored in the matching; even if a match criteria in the access-list has a deny action, it is still used for matching for this class.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map type qos class-name

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

Step 3

switch(config-cmap-qos)# match access-group name acl-name

Configures a traffic class by matching packets based on the acl-name . The permit and deny ACL keywords are ignored in the matching.

Note 

You can only define a single ACL in a class map.

You cannot add any other match criteria to a class with a match access-group defined.

Step 4

(Optional) switch(config-cmap-qos)# no match access-group name acl-name

(Optional)

Removes the match from the traffic class.

Example

This example shows how to classify traffic by matching packets based on existing ACLs:

switch# configure terminal
switch(config)# class-map type qos class_acl
switch(config-cmap-qos)# match access-group name acl-01
 

Use the show class-map command to display the ACL class-map configuration:

switch# show class-map class_acl
 

Configuring CoS Classification

You can classify traffic based on the class of service (CoS) in the IEEE 802.1Q header. This 3-bit field is defined in IEEE 802.1p to support QoS traffic classes. CoS is encoded in the high order 3 bits of the VLAN ID Tag field and is referred to as user_priority.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map type qos class-name

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

Step 3

switch(config-cmap-qos)# match cos cos-value

Specifies the CoS value to match for classifying packets into this class. You can configure a CoS value in the range of 0 to 7.

Step 4

(Optional) switch(config-cmap-qos)# no match cos cos-value

(Optional)

Removes the match from the traffic class.

Example

This example shows how to classify traffic by matching packets based on a defined CoS value:

switch# configure terminal
switch(config)# class-map type qos match-any class_cos
switch(config-cmap-qos)# match cos 4, 5-6

Use the show class-map command to display the CoS value class-map configuration:

switch# show class-map class_cos

Configuring DSCP Classification

You can classify traffic based on the Differentiated Services Code Point (DSCP) value in the DiffServ field of the IP header (either IPv4 or IPv6).
Table 1. Standard DSCP Values

Value

List of DSCP Values

af11

AF11 dscp (001010)—decimal value 10

af12

AF12 dscp (001100)—decimal value 12

af13

AF13 dscp (001110)—decimal value 14

af21

AF21 dscp (010010)—decimal value 18

af22

AF22 dscp (010100)—decimal value 20

af23

AF23 dscp (010110)—decimal value 22

af31

AF31 dscp (011010)—decimal value 26

af32

AF32 dscp (011100)—decimal value 28

af33

AF33 dscp (011110)—decimal value 30

af41

AF41 dscp (100010)—decimal value 34

af42

AF42 dscp (100100)—decimal value 36

af43

AF43 dscp (100110)—decimal value 38

cs1

CS1 (precedence 1) dscp (001000)—decimal value 8

cs2

CS2 (precedence 2) dscp (010000)—decimal value 16

cs3

CS3 (precedence 3) dscp (011000)—decimal value 24

cs4

CS4 (precedence 4) dscp (100000)—decimal value 32

cs5

CS5 (precedence 5) dscp (101000)—decimal value 40

cs6

CS6 (precedence 6) dscp (110000)—decimal value 48

cs7

CS7 (precedence 7) dscp (111000)—decimal value 56

default

Default dscp (000000)—decimal value 0

ef

EF dscp (101110)—decimal value 46

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map type qos class-name

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

Step 3

switch(config-cmap-qos)# match dscp dscp-list

Configures the traffic class by matching packets based on the values in the dscp-list variable. For a list of DSCP values, see the Standard DSCP Values table.

Step 4

(Optional) switch(config-cmap-qos)# no match dscp dscp-list

(Optional)

Removes the match from the traffic class. For a list of DSCP values, see the Standard DSCP Values table.

Example

This example shows how to classify traffic by matching packets based on the DSCP value in the DiffServ field of the IP header:

switch# configure terminal
switch(config)# class-map type qos match-any class_dscp
switch(config-cmap-qos)# match  dscp af21 af32
Use the show class-map command to display the DSCP class-map configuration:
switch# show class-map class_dscp

Configuring IP RTP Classification

The IP Real-time Transport Protocol (RTP) is a transport protocol for real-time applications that transmits data such as audio or video and is defined by RFC 3550. Although RTP does not use a common TCP or UDP port, you typically configure RTP to use ports 16384 to 32767. UDP communications use an even port and the next higher odd port is used for RTP Control Protocol (RTCP) communications.

You can classify based on UDP port ranges, which are likely to target applications using RTP.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map type qos class-name

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

Step 3

switch(config-cmap-qos)# match ip rtp port-number

Configures the traffic class by matching packets based on a range of lower and upper UDP port numbers, which is likely to target applications using RTP. Values can range from 2000 to 65535.

Step 4

(Optional) switch(config-cmap-qos)# no match ip rtp port-number

(Optional)

Removes the match from the traffic class.

Example

The following example shows how to classify traffic by matching packets based on UDP port ranges that are typically used by RTP applications:
switch# configure terminal
switch(config)# class-map type qos match-any class_rtp
switch(config-cmap-qos)# match  ip rtp 2000-2100, 4000-4100

Use the show class-map command to display the RTP class-map configuration:

switch# show class-map class_rtp

Configuring Precedence Classification

You can classify traffic based on the precedence value in the type of service (ToS) byte field of the IP header (either IPv4 or IPv6). The following table shows the precedence values:

Table 2. Precedence Values

Value

List of Precedence Values

<0-7>

IP precedence value

critical

Critical precedence (5)

flash

Flash precedence (3)

flash-override

Flash override precedence (4)

immediate

Immediate precedence (2)

internet

Internetwork control precedence (6)

network

Network control precedence (7)

priority

Priority precedence (1)

routine

Routine precedence (0)

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map type qos match-any class-name

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

Step 3

switch(config-cmap-qos)#match precedence precedence-values

Configures the traffic class by matching packets based on precedence values. For a list of precedence values, see the Precedence Values table.

Step 4

(Optional) switch((config-cmap-qos)# no match precedence precedence-values

(Optional)

Removes the match from the traffic class. For a list of precedence values, see the Precedence Values table.

Example

This example shows how to classify traffic by matching packets based on the precedence value in the ToS byte field of the IP header:

switch# configure terminal
switch(config)# class-map type qos match-any class_precedence
switch(config)# class-map type qos c1
switch(config-cmap-qos)# match precedence 1-2, 5

Use the show class-map command to display the IP precedence value class-map configuration:

switch# show class-map class_precedence

Creating Policy Maps

The policy-map command is used to create a named object that represents a set of policies that are to be applied to a set of traffic classes.

The device provides one default system class: a drop class for best-effort service (class-default). You can define up to four additional system classes for Ethernet traffic.

The following predefined policy maps are used as default service policies:

  • network-qos: default-nq-policy

  • Input qos: default-in-policy

  • Output queuing: default-out-policy

  • Input queuing: default-in-policy

You need to create a policy map to specify the policies for any user-defined class. In the policy map, you can configure the QoS parameters for each class. You can use the same policy map to modify the configuration of the default classes.

The device distributes all the policy-map configuration values to the attached network adapters.

Before you begin

Before creating the policy map, define a class map for each new system class.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map [type {network-qos | qos | queuing}] policy-name

Creates a named object representing 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.

The three policy-map configuration modes are as follows:

  • network-qos—Network-wide (global) mode. CLI prompt: switch(config-pmap-nq)#

  • qos—Classification mode; this is the default mode. CLI prompt: switch(config-pmap-qos)#

  • queuing—Queuing mode. CLI prompt: switch(config-pmap-que)#

Step 3

(Optional) switch(config)# no policy-map [type {network-qos | qos | queuing}] policy-name

(Optional)

Deletes the specified policy map.

Step 4

switch(config-pmap)# class [type {network-qos | qos | queuing}] class-name

Associates a class map with the policy map, and enters configuration mode for the specified system class. The three class-map configuration modes are as follows:

  • network-qos—Network-wide (global) mode. CLI prompt: switch(config-pmap-c-nq)#

  • qos—Classification mode; this is the default mode. CLI prompt: switch(config-pmap-c-qos)#

  • queuing—Queuing mode. CLI prompt: switch(config-pmap-c-que)#

Note 

The associated class map must be the same type as the policy-map type.

Step 5

(Optional) switch(config-pmap)# no class [type {network-qos | qos | queuing}] class-name

(Optional)

Deletes the class map association.

Configuring Type QoS Policies

Type qos policies are used for classifying the traffic of a specific system class identified by a unique qos-group value. A type qos policy can be attached to the system or to individual interfaces for ingress traffic only.

You can set a maximum of eight QoS groups for ingress traffic.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map type qos 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

switch(config-pmap-qos)# [class | class-default] type qos class-name

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

Note 

The associated class map must be the same type as the policy map type.

Step 4

switch(config-pmap-c-qos)# set qos-group qos-group-value

Configures one or more qos-group values to match on for classification of traffic into this class map. The list below identifies the ranges of the qos-group-value . There is no default value.

Note 

The Cisco 3000 Series Switches supports 8 QoS groups(0-7).

The Cisco 3500 Series Switches supports 4 QoS groups(1-4).

Step 5

(Optional) switch(config-pmap-c-qos)# no set qos-group qos-group-value

(Optional)

Removes the qos-group values from this class.

Example

This example shows how to define a type qos policy map:

switch# configure terminal
switch(config)# policy-map type qos policy-s1
switch(config-pmap-qos)# class type qos class-s1
switch(config-pmap-c-qos)# set qos-group 2

Configuring Type Network QoS Policies

Type network qos policies can only be configured on the system qos attachment point. They are applied to the entire switch for a particular class.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map type network-qos 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

switch(config-pmap-nq)# class type network-qos class-name

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

Note 

The associated class map must be the same type as the policy map type.

Step 4

switch(config-pmap-c-nq)# mtu mtu-value

Specifies the MTU value in bytes.

Note 

The mtu-value that you configure must be less than the value set by the system jumbomtu command.

Step 5

(Optional) switch(config-pmap-c-nq)# no mtu

(Optional)

Resets the MTU value in this class.

Step 6

switch(config-pmap-c-nq)# pause no-drop

Configures a no-drop class.
Note 

This option works only on class-map matching qos-group 1 in Cisco Nexus 3500 series switches.

Step 7

switch(config-pmap-c-nq)# set cos cos-value

Specifies a 802.1Q CoS value which is used to mark packets on this interface. The value range is from 0 to 7.

Step 8

(Optional) switch(config-pmap-c-nq)# no set cos cos-value

(Optional)

Disables the marking operation in this class.

Example

This example shows how to define a type network-qos policy map:

switch# configure terminal
switch(config)# policy-map type network-qos policy-que2
switch(config-pmap-nq)# class type network-qos class-que2
switch(config-pmap-c-nq)# mtu 5000
switch(config-pmap-c-nq)# pause no-drop
switch(config-pmap-c-nq)# congestion-control random-detect 
switch(config-pmap-c-nq)# set cos 4

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.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# 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

switch(config-pmap-que)# class type queuing class-name

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

Step 4

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

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

Note 

In Cisco Nexus 3000 series switches and Cisco Nexus 3500 platform switches, only one class in each policy map can have strict priority set on it. Cisco Nexus 3100 platform switches allow multiple priority levels. A maximum of three classes can have priority levels configured. However, only one class can be configured with a particular level. (The Cisco Nexus 34180YC switch supports a maximum of seven priority queues.)

Step 5

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

(Optional)

Removes the strict priority queuing from the traffic in this class.

Step 6

switch(config-pmap-c-que)# shape {kbps | mbps | gbps} burst size min minimum bandwidth

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

For the Cisco Nexus 34180YC switch, the command syntax is switch(config-pmap-c-que)# shape {kbps | mbps | gbps} min minimum bandwidth max maximum bandwidth .

Step 7

switch(config-pmap-c-que)# 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

(Optional) switch(config-pmap-c-que)# no bandwidth percent percentage

(Optional)

Removes the bandwidth specification from this class.

Step 9

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

(Optional)

Specifies the strict priority levels for the Cisco Nexus 3100 platform switches. These levels can be 1, 2, or 3.

Note 

The Cisco Nexus 34180YC switch supports a maximum of seven priority queues.

Step 10

(Optional) switch(config-pmap-c-que)# queue-limit queue size [dynamic dynamic threshold]

(Optional)

Specifies either the static or dynamic shared limit available to the queue for Cisco Nexus 3100 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 

The queue-limit CLI under queuing policy is enhanced to support 0 queue size. Configuring queue-limit as 0 bytes drops all the packets on the queue.

Note 

The queue-limit range for the Cisco Nexus 34180YC switch is from 64 to 12582912 bytes.

Example

This example shows how to define a type queuing policy map for Cisco Nexus 3000 series switches:

switch# configure terminal
switch(config)# policy-map type queuing policy-queue1
switch(config-pmap-que)# class type queuing class-queue1
switch(config-pmap-c-que)# priority
switch(config-pmap-c-que)# shape kbps 30000000 min 18000000
switch(config-pmap-c-que)# bandwidth percent 20
				

This example shows how to define a type queuing policy map for Cisco Nexus 3100 platform switches:

switch# configure terminal
switch(config)# policy-map type queuing p1
switch(config-pmap-que)# class type queuing q3
switch(config-pmap-c-que)# priority level 2
switch(config-pmap-c-que)# shape kbps 30000000 min 18000000
switch(config-pmap-c-que)# class type queuing q2
switch(config-pmap-c-que)# priority level 3
switch(config-pmap-c-que)# class type queuing q1
switch(config-pmap-c-que)# bandwidth percent 30
switch(config-pmap-c-que)# class type queuing q4
switch(config-pmap-c-que)# bandwidth percent 10
switch(config-pmap-c-que)# class type queuing q5
switch(config-pmap-c-que)# bandwidth percent 10
switch(config-pmap-c-que)# class type queuing q6
switch(config-pmap-c-que)# priority level 1
switch(config-pmap-c-que)# class type queuing q7
switch(config-pmap-c-que)# bandwidth percent 10
switch(config-pmap-c-que)# class type queuing class-default
switch(config-pmap-c-que)# queue-limit dynamic 4
switch(config-pmap-c-que)# bandwidth percent 0

This example shows how to define a type queuing policy map for Cisco Nexus 3500 platform switches:

switch# configure terminal
switch(config)# policy-map type queuing p1
switch(config-pmap-que)# class type queuing q1
switch(config-pmap-c-que)# bandwidth percent 10
switch(config-pmap-c-que)# priority 
switch(config-pmap-c-que)# class type queuing q2
switch(config-pmap-c-que)# bandwidth percent 20
switch(config-pmap-c-que)# class type queuing q3
switch(config-pmap-c-que)# bandwidth percent 30
switch(config-pmap-c-que)# class type queuing q4
switch(config-pmap-c-que)# bandwidth percent 40
switch(config-pmap-c-que)# class type queuing class-default
switch(config-pmap-c-que)# bandwidth percent 10

Configuring an ECN Threshold

You can configure an explicit congestion notification (ECN) threshold per class in a queuing policy and apply it to an interface.

Prior to Cisco NX-OS Release 5.0(3)U4(1), WRED and an ECN can only be enabled or disabled on QoS class in the networkqos policy (with static thresholds). Starting with Cisco NX-OS Release 5.0(3)U4(1), an enhanced ECN marking is supported as follows:


Note

This feature is not supported on Cisco Nexus 3500 platform switches.


  • WRED and ECN thresholds can be configured corresponding to a class from the queueing policy by using the following Steps 1 through 8.


    Note

    A WRED and ECN still need to be enabled by the network-qos policy class configuration mode. Not applicable for Cisco Nexus 34180YC switches.


  • WRED and ECN can be enabled on a global basis outside the MQC command line. You can configure WRED and an ECN at a global buffer level where you enable WRED and an ECN and specify a threshold at the system level by using the following Steps 1 through 9. If this threshold is exceeded, WRED and ECN are applied on all WRED/ECN enabled classes in the system.

  • By default, when WRED and an ECN are enabled, the marking or drop happens based on the class or queue threshold. However, when the global based WRED and ECN is also enabled, by using the congestion-control random-detect global-buffer and wred-queue qos-group-map queue-only commands, the WRED and ECN marking behavior initiates when either of the class thresholds or global threshold is exceeded.

Before you begin

Ensure that you have enabled ECN or WRED on the QoS group that you want in the network-qos policy.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# class-map type queuing class-map name

Creates or accesses a named object that represents the specified class of traffic in queuing mode. Class map names can contain alphabetic, hyphen, or underscore characters, are case sensitive, and can be up to 40 characters.

Step 3

switch(config-cmap-que)# match qos-group qos-group-number

Associates a QoS group to the queuing class map.

Step 4

switch(config-cmap-que)# exit

Exits class mode.

Step 5

switch(config)# policy-map type queuing policy-map name

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

Step 6

switch(config-pmap-que)# class type queuing class-map name

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

Step 7

switch(config-pmap-c-que)# random-detect minimum-threshold {min-threshold [bytes | kilobytes | megabytes | packets } maximum-threshold {max-threshold [bytes | kilobytes | megabytes | packets} drop-probability drop probability weight weight cap-average

Configures WRED or ECN based on whether the network-qos policy has ECN or WRED enabled. You can specify minimum and maximum thresholds used to drop (WRED) or mark (ECN) packets from the queue. You can configure thresholds by the number of packets, number of bytes, and packets where 1 packet maps to 208 bytes. The minimum and maximum thresholds must be of the same type. If no aggregate arguments are supplied, no aggregate WRED is configured. The default threshold is in packets. The thresholds are from 1 to 83886080.

You can also specify the following optional parameters:

  • drop probability—This option specifies the drop probability when the average queue size is between the minimum queue length and maximum queue size. When the queue size is greater than the maximum queue size, 100 percent of frames are dropped. The default drop probability value is 100.

  • weight—This option is used to derive the actual queue size from the current queue size. For example, a weight of 0 means that the actual queue size is equal to the current queue size. The default weight value is 0.

  • cap-average—This option is used to replace the average queue size with the current queue size if the average queue size is greater than the current queue size.

    Note 

    N3K-C34180YC does not support cap-average.

Step 8

switch(config-cmap-que)# exit

Exits policy mode.

Step 9

switch(config)# congestion-control random-detect global-buffer minimum-threshold {min-threshold [bytes | kilobytes | megabytes | packets]} maximum-threshold {max-threshold [bytes | kilobytes | megabytes packets}

Configures the global ECN threshold. You can specify minimum and maximum global buffer thresholds. If the global buffer exceeds these thresholds, the packets in individual queues, which are ECN or WRED enabled, are marked or dropped even if the queue thresholds have not been exceeded. You can configure thresholds by the number of packets, number of bytes, and packets where 1 packet maps to 208 bytes. The minimum and maximum thresholds must be of the same type. If no aggregate arguments are supplied, no aggregate WRED is configured. The default threshold is in packets. The thresholds are from 1 to 83886080.

Note 

The Cisco Nexus 34180YC switch does not support congestion-control random-detect global-buffer minimum-threshold .

Step 10

(Optional) switch(config-pmap-nq)# wred-queue qos-group-map queue-only queue-group

(Optional)

Enables ECN marking for the specified QoS group that is based only on a class threshold and independent of the global buffer threshold configuration.

Step 11

(Optional) switch(config-pmap-nq)# show wred-queue qos-group-map

(Optional)

Displays the configuration for the queue-only QoS group maps.

Step 12

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

(Optional)

Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.

Example

The following example shows how to configure an ECN threshold per class:
switch# configure terminal
switch(config)# class-map type queuing cque_ecn
switch(config-cmap-que)# match qos-group 1
switch(config-cmap-que)# exit
switch(config)# policy-map type queuing pque_ecn
switch(config-pmap-que)# class type queuing cque_ecn
switch(config-pmap-c-que)# random-detect minimum-threshold 20 kilobytes 
maximum-threshold 60 kilobytes drop-probability 70 weight 11 cap-average

The following example shows how to configure a global ECN threshold in packets, bytes, kilobytes, and megabytes:

switch(config)# congestion-control random-detect global-buffer 
minimum-threshold 1000 bytes maximum-threshold 1000 bytes
switch(config)#

Configuring Pause Buffer Thresholds and Priority Groups

The ingress queuing policy is used to configure pause buffer thresholds and priority groups. This feature is not supported on Cisco Nexus 3500 Series switches.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# policy-map type queuing policy-map name

Enters policy-map queuing class mode and identifies the policy map assigned to the type queuing policy map.
Step 3

switch(config-pmap-que)# class type queuing class-map name

References an existing queuing class map in a policy map and enters class mode.
Important 
This must be defined as a no-drop class in the network-qos policy applied in the system qos.
Step 4

switch(config-pmap-c-que)# pause buffer-size buffer-size pause-threshold xoff-size resume-threshold xon-size

Specifies the buffer threshold settings for pause and resume.
Note 

The values mentioned next to each parameter are the recommended values. These values are assigned by the system and will be the default values if no value is defined in the input queuing policy. You can use different values based on your requirement.

On 10-Gigabit ports, if the no-drop class has an MTU <= 2240:
  • buffer-size—27,456 bytes
  • pause threshold—12,480 bytes
  • resume-threshold—0 bytes
On 10-Gigabit ports, if the no-drop class has an MTU > 2240:
  • buffer-size—89,440 bytes
  • pause threshold—34,320 bytes
  • resume-threshold—21,840 bytes
On 40-Gigabit ports, if the no-drop class has an MTU of MTU <=2240:
  • buffer-size—83,616 bytes
  • pause threshold—40,352 bytes
  • resume-threshold—19,552 bytes
On 40-Gigabit ports, if the no-drop class has an MTU > 2240:
  • buffer-size—1,58,080 bytes
  • pause threshold— 77,376 bytes
  • resume-threshold—56,576 bytes
Step 5

switch(config-pmap-c-que)# no pause buffer-size buffer-size pause-threshold xoff-size resume-threshold xon-size

Removes the buffer threshold settings for pause and resume.
Step 6

switch(config-pmap-c-que)# pause priority-group priority group number

Maps the no-drop class traffic to the priority group specified.
Step 7

(Optional) switch(config-pmap-c-que)# queue-limit queue size [dynamic dynamic threshold]

(Optional)
Specifies either the static or dynamic shared limit available to the queue for Cisco Nexus 3100 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.

Example

This example shows how to configure priority groups for no-drop classes:

switch# configure terminal
switch(config-pmap-que)# policy-map type queuing p1
switch(config-pmap-que)# class type queuing c1
switch(config-pmap-c-que)# pause buffer-size 39936 pause-threshold 24960 resume-threshold 12480
switch(config-pmap-c-que)# pause priority-group 1

Information About Marking

Marking is a method that you use to modify the QoS fields of the incoming and outgoing packets.

You can use marking commands in traffic classes that are referenced in a policy map. The marking features that you can configure are listed below:

  • DSCP

  • IP precedence

  • CoS

Configuring CoS Marking

The value of the CoS field is recorded in the high-order three bits of the VLAN ID Tag field in the IEEE 802.1Q header.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config) # policy-map [type network-qos] policy-map name

Creates or accesses the policy map named policy-map-name and enters policy-map mode.

The policy-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

Step 3

switch(config-pmap-nq) # class [type network-qos] {class-map name |class-default}

Creates a reference to the class-map-name and enters policy-map class configuration mode.

Use the class-default keyword to select all traffic that is not currently matched by classes in the policy map.

Step 4

switch(config-pmap-c-nq) # set cos cos-value

Specifies the CoS value to cos-value.

The cos-value can range from 0 to 7.

Note 

This command is supported only for egress policies.

Configuring DSCP Marking

You can set the DSCP value in the six most significant bits of the DiffServ field of the IP header to a specified value. You can enter numeric values from 0 to 60, in addition to the standard DSCP values shown in the table below:


Note

For Cisco Nexus 34180YC switches, the numeric values range from 0 to 63



Note

You can set DSCP or IP precedence but you cannot set both values because they modify the same field in the IP packet.


Table 3. Standard DSCP Values

Value

List of DSCP Values

af11

AF11 dscp (001010)—decimal value 10

af12

AF12 dscp (001100)—decimal value 12

af13

AF13 dscp (001110)—decimal value 14

af21

AF21 dscp (010010)—decimal value 18

af22

AF22 dscp (010100)—decimal value 20

af23

AF23 dscp (010110)—decimal value 22

af31

AF31 dscp (011010)—decimal value 26

af32

AF40 dscp (011100)—decimal value 28

af33

AF33 dscp (011110)—decimal value 30

af41

AF41 dscp (100010)—decimal value 34

af42

AF42 dscp (100100)—decimal value 36

af43

AF43 dscp (100110)—decimal value 38

cs1

CS1 (precedence 1) dscp (001000)—decimal value 8

cs2

CS2 (precedence 2) dscp (010000)—decimal value 16

cs3

CS3 (precedence 3) dscp (011000)—decimal value 24

cs4

CS4 (precedence 4) dscp (100000)—decimal value 32

cs5

CS5 (precedence 5) dscp (101000)—decimal value 40

cs6

CS6 (precedence 6) dscp (110000)—decimal value 48

cs7

CS7 (precedence 7) dscp (111000)—decimal value 56

default

Default dscp (000000)—decimal value 0

ef

EF dscp (101110)—decimal value 46

Procedure

  Command or Action Purpose
Step 1

configure terminal

Enters global configuration mode.

Step 2

policy-map type qos qos-policy-map-name

Creates or accesses the policy map named qos-policy-map-name, and then enters policy-map mode. The policy-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

Step 3

class [type qos] {class-map-name | class-default}

Creates a reference to class-map-name, and enters policy-map class configuration mode. Use the class-default keyword to select all traffic that is not currently matched by classes in the policy map.

Step 4

set dscp dscp-value

Sets the DSCP value to dscp-value. See the Standards DSCP Values table.

Example

This example shows how to display the policy-map configuration as shown below:

switch# show policy-map policy1

Configuring IP Precedence Marking

You can set the value of the IP precedence field in bits 0 to 2 of the IPv4 type of service (ToS) field or the equivalent Traffic Class field for IPv6 of the IP header. The following table shows the precedence values:


Note

You can set IP precedence or DSCP but you cannot set both values because they modify the same field in the IP packet.


Table 4. Precedence Values

Value

List of Precedence Values

0-7

IP precedence value

critical

Critical precedence (5)

flash

Flash precedence (3)

flash-override

Flash override precedence (4)

immediate

Immediate precedence (2)

internet

Internetwork control precedence (6)

network

Network control precedence (7)

priority

Priority precedence (1)

routine

Routine precedence (0)

Procedure

  Command or Action Purpose
Step 1

switch# config terminal

Enters global configuration mode.

Step 2

switch(config) # policy-map [type qos] qos-policy-map-name

Creates or accesses the policy map named policy-map-name, and then enters policy-map mode. The policy-map name can contain alphabetic, hyphen, or underscore characters, is case sensitive, and can be up to 40 characters.

Step 3

switch(config-pmap-nq) # class [type qos] {class-map-name | class-default}

Creates a reference to class-map-name, and enters policy-map class configuration mode. Use the class-default keyword to select all traffic that is not currently matched by classes in the policy map.

Step 4

switch(config-pmap-c-nq) # set precedence precedence-value

Sets the IP precedence value to precedence-value. You can enter one of the values shown in the Precedence Values table.

Example

This example shows how to set the precedence marking to 5:

switch(config)# policy-map type qos my_policy
switch(config-pmap-qos)# class type qos my_class
switch(config-pmap-c-qos)# set precedence 5
switch(config-pmap-c-qos)#

QoS Configurations for Layer 3 Routing

Configuring Layer 3 Multicast Queuing

You can use this procedure to distribute traffic into different queues, where each queue is configured with different weighted round robin (WRR) parameters.

Procedure

Command or Action Purpose

switch# configure terminal

Enters global configuration mode.

Example

This example shows how to configure a Layer 3 interface:

Configuring a Service Policy for a Layer 3 Interface

You can configure a service policy for a Layer 3 interface.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# interface ethernet slot/port

Enters the configuration mode for the specified interface.

Step 3

switch(config-if)# no switchport

Selects the Layer 3 interface.

Step 4

switch(config-if)# service-policy [type {qos input | queuing [input | output]}policy-name

Specifies the policy map to use as the service policy for the Layer 3 interface. There are two policy-map configuration modes:

  • qos—Classification mode; this is the default mode.

  • queuing—Queuing mode.

Note 

The output keyword specifies that this policy map should be applied to traffic transmitted from an interface and the input keyword specifies that this policy map should be applied to traffic transmitted to an interface . You can apply both output and input to a queuing policy. The policy applied at input should have buffer configurations and the policy applied at output should have scheduling and queuing configurations.

Example

The following example shows how to attach a queuing policy map to a Layer 3 interface:

switch# configure terminal
switch(config)# interface ethernet 1/5
switch(config-if)# no switchport
switch(config-if)# service-policy type queuing output my_output_q_policy
switch(config-if)#

The following example shows how to attach an input qos policy map to a Layer 3 interface:

switch# configure terminal
switch(config)# interface ethernet 1/5
switch(config-if)# no switchport
switch(config-if)# service-policy type qos input my_input_qos_policy
switch(config-if)#

Changing the Bandwidth Allocated to Unicast and Multicast Traffic

You can change the bandwidth allocated to unicast and multicast traffic by assigning weighted round-robin (WRR) weights as a percentage of the interface data rate to the egress queues. The wrr unicast-bandwidth command configures this bandwidth percentage globally even if you use it on a specific interface.


Note

The Cisco Nexus 34180YC switch does not supports the wrr unicast-bandwidth command.


Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# interface ethernet slot/port

Enters configuration mode for the specified interface.

Step 3

switch(config-if)# wrr unicast-bandwidth percentage-value

Changes the bandwidth allocated to unicast and multicast traffic on traffic congestion globally. The bandwidth-value percentage ranges from 0 to 100 percent.

Example

This example shows how to attach a queuing policy map to a Layer 3 interface:

switch# configure terminal
switch(config)# interface ethernet 1/5
switch(config-if)# wrr unicast-bandwidth 75
switch(config-if)#

Attaching the System Service Policy

The service-policy command specifies the system class policy map as the service policy for the system.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# system qos

Enters system class configuration mode.

Step 3

switch(config-sys-qos)# service-policy type {network-qos | qos input |queuing [input | output]} policy-name

Specifies the policy map to use as the service policy for the system. There are three policy-map configuration modes:

  • network-qos—Network-wide (system qos) mode.

  • qos—Classification mode (system qos input or interface input only).

  • queuing—Queuing mode (output at system qos and interface).

Note 

There is no default policy-map configuration mode; you must specify the type . The input keyword specifies that this policy map should be applied to traffic received on an interface. The output keyword specifies that this policy map should be applied to traffic transmitted from an interface. You can only apply input to a qos policy; you can only apply output to a queuing policy.

Example

Restoring the Default System Service Policies

If you have created and attached new policies to the system QoS configuration, enter the no form of the command to reapply the default policies.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# system qos

Enters system class configuration mode.

Step 3

switch(config-sys-qos)# no service-policy type qos input policy-map name

Resets the classification mode policy map. This policy-map configuration is for system QoS input or interface input only:

Step 4

switch(config-sys-qos)# no service-policy type network-qos policy-map name

Resets the network-wide policy map.

Step 5

switch(config-sys-qos)# no service-policy type queuing [input | output]policy-map name

Resets the output queuing mode policy map.

Example

Enabling the Jumbo MTU

You can enable the jumbo Maximum Transmission Unit (MTU) for the whole switch by setting the MTU to its maximum size (9216 bytes) in the policy map for the default Ethernet system class (class-default).

When you configure jumbo MTU on a port-channel subinterface you must first enable MTU 9216 on the base interface and then configure it again on the subinterface. If you enable the jumbo MTU on the subinterface before you enable it on the base interface then the following error will be displayed on the console:

switch(config)# int po 502.4
switch(config-subif)# mtu 9216
ERROR: Incompatible MTU values

Note

The Cisco Nexus device supports 1 MTU for all classes for all ports.


To use FCoE on switch, add class-fcoe in the custom network-qos policy. If already using FCoE, make sure to add the below lines in the config so that the FCoE does not go down on the switch after enabling the jumbo qos policy.

switch# conf t
switch(config)# policy-map type network-qos jumbo
switch(config-pmap-nqos)# class type network-qos class-fcoe
switch(config-pmap-nqos-c)# end

This example shows how to change qos to enable the jumbo MTU:

switch# conf t
switch(config)# policy-map type network-qos jumbo
switch(config-pmap-nqos)# class type network-qos class-default
switch(config-pmap-c-nqos)# mtu 9216

Note

The system jumbomtu command defines the maximum MTU size for the switch. However, jumbo MTU is supported only for system classes that have MTU configured.


Verifying the Jumbo MTU

On the Cisco Nexus device, traffic is classified into one of eight QoS groups. The MTU is configured at the QoS group level. By default, all Ethernet traffic is in QoS group 0. Use the show queueing interface ethernet slot/chassis_number command to display all qos-groups, control qos group, span qos-group, and pfc statistics.

Use the show policy-map system type network-qos command to display the configured HW MTU for the qos-groups.
switch(config)# show policy-map system type network-qos 

  Type network-qos policy-maps
  ============================
  policy-map type network-qos pn_system
    class type network-qos cn_1
      match qos-group 1
      mtu 9216
    class type network-qos cn_2
      match qos-group 2
      mtu 9216
    class type network-qos cn_3
      match qos-group 3
      mtu 9216
    class type network-qos cn_4
      match qos-group 4
      mtu 9216
    class type network-qos cn_5
      match qos-group 5
      mtu 9216
    class type network-qos cn_6
      match qos-group 6
      mtu 9216
    class type network-qos cn_7
      match qos-group 7
      mtu 9216
    class type network-qos class-default
      match qos-group 0
      mtu 1500

switch(config)#

This example shows queuing interface for the Cisco Nexus 34180YC switch:


switch(config)# show queuing interface spq_shape_wred_8q 
policy-map type queuing msft_spq_8q 
    class type queuing c-out-8q-q5
      priority level 3
    class type queuing c-out-8q-q4
      priority level 4
    class type queuing c-out-8q-q7
      priority level 1
    class type queuing c-out-8q-q6
      priority level 2
    class type queuing c-out-8q-q1
      bandwidth remaining percent 60
      random-detect minimum-threshold 120 kbytes maximum-threshold 120 kbytes drop-probability 1 weight 0 ecn
    class type queuing c-out-8q-q3
      priority level 5
      shape min 2500 mbps max 2500 mbps
    class type queuing c-out-8q-q2
      priority level 6
      shape min 5000 mbps max 5000 mbps
    class type queuing c-out-8q-q-default
      bandwidth remaining percent 40
      random-detect minimum-threshold 120 kbytes maximum-threshold 120 kbytes drop-probability 1 weight 0 
switch(config-if)# 

switch(config-if)# sh queuing interf eth1/29

slot  1
=======


Egress Queuing for Ethernet1/29 [Interface]
------------------------------------------------------------------------------
QoS-Group# Bandwidth% PrioLevel                Shape                   QLimit
                                   Min          Max        Units   
------------------------------------------------------------------------------
      7             -         1           -            -     -            2(D)
      6             -         2           -            -     -            2(D)
      5             -         3           -            -     -            2(D)
      4             -         4           -            -     -            2(D)
      3             -         5  2500000000   2500000000   bps            2(D)
      2             -         6  5000000000   5000000000   bps            2(D)
      1            60         -           -            -     -            2(D)
      0            40         -           -            -     -            2(D)
+-------------------------------------------------------------+
|                              QOS GROUP 0                    |
+-------------------------------------------------------------+
|                           |  Ingress       |Egress          |
+-------------------------------------------------------------+
|                   Tx Pkts |               0|      2887259853|
|                   Tx Byts |               0|      1562745132|
|            Tail Drop Pkts |               0|      1440300408|
|              Q Depth Byts |               0|          126160|
|             ECN Mark Pkts |               0|               0|
|             ECN Mark Byts |               0|               0|
|            WRED Drop Pkts |               0|         8925945|
|            WRED Drop Byts |               0|     13388917500|
+-------------------------------------------------------------+
|                              QOS GROUP 1                    |
+-------------------------------------------------------------+
|                           |  Ingress       |Egress          |
+-------------------------------------------------------------+
|                   Tx Pkts |               0|        15763298|
|                   Tx Byts |               0|      2170110520|
|            Tail Drop Pkts |               0|        20771625|
|              Q Depth Byts |               0|               0|
|             ECN Mark Pkts |               0|               0|
|             ECN Mark Byts |               0|               0|
|            WRED Drop Pkts |               0|               0|
|            WRED Drop Byts |               0|               0|
+-------------------------------------------------------------+
|                              QOS GROUP 2                    |
+-------------------------------------------------------------+
|                           |  Ingress       |Egress          |
+-------------------------------------------------------------+
|                   Tx Pkts |               0|        29990985|
|                   Tx Byts |               0|      2036804540|
|            Tail Drop Pkts |               0|        31638183|
|              Q Depth Byts |               0|               0|
|             ECN Mark Pkts |               0|               0|
|             ECN Mark Byts |               0|               0|
|            WRED Drop Pkts |               0|               0|
|            WRED Drop Byts |               0|               0|
+-------------------------------------------------------------+
|                              QOS GROUP 3                    |
+-------------------------------------------------------------+
|                           |  Ingress       |Egress          |
+-------------------------------------------------------------+
|                   Tx Pkts |               0|        14911143|
|                   Tx Byts |               0|       891878020|
|            Tail Drop Pkts |               0|        46351570|
|              Q Depth Byts |               0|               0|
|             ECN Mark Pkts |               0|               0|
|             ECN Mark Byts |               0|               0|
|            WRED Drop Pkts |               0|               0|
|            WRED Drop Byts |               0|               0|
+-------------------------------------------------------------+
|                              QOS GROUP 4                    |
+-------------------------------------------------------------+
|                           |  Ingress       |Egress          |
+-------------------------------------------------------------+
|                   Tx Pkts |               0|               0|
|                   Tx Byts |               0|               0|
|            Tail Drop Pkts |               0|               0|
|              Q Depth Byts |               0|               0|
|             ECN Mark Pkts |               0|               0|
|             ECN Mark Byts |               0|               0|
|            WRED Drop Pkts |               0|               0|
|            WRED Drop Byts |               0|               0|
+-------------------------------------------------------------+
|                              QOS GROUP 5                    |
+-------------------------------------------------------------+
|                           |  Ingress       |Egress          |
+-------------------------------------------------------------+
|                   Tx Pkts |               0|               0|
|                   Tx Byts |               0|               0|
|            Tail Drop Pkts |               0|               0|
|              Q Depth Byts |               0|               0|
|             ECN Mark Pkts |               0|               0|
|             ECN Mark Byts |               0|               0|
|            WRED Drop Pkts |               0|               0|
|            WRED Drop Byts |               0|               0|
+-------------------------------------------------------------+
|                              QOS GROUP 6                    |
+-------------------------------------------------------------+
|                           |  Ingress       |Egress          |
+-------------------------------------------------------------+
|                   Tx Pkts |               0|               0|
|                   Tx Byts |               0|               0|
|            Tail Drop Pkts |               0|               0|
|              Q Depth Byts |               0|               0|
|             ECN Mark Pkts |               0|               0|
|             ECN Mark Byts |               0|               0|
|            WRED Drop Pkts |               0|               0|
|            WRED Drop Byts |               0|               0|
+-------------------------------------------------------------+
|                              QOS GROUP 7                    |
+-------------------------------------------------------------+
|                           |  Ingress       |Egress          |
+-------------------------------------------------------------+
|                   Tx Pkts |               0|             248|
|                   Tx Byts |               0|           57692|
|            Tail Drop Pkts |               0|               0|
|              Q Depth Byts |               0|               0|
|             ECN Mark Pkts |               0|               0|
|             ECN Mark Byts |               0|               0|
|            WRED Drop Pkts |               0|               0|
|            WRED Drop Byts |               0|               0|

switch(config-if)# 
This example shows how to display all qos-groups, control qos group, span qos-group, and pfc statistics:

switch# show queuing interface ethernet1/11
Egress Queuing for Ethernet1/11 [System]
------------------------------------------------------------------------------
QoS-Group# Bandwidth% PrioLevel                Shape                   QLimit
                                   Min          Max        Units   
------------------------------------------------------------------------------
      0           100         -           -            -     -            7(D)
+-------------------------------------------------------------------+
|                              QOS GROUP 0                          |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |               0|               0|               0|
|        Tx Byts |               0|               0|               0|
|   Dropped Pkts |               0|               0|               0|
|   Dropped Byts |               0|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+
|                              QOS GROUP 1                          |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |               0|               0|               0|
|        Tx Byts |               0|               0|               0|
|   Dropped Pkts |               0|               0|               0|
|   Dropped Byts |               0|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+
|                              QOS GROUP 2                          |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |               0|               0|               0|
|        Tx Byts |               0|               0|               0|
|   Dropped Pkts |               0|               0|               0|
|   Dropped Byts |               0|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+
|                              QOS GROUP 3                          |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |               0|               0|               0|
|        Tx Byts |               0|               0|               0|
|   Dropped Pkts |               0|               0|               0|
|   Dropped Byts |               0|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+
|                              QOS GROUP 4                          |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |               0|               0|               0|
|        Tx Byts |               0|               0|               0|
|   Dropped Pkts |               0|               0|               0|
|   Dropped Byts |               0|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+
|                              QOS GROUP 5                          |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |               0|               0|               0|
|        Tx Byts |               0|               0|               0|
|   Dropped Pkts |               0|               0|               0|
|   Dropped Byts |               0|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+
|                              QOS GROUP 6                          |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |               0|               0|               0|
|        Tx Byts |               0|               0|               0|
|   Dropped Pkts |               0|               0|               0|
|   Dropped Byts |               0|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+
|                              QOS GROUP 7                          |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |               0|               0|               0|
|        Tx Byts |               0|               0|               0|
|   Dropped Pkts |               0|               0|               0|
|   Dropped Byts |               0|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+
|                      CONTROL QOS GROUP                            |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |            1055|               0|               0|
|        Tx Byts |           83011|               0|               0|
|   Dropped Pkts |               7|               0|               0|
|   Dropped Byts |             508|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+
|                         SPAN QOS GROUP                            |
+-------------------------------------------------------------------+
|                |  Unicast       | OOBFC Unicast  |  Multicast     |
+-------------------------------------------------------------------+
|        Tx Pkts |               0|               0|               0|
|        Tx Byts |               0|               0|               0|
|   Dropped Pkts |               0|               0|               0|
|   Dropped Byts |               0|               0|               0|
|   Q Depth Byts |               0|               0|               0|
+-------------------------------------------------------------------+

Port Egress Statistics
--------------------------------------------------------
WRED Drop Pkts                              0



Ingress Queuing for Ethernet1/11
------------------------------------------------------------------
QoS-Group#                 Pause                        QLimit
           Buff Size       Pause Th      Resume Th      
------------------------------------------------------------------
      7              -            -            -     11210992(S)
      6              -            -            -     11210992(S)
      5              -            -            -     11210992(S)
      4              -            -            -     11210992(S)
      3              -            -            -     11210992(S)
      2              -            -            -     11210992(S)
      1              -            -            -     11210992(S)
      0              -            -            -     11210992(S)


Port Ingress Statistics
--------------------------------------------------------
Ingress MMU Drop Pkts                               0
Ingress MMU Drop Bytes                              0

PFC Statistics
----------------------------------------------------------------------------
TxPPP:                    0, RxPPP:                    0
----------------------------------------------------------------------------
 COS QOS Group        PG   TxPause   TxCount         RxPause         RxCount
   0         -         7  Inactive         0        Inactive               0
   1         -         7  Inactive         0        Inactive               0
   2         -         7  Inactive         0        Inactive               0
   3         -         7  Inactive         0        Inactive               0
   4         -         7  Inactive         0        Inactive               0
   5         -         7  Inactive         0        Inactive               0
   6         -         7  Inactive         0        Inactive               0
   7         -         7  Inactive         0        Inactive               0
----------------------------------------------------------------------------

Configuring QoS on Interfaces

Configuring Untagged CoS

Any incoming packet not tagged with an 802.1p CoS value is assigned the default untagged CoS value of zero (which maps to the default Ethernet drop system class). You can override the default untagged CoS value for an Ethernet or EtherChannel interface.


Note

The Cisco Nexus 34180YC switch does not support untagged cos cos-value .


Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# interface {ethernet [chassis/]slot/port | port-channel channel-number}

Enters the configuration mode for the specified interface or port channel.

Step 3

switch(config-if)# untagged cos cos-value

Configures the untagged CoS value. Values can be from 1 to 7.

Example

The following example shows how to set the CoS value to 4 for untagged frames received on an interface:

switch# configure terminal
switch(config)# interface ethernet 1/2
switch(config-if)# untagged cos 4

Configuring an Interface Service Policy

An input qos policy is a service policy applied to incoming traffic on an Ethernet interface for classification. For type queuing, the output policy is applied to all outgoing traffic that matches the specified class.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# interface {ethernet [chassis/]slot/port | port-channel channel-number}

Enters the configuration mode for the specified interface.

Note 

The service policy on a port channel applies to all member interfaces.

Step 3

switch(config-if)# service-policy input policy-name

Applies the policy map to the interface.

Note 

There is a restriction that system type qos policy cannot be the same as any the type qos policy applied to an interface or EtherChannel.

Example

This example shows how to apply a policy to an Ethernet interface:

switch# configure terminal
switch(config)# interface ethernet 1/1
switch(config-if)# service-policy type qos input policy1

Verifying the QoS Configuration

To verify the QoS configurations, perform one of these tasks:

Command

Purpose

switch# show class-map

Displays the class maps defined on the device.

switch# show policy-map [name]

Displays the policy maps defined on the device. Optionally, you can display the named policy only.

switch# show policy-map interface [interface number]

Displays the policy map settings for an interface or all interfaces.

switch# show policy-map system

Displays the policy map settings attached to the system qos.

switch# show policy-map type {network-qos | qos | queuing} [name]

Displays the policy map settings for a specific policy type. Optionally, you can display the named policy only.

switch# show interface untagged-cos [module number]

Displays the untagged CoS values for all interfaces.

switch# show wrr-queue cos-map [var]

Displays the mapped CoS values to egress queues.

Note 

This command may not work on Cisco Nexus 3500 Series switches.

switch# show running-config ipqos

Displays information about the running configuration for QoS.

switch# show startup-config ipqos

Displays information about the startup configuration for QoS.

switch# show queuing interface ethernet slot-no/port-no

Displays the queuing information on interfaces.

switch# show queuing

Displays the queuing information configured for all interfaces. It includes shaper configuration information for each class, the control queue Tx and drop statistics for each port, and WRED drop packet counts.

This example shows how to configure a network QoS policy:

switch(config)# class-map type network-qos cnq1
switch(config-cmap-nq)# match qos-group 1
switch(config-cmap-nq)# exit
switch(config)# class-map type network-qos cnq6
switch(config-cmap-nq)# match qos-group 6
switch(config-cmap-nq)# exit
switch(config)# policy-map type network-qos pnqos
switch(config-pmap-nqos)# class type network-qos cnq1
switch(config-pmap-nqos-c)# mtu 2200
switch(config-pmap-nqos-c)# pause no-drop
switch(config-pmap-nqos-c)# set cos 4
switch(config-pmap-nqos-c)# exit
switch(config-pmap-nqos)# class type network-qos cnq6
switch(config-pmap-nqos-c)# mtu 2200
switch(config-pmap-nqos-c)# pause no-drop
switch(config-pmap-nqos-c)# set cos 5
switch(config-pmap-nqos-c)# congestion-control random-detect ecn
switch(config-pmap-nqos-c)# exit
switch(config-pmap-nqos)# class type network-qos class-default
switch(config-pmap-nqos-c)# mtu 9216
switch(config-pmap-nqos-c)# exit
switch(config-pmap-nqos)# system qos
switch(config-sys-qos)# service-policy type network-qos pnqos
switch(config-sys-qos)#

This example shows how to configure an output queuing policy:

switch(config)# class-map type queuing cqu1
switch(config-cmap-que)# match qos-group 1
switch(config-cmap-que)# exit
switch(config)# class-map type queuing cqu6
switch(config-cmap-que)# match qos-group 6
switch(config-cmap-que)# exit
switch(config)# policy-map type queuing pqu
switch(config-pmap-que)# class type queuing class-default
switch(config-pmap-c-que)# bandwidth percent 70
switch(config-pmap-c-que)# exit
switch(config-pmap-que)# class type queuing cqu1
switch(config-pmap-c-que)# bandwidth percent 10
switch(config-pmap-c-que)# exit
switch(config-pmap-que)# class type queuing cqu6
switch(config-pmap-c-que)# bandwidth percent 20
switch(config-pmap-c-que)# exit
switch(config-pmap-que)# exit
switch(config)# system qos
switch(config-sys-qos)# service-policy type queuing output pqu
switch(config-sys-qos)#

This example shows how to configure an input queuing policy:

switch(config)# class-map type queuing cqu1
switch(config-cmap-que)# match qos-group 1
switch(config-cmap-que)# exit
switch(config)# class-map type queuing cqu6
switch(config-cmap-que)# match qos-group 6
switch(config-cmap-que)# exit
switch(config)# policy-map type queuing piqu
switch(config-pmap-que)# class type queuing cqu1
switch(config-pmap-c-que)# pause buffer-size 39936 pause-threshold 24960 resume-threshold 12480
switch(config-pmap-c-que)# pause priority-group 1
switch(config-pmap-c-que)# exit
switch(config-pmap-que)# class type queuing cqu6
switch(config-pmap-c-que)# pause priority-group 3
switch(config-pmap-c-que)# exit
switch(config-pmap-que)# class type queuing class-default
switch(config-pmap-c-que)# queue-limit dynamic 2
switch(config-pmap-c-que)# exit
switch(config-pmap-que)# exit
switch(config)# system qos
switch(config-sys-qos)# service-policy type queuing output piqu
switch(config-sys-qos)#

This example shows how to configure a QoS policy:

switch(config)# class-map type qos cqos1
switch(config-cmap-qos)# match cos 1
switch(config-cmap-qos)# exit
switch(config)# class-map type qos cqos6
switch(config-cmap-qos)# match cos 6
switch(config-cmap-qos)# exit
switch(config)# policy-map type qos pqos
switch(config-pmap-qos)# class type qos cqos1
switch(config-pmap-c-qos)# set qos-group 1
switch(config-pmap-c-qos)# exit
switch(config-pmap-qos)# class type qos cqos6
switch(config-pmap-c-qos)# set qos-group 6
switch(config-pmap-c-qos)# exit
switch(config-pmap-qos)# exit
switch(config)# system qos
switch(config-sys-qos)# service-policy type qos input pqos
switch(config-sys-qos)#

This example shows how to verify the untagged-cos configuration on interfaces:

switch(config-if)# show interface untagged-cos
=================================

Interface      Untagged-CoS
=================================

Ethernet1/1  4
Ethernet1/2
Ethernet1/3  5
Ethernet1/4
Ethernet1/5
Ethernet1/6
Ethernet1/7
Ethernet1/8
Ethernet1/9
Ethernet1/10
Ethernet1/11
Ethernet1/12
Ethernet1/13
Ethernet1/14
Ethernet1/15
Ethernet1/16
Ethernet1/17

This example shows how to display the QoS running configuration:

switch(config)# show running-config ipqos
!Command: show running-config ipqos
!Time: Tue Dec 10 08:29:08 2013

version 6.0(2)U2(1)
class-map type qos match-all c1
  match cos 1
class-map type qos match-all c2
  match cos 2
.
.
.
class-map type qos match-any cq1
  match cos 4
class-map type qos match-any cq2
  match cos 5
class-map type qos match-all dscp
  match precedence 0
class-map type qos match-all cq1_1
  match cos 4
  match precedence 7
class-map type qos match-all cq2_1
  match cos 5
  match precedence 3
class-map type qos match-all cMap_Cos_1
  match cos 1
class-map type qos match-all cMap_Cos_2
  match cos 2
.
.
.

class-map type queuing cMap_Qing_match_qGrp_7
  match qos-group 7
policy-map type qos inpq
  class c5
    set qos-group 5
.
.
.
policy-map type queuing piqu
  class type queuing cqu1
    pause buffer-size 39936 pause-threshold 24960 resume-threshold 12480
    pause priority-group 1
  class type queuing cqu6
    pause priority-group 3
.
.
.

class-map type network-qos cMap_NQ_match_qGrp_7
  match qos-group 7
policy-map type network-qos pnqos
  class type network-qos cnq1
    mtu 2200
    pause no-drop
    set cos 4
  class type network-qos cnq6
    mtu 2200
    pause no-drop
    set cos 5
    congestion-control random-detect ecn
.
.
.
system qos
  service-policy type qos input pMap_Qos_system
  service-policy type network-qos pMap_NQ_system
  service-policy type queuing output pMap_Qing_system


interface Ethernet1/1/1
  priority-flow-control mode on

interface Ethernet1/32
  priority-flow-control mode on

This example shows how to display the QoS groups that are mapped to the egress queue:

switch(config)# wrr-queue qos-group-map 3 1
switch(config)# show wrr-queue qos-group-map
MCAST Queue ID           Qos-Group Map
0                       0
1                       2 3
2                       4 5
3                       1 6 7
switch(config)#

This example shows how to display the class map configuration:

switch(config)# show class-map


  Type qos class-maps
  ===================

    class-map type qos match-all cqos1
      match cos 1

    class-map type qos match-all cqos6
      match cos 6

    class-map type qos match-any class-default
      match any


  Type queuing class-maps
  =======================

    class-map type queuing cqu1
      match qos-group 1

    class-map type queuing cqu6
      match qos-group 6

    class-map type queuing class-default
      match qos-group 0



  Type network-qos class-maps
  ==============================

    class-map type network-qos cnq1
      match qos-group 1

    class-map type network-qos cnq6
      match qos-group 6

    class-map type network-qos class-default
      match qos-group 0

switch(config)#

This example shows how to display the policy map configuration:

switch(config)# show policy-map


  Type qos policy-maps
  ====================

  policy-map type qos pqos
    class type qos cqos1
      set qos-group 1
    class type qos cqos6
      set qos-group 6
    class type qos class-default
      set qos-group 0
  policy-map type qos default-in-policy
    class type qos class-default
      set qos-group 0

  Type queuing policy-maps
  ========================  
  policy-map type queuing piqu
    class type queuing cqu1
      pause buffer-size 39936 pause-threshold 24960 resume-threshold 12480
      pause priority-group 1
    class type queuing cqu6
      pause priority-group 3
    class type queuing class-default
      bandwidth percent 100
      queue-limit dynamic 2


  Type network-qos policy-maps
  ===============================

  policy-map type network-qos pnqos
    class type network-qos cnq1
      mtu 1500
      set cos 4
    class type network-qos cnq6
      mtu 1500
      set cos 5
      congestion-control random-detect ecn
    class type network-qos class-default
      mtu 9216
  policy-map type network-qos default-nq-policy
    class type network-qos class-default
      mtu 1500
switch(config)#

This example shows how to display all active policy maps in the system:

switch(config)# show policy-map system
	Type network-qos policy-maps
	===============================
 policy-map type network-qos pnqos
    class type network-qos cnq1
      match qos-group 1

      mtu 2200
      pause no-drop
      set cos 4
    class type network-qos cnq6
      match qos-group 6

      mtu 2200
      pause no-drop
      set cos 5
      congestion-control random-detect ecn
    class type network-qos class-default
      match qos-group 0

      mtu 9216

  Service-policy (qos) input:   pMap_Qos_system
    policy statistics status:   enabled

Class-map (qos):   cqos1 (match-all)
      Match: cos 1
      set qos-group 1

    Class-map (qos):   cqos6 (match-all)
      Match: cos 6
      set qos-group 6

    Class-map (qos):   class-default (match-any)
      Match: any
      set qos-group 0

  Service-policy (queuing) output:   pqu
    policy statistics status:   disabled

    Class-map (queuing):   cqu1 (match-any)
      Match: qos-group 1
      bandwidth percent 10

    Class-map (queuing):   cqu6 (match-any)
      Match: qos-group 6
      bandwidth percent 20

    Class-map (queuing):   class-default (match-any)
      Match: qos-group 0
      bandwidth percent 70

switch(config)#

This example shows how to display the service policy maps configured on the interfaces:

switch(config)# show policy-map interface ethernet 1/1


Global statistics status :   enabled

Ethernet1/1

  Service-policy (qos) input:   pqos
    policy statistics status:   enabled

    Class-map (qos):   cqos1 (match-all)
      Match: cos 1
      set qos-group 1

    Class-map (qos):   cqos6 (match-all)
      Match: cos 6
      set qos-group 6

    Class-map (qos):   class-default (match-any)
      Match: any
      set qos-group 0

  Service-policy (queuing) output:   pqu
    policy statistics status:   enabled

    Class-map (queuing):   cqu1 (match-any)
      Match: qos-group 1
      bandwidth percent 10

    Class-map (queuing):   cqu6 (match-any)
      Match: qos-group 6
      bandwidth percent 20

    Class-map (queuing):   class-default (match-any)
      Match: qos-group 0
      bandwidth percent 70

switch(config)#

This example shows how to display the queuing information configured for all interfaces:

switch# show queuing
Egress Queuing for Ethernet1/1 [Interface]
------------------------------------------------------------------
QoS-Group# Bandwidth% PrioLevel                Shape     
                                   Min          Max        Units
------------------------------------------------------------------
      0            10         -          0          0               -
      1            10         -          0          0               -
      2            10         -          0          0               -
      3            10         1          0          0               -
      4            10         -          0          0               -
      5            10         2          0          0               -
      6            10         -          0          0               -
      7            10         -          0          0               -
      9             0         -          0          0               -
+-------------------------------------------------------------------+
|                              QOS GROUP 0                          |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|               0|               0
|         Tx Byts|               0|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+-------------------------------------------------------------------+
|                              QOS GROUP 1                          |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|               0|               0
|         Tx Byts|               0|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+-------------------------------------------------------------------+
|                              QOS GROUP 2                          |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|               0|               0
|         Tx Byts|               0|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+-------------------------------------------------------------------+
|                              QOS GROUP 3                          |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|               0|               0
|         Tx Byts|               0|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+-------------------------------------------------------------------+
|                              QOS GROUP 4                          |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|               0|               0
|         Tx Byts|               0|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+-------------------------------------------------------------------+
|                              QOS GROUP 5                          |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|               0|               0
|         Tx Byts|               0|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+-------------------------------------------------------------------+
|                              QOS GROUP 6                          |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|               0|               0
|         Tx Byts|               0|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+-------------------------------------------------------------------+
|                              QOS GROUP 7                          |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|               0|               0
|         Tx Byts|               0|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+-------------------------------------------------------------------+
|                              CONTROL QOS GROUP 9                  |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|            1901|               0
|         Tx Byts|          145235|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+--------------------------------------------------+
Port Egress Statistics
----------------------------------------------------
WRED Drop Pkts                0


...

Egress Queuing for Ethernet1/4 [Interface]
------------------------------------------------------------------
QoS-Group# Bandwidth% PrioLevel                Shape
                                   Min          Max        Units
------------------------------------------------------------------
      0           100         -          0          0               -
      9             0         -          0          0               -
+-------------------------------------------------------------------+
|                              QOS GROUP 0                          |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|               0|               0
|         Tx Byts|               0|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+-------------------------------------------------------------------+
|                              CONTROL QOS GROUP 9                  |
+-------------------------------------------------------------------+
|                |  Unicast       |  Multicast     |
+-------------------------------------------------------------------+
|         Tx Pkts|            8634|               0
|         Tx Byts|         1218248|               0
|    Dropped Pkts|               0|               0
|    Dropped Byts|               0|               0
+--------------------------------------------------+
Port Egress Statistics
----------------------------------------------------
WRED Drop Pkts                0


Monitoring the QoS Packet Buffer

Cisco Nexus 3000 series switches have a 9-MB buffer memory and the Cisco Nexus 3100 platform switches have a 12-MB buffer memory that divides into a dedicated per port and dynamic shared memory. Each front-panel port has eight unicast and four multicast queues in egress. The Cisco Nexus 3100 platform switches have eight unicast and eight multicast queues in egress. In the scenario of burst or congestion, each egress port consumes buffers from the dynamic shared memory.

For the Cisco Nexus 3000 series switches, you can display the real-time status of the shared buffer per port. For the Cisco Nexus 3100 platform switches, you can also display the 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

For the Cisco Nexus 34180YC switch:

  • The maximum amount of data in a cell is 80 bytes.

  • The total number of cells available is 194224.

  • The total memory is 15 MB (194224 * 80 = 15537920 bytes).


switch(config-if)# sh hardware internal buffer info pkt-stats 

slot  1
=======


INSTANCE: 0

============


|-------------------------------------------------------------------------------------|
                     Output Buffer Pool Utilization (in cells)                        
                                   BP-0           BP-1           BP-2           BP-3
|-------------------------------------------------------------------------------------|

Total Instant Usage                 1537            0               -              -
Remaining Instant Usage             192687          5200            -              -
Peak/Max Cells Used                 38965           228             -              -
Switch Cell Count                   194224          5200            -              -
switch(config-if)# 

Starting with Release 6.0(2)U5(1), the buffer is carved into two pools: pool 0 and pool 1. Cisco Nexus 3000 Series switches that have Broadcom T+ have 9MB of total buffer and Broadcom T2 have 12MB of total buffer. There are three buffer modes – all, default, and none. The default mode of buffer in Cisco Nexus 3000 series switches is all.


Note

The Cisco Nexus 34180YC switch does not support the all, default, and none buffer modes.


In default mode all for T+, there are 10 unicast queues and 5 multicast queues. Each queue in T+ consumes 8 cells. Therefore, 10x8+5x8=120 cells are consumed by each port. T+ has total 46080 cells. The all mode consumes 120 cells/port in T+.

In default mode all for T2, there are 10 unicast queues and 10 multicast queues. Each queue in T2 consumes 11 cells. Therefore, 10x11+10x11=220 cells are consumed by each port. T2 has total 61440 cells. The all mode consumes 220 cells/port in T2.

Cisco Nexus 3000 series switches that are based out of T+ and T2 have 48 CPU multicast queues.

The default mode consumes for one default unicast queue, multicast queue, unicast CPU queue (q9), and multicast cpu queue (q9) totaling 11x4=44 cells. The none mode consumes only for unicast CPU queue (q9) and multicast CPU queue (q9) – totaling 11x2=22 cells.

The maximum cells consumed in each platform are:
  • Platform T2 based Product– Max Cells for All Mode is 23586 cells.

  • Platform T2 based Product– Max Cells for Default Mode is 29903 cells.

  • Platform T2 based Product – Max Cells for None Mode is 30677 cells.

The show running | grep hardware command displays the configured mode in the CLI output:


switch# show running | grep hardware 
hardware profile portmode 48X10G+breakout6x40g 
hardware qos min-buffer qos-group none

Usage information of shared buffer resources:

  • Total Instant Usage—Current buffer usage in terms of the number of cells on a global basis.

  • Remaining Instant Usage—Effective free number of cells available on a global basis.

  • Max Cell Usage—Maximum buffer usage that is seen until the system buffer maximum cell usage counter is last cleared.

  • Switch Cell Count—Total global buffer space available in the platform in terms of the number of cells on a global basis.

UC and MC represent the 8 unicast (Q1-Q8) and 8 multicast (Q1-Q8) instant cell usage. The example above shows that the multicast queue Q1 is consuming 3807 cells instantaneously on port 9.

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

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

The following example shows how to set a buffer utilization threshold on a per port basis. If the buffer occupancy exceeds this number, you can generate a syslog.


Note

The Cisco Nexus 34180YC switch does not support buffer utilization threshold on a per port basis.


switch# hardware profile buffer info port-threshold front-port  1 threshold  10
Port threshold changed successfully