Document ID: 113556
This document provides a sample configuration for Cisco NX-OS quality of service (QoS) features on the Cisco Nexus 7000 Series Switch that allow you to classify the network traffic, police and prioritize the traffic flow, and help avoid traffic congestion in a network.
Ensure that you meet these requirements before you attempt this configuration:
Have basic knowledge of configuration on Nexus 7000 Series Switches
Have basic knowledge of QoS
The information in this document is based on the Nexus 7000 Series Switch.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.
Refer to the Cisco Technical Tips Conventions for more information on document conventions.
The default QoS parameters on the Nexus 7000 switch are sufficient for most deployments. However, you need to understand the restrictions and configuration details if you need to create custom policies.
There are two aspects that you need to consider for QoS on a Nexus 7000 switch:
Queuing is performed in hardware and is configured via Modular Quality of Service Command-Line Interface (MQC) queuing policies. The QoS policies (used to mark or police traffic) is used via a MQC QoS policies in the exact format as a standard QoS policy on other Cisco platforms (for example, access-list list used to classify traffic in a class-map with a corresponding policy-map to set/police traffic).
Currently, the Nexus 7000 switch performs queuing based strictly on CoS value. Therefore, you need to first understand how the CoS value is derived. After you know what CoS value will be entering or leaving the switch, you can focus on the queuing configuration to get the desired QoS for different traffic types.
For routed unicast traffic, the CoS value is derived from the 3 most-significant bits of the DSCP value. For bridged unicast traffic, the CoS value is copied from the CoS value received in the 802.1q header. Note that on L2 access links there is no trunk header. Therefore, by default, if traffic is received on an access port and bridged then it will egress the switch with CoS 0. The DSCP value does not change, but the packet does not get the proper priority. You can manually set the CoS value in a policy-map via any QoS policy that manually sets the CoS or DSCP value.
It is important to understand the behavior for multicast as well. Routed multicast traffic derives its CoS value in the same manner as routed unicast traffic. For bridged multicast traffic, the behavior depends on the L3 state. If there is no L3 state for the multicast group, then the CoS will be derived in the same manner as bridged unicast traffic. If there is L3 state for the multicast group, then the CoS will be derived in the same manner as routed unicast traffic. Note that enabling PIM in sparse mode on the SVI for the VLAN in which traffic is received will create a S,G entry when the multicast is seen.
|Traffic Type||CoS Behavior|
|Routed unicast||copied from 3-MSB of ToS|
|Bridge unicast||copied from received CoS value|
|Routed multicast||copied from 3-MSB of ToS|
|Bridge multicast with L3 state for group||copied from 3-MSB of ToS|
|Bridge multicast with no L3 state for group||copied from received CoS value|
In this section, you are presented with the information to configure the QoS features described in this document.
This document uses this network setup:
This document uses these configurations:
A good workaround for setting the CoS value on bridged traffic received on an access port is to set the DSCP based on a table map:
|Nexus 7000 switch|
! !--- Create or access the table map and then enters table-map mode. table-map copy_dscp default copy ! !--- Create or access the specified policy map and then enters policy-map mode. policy-map type qos copy_dscp !--- Configure class-default to capture all traffic in this policy map. class class-default !--- Use mutation mapping on the DSCP field based on the mapping values in table map copy_dscp. set dscp dscp table copy_dscp ! !--- Enter interface mode interface <L2 access port> !--- Adds the policy map to the input packets of an interface. service-policy type qos input copy_dscp
Once the CoS value is derived, you can manipulate the global queuing class-maps to affect the cos-to-queue mappings. These class-maps are global and affect all modules in all virtual device contexts (VDCs) for that particular queue-type.
For example, consider the default queuing class-maps for the M108 and M132 modules (1p7q4t):
|Nexus 7000 switch|
!--- Configure the class map of type queuing, and then enters class-map queuing mode. class-map type queuing match-any 1p7q4t-out-pq1 Description: Classifier for egress priority queue of type 1p7q4t !--- Set the CoS value range matched by this queue. match cos 5-7 class-map type queuing match-any 1p7q4t-out-q2 Description: Classifier for egress queue 2 of type 1p7q4t class-map type queuing match-any 1p7q4t-out-q3 Description: Classifier for egress queue 3 of type 1p7q4t class-map type queuing match-any 1p7q4t-out-q4 Description: Classifier for egress queue 4 of type 1p7q4t class-map type queuing match-any 1p7q4t-out-q5 Description: Classifier for egress queue 5 of type 1p7q4t class-map type queuing match-any 1p7q4t-out-q6 Description: Classifier for egress queue 6 of type 1p7q4t class-map type queuing match-any 1p7q4t-out-q7 Description: Classifier for egress queue 7 of type 1p7q4t class-map type queuing match-any 1p7q4t-out-q-default Description: Classifier for egress default queue of type 1p7q4t match cos 0-4
By default, CoS 0-4 is mapped to the default queue and CoS 5-7 is mapped to the priority queue. These go hand-in-hand with the default queuing policy for the same queuing type:
|Nexus 7000 switch|
!--- Configure the policy map of type queuing and enter policy-map mode. policy-map type queuing default-out-policy !--- Configure the class map of type queuing and then enter policy-map class queuing mode. class type queuing out-pq1 !--- Mark the priority level of the traffic queue. priority level 1 !--- Set the queue limit for the queue. queue-limit percent 16 class type queuing out-q2 queue-limit percent 1 class type queuing out-q3 queue-limit percent 1 class type queuing out-q-default queue-limit percent 82 bandwidth remaining percent 25
The priority queue is "priority" with a queue-limit of 16% and the default queue has a queue-limit of 82% with a default bandwidth remaining weight. The other queues that are not in use are assigned a queue-limit of 1%. Note that q4, q5, and q6 are not represented in the default queuing policy. Therefore, these have a smaller queue-limit and bandwidth weight programmed in hardware.
In order to create a custom queuing policy, you need to first create the policy and configure the queue sets, alter the global queuing class-maps, and finally apply the queuing policy to the appropriate interfaces. For example, for the M108 or M132 modules, suppose you wanted to implement a policy mapping each CoS value to a unique queue with a custom queuing policy. You need to implement it as follows:
|Nexus 7000 switch|
! voice !--- Configure the class map of type queuing, and then enter class-map queuing mode. class-map type queuing match-any 1p7q4t-out-pq1 !--- Set the CoS value range matched by this queue. match cos 5 ! scavenger class-map type queuing match-any 1p7q4t-out-q2 match cos 1 ! transactional class-map type queuing match-any 1p7q4t-out-q3 match cos 2 ! call signaling class-map type queuing match-any 1p7q4t-out-q4 match cos 3 ! video class-map type queuing match-any 1p7q4t-out-q5 match cos 4 ! routing class-map type queuing match-any 1p7q4t-out-q6 match cos 6 ! management class-map type queuing match-any 1p7q4t-out-q7 match cos 7 ! best effort class-map type queuing match-any 1p7q4t-out-q-default match cos 0
|Nexus 7000 switch|
!--- Configure the policy map of type queuing, and then enter policy-map mode !--- for the policy-map specified. policy-map type queuing 10G_POLICY !--- Configure the class map of type queuing, and then enter policy-map class queuing mode. class type queuing 1p7q4t-out-pq1 !--- Select this queue as a priority queue. !--- Only one priority level is supported. priority level 1 !--- Assign a tail drop threshold based on the percentage of the buffer memory !--- that is used by the queue. queue-limit percent 10 class type queuing 1p7q4t-out-q2 queue-limit percent 10 bandwidth remaining percent 10 class type queuing 1p7q4t-out-q3 queue-limit percent 5 bandwidth remaining percent 5 class type queuing 1p7q4t-out-q4 queue-limit percent 5 bandwidth remaining percent 5 class type queuing 1p7q4t-out-q5 queue-limit percent 10 bandwidth remaining percent 20 class type queuing 1p7q4t-out-q6 queue-limit percent 5 bandwidth remaining percent 10 class type queuing 1p7q4t-out-q7 queue-limit percent 5 bandwidth remaining percent 10 class type queuing 1p7q4t-out-q-default queue-limit percent 50 !--- Assign the percentage of the bandwidth that remains to this queue. bandwidth remaining percent 40
Under each 1p7q4t interface you need to apply the above queueing policy. For example:
|Nexus 7000 switch|
!--- Apply a policy to an interface. Nexus7000(config)#interface Ethernet8/1 Nexus7000(config-if)#service-policy type queuing output 10G_POLICY
Use this section to confirm that your configuration works properly.
Here are some of the verification commands:
Use the show policy-map interface ethernet8/1 command in order to view the policy currently configured under the interface and any drops.
Use the show policy-map type queuing policy-map-name command in order to view the information about all configured policy maps or a selected policy map of type queuing.
Use the show class-map type queuing class-queuing-name command in order to view the information about all configured class maps or a selected class map of type queuing.
Use the show table-map table-map-name command in order to view the information about all configured table maps or a selected table map.
This section provides information you can use to troubleshoot your configuration.
A common mistake you can see while implementing a custom 10G queueing policy is that it uses all the 8 queues. They will map CoS 0 globally to queue 7 and configure custom bandwidths and queue-limits for the 1p7q4t-out-q7 class. However, they will neglect to apply this policy to all 10G interfaces. Therefore, any 10G interfaces with the default policy-map will not have any bandwidth or queue limit configured for the 1p7q4t-out-q7 class because it only utilizes the pq1, q2, q3, and q-default. Thus, q7 is allocated the minimum allowed values in hardware. This results in heavy packet loss.
Therefore, it is important to note that changes to the global class-maps affect all interfaces and each must have the appropriate queuing policy that agrees with the global configurations.
- Cisco Nexus 7000 Series Switches Support Page
- QoS Technology Support
- Switches Product Support
- LAN Switching Technology Support
- Technical Support & Documentation - Cisco Systems
|Updated: May 29, 2012||Document ID: 113556|