The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
Contents
This chapter contains the following sections:
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:
Configuring Marking
For Cisco Nexus devices, 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 63, in addition to the standard DSCP values shown in the table below:
![]() Note | You can set DSCP or IP Precedence but you can not set both values because they modify the same field in the IP packet. |
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 |
This example shows how to set the DSCP value to 10 and specify the qos-group to 2.
policy-map type qos test-bulkdata class type qos bulkdata set dscp 10 set qos-group 2
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 can not set both values because they modify the same field in the IP packet. |
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) |
Command or Action | Purpose | |
---|---|---|
Step 1 | config t |
Enters configuration mode. |
Step 2 |
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 |
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 precedence precedence-value
|
Sets the IP precedence value to precedence-value. You can enter one of the values shown in the Precedence Values table. |
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)#
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.
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.
|
In Layer 3 topologies, you must configure each QoS group in the network-qos policy with a unique cos value.
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 | switch# show policy-map system | Displays the already configured policy maps and CoS values. In Layer 3 topologies, each qosgroup must have a unique CoS value. Use the show policy-map system command to view CoS values that have been used and that are unavailable for QoS groups. | ||
Step 2 | switch# configure terminal |
Enters global configuration mode. | ||
Step 3 | 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 4 | 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 5 | switch(config-pmap-nq-c) # set cos cos-value |
Specifies the CoS value. The value can range from 0 to 7.
|
This example shows how to set the CoS value to 4 in a Layer 3 topology:
switch# show policy-map system Type network-qos policy-maps =============================== policy-map type network-qos pn-01 class type network-qos cn-01 match qos-group 1 mtu 8500 pause no-drop set cos 2 class type network-qos cn-02 match qos-group 2 set cos 4 mtu 9216 class type network-qos cn-03 match qos-group 3 mtu 8000 set cos 6 class type network-qos cn-04 match qos-group 4 mtu 8750 set cos 7 class type network-qos cn-ip-multicast match qos-group 5 set cos 5 mtu 7500 class type network-qos class-default match qos-group 0 mtu 1500 multicast-optimize set cos 1 ... switch# configure terminal switch(config)# policy-map type network-qos pn-01 switch(config-pmap-nq)# class type network-qos cn-05 switch(config-pmap-c-nq)# set cos 3
Use one of the following commands to verify the configuration:
Command |
Purpose |
---|---|
show class-map |
Displays the class maps defined on the switch. |
show policy-map [name] |
Displays the policy maps defined on the switch. Optionally, you can display the named policy only. |
running-config ipqos |
Displays information about the running configuration for QoS. |
startup-config ipqos |
Displays informationa bout the startup configuration for QoS. |