Configuring Marking

About Marking

Marking is a method that you use to modify the QoS fields of the incoming and outgoing packets. The QoS fields that you can mark are IP precedence and differentiated services code point (DSCP) in Layer 3. The QoS group is a label local to the system to which you can assign intermediate marking values. You can use the QoS group label to determine the egress scheduling.

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

Table 1. Configurable Marking Features

Marking Feature

Description

DSCP

Layer 3 DSCP.

IP precedence

Layer 3 IP precedence.

Note

 

IP precedence uses only the lower three bits of the type of service (ToS) field. The device overwrites the first three bits of the ToS field to 0.

QoS group

Locally significant QoS values that can be manipulated and matched within the system. The range is from 0 to 7.

Ingress

Status of the marking applies to incoming packets.

CoS

Layer 2 VLAN ID

Prerequisites for Marking

Classification has the following prerequisites:

  • You must be familiar with using modular QoS CLI.

  • You are logged on to the device.

Guidelines and Limitations

Marking has the following configuration guidelines and limitations:

  • show commands with the internal keyword are not supported.

  • The set qos-group command can only be used in ingress policies.

  • Control traffic, such as BPDUs, routing protocol packets, LACP/CDP/BFD, GOLD packets, glean traffic, and management traffic, are automatically classified into a control group based on a criteria. These packets are also given a dedicated buffer pool so that any congestion of data traffic does not affect control traffic. The control qos-group traffic classification cannot be modified.

Configuring Marking

You can combine one or more of the marking features in a policy map to control the setting of QoS values. You can then apply policies to either incoming or outgoing packets on an interface.


Note


Do not press Enter after you use the set command and before you add the rest of the command. If you press Enter directly after entering the set keyword, you will be unable to continue to configure with the QoS configuration.


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 63, in addition to the standard DSCP values shown in the following table.

Table 2. 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


Note


For more information about DSCP, see RFC 2475.


Procedure


Step 1

Enter global configuration mode.

configure terminal

Step 2

Create or access 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.

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

Step 3

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

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

Step 4

Set the DSCP value to dscp-value . Standard values are shown in the previous Standard DSCP Values table.

set dscp dscp-value


Example: Configuring DSCP Marking

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

switch# show policy-map policy1

The following is a running configuration example. Replace the placeholders with relevant values for your setup.

configure terminal
     policy-map policy1
     class class1
     set dscp af31

Configuring IP Precedence Marking

You can set the value of the IP precedence field in bits 0–2 of the IPv4 type of service (ToS) field of the IP header.


Note


The device rewrites the last 3 bits of the ToS field to 0 for packets that match this class.


Table 3. 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


Step 1

Enter global configuration mode.

configure terminal

Step 2

Create or access 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.

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

Step 3

Create a reference to class-name and enters policy-map class configuration mode. The class is added to the end of the policy map.

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

Step 4

Set the IP precedence value to precedence-value . The value can range from 0 to 7. You can enter one of the values shown in the above Precedence Values table.

set precedence precedence-value


Example: Configuring IP Precedence Marking

The following is a running configuration example. Replace the placeholders with relevant values for your setup.

configure terminal
     policy-map policy1
     class class1
     set precedence 3

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

show policy-map policy1

Configuring CoS Marking

You can set the value of the CoS field in the high-order three bits of the VLAN ID Tag field in the IEEE 802.1Q header.

Procedure


Step 1

Enter global configuration mode.

configure terminal

Step 2

Create or access 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.

policy-map [type qos] [match-first] [qos-policy-map-name | qos-dynamic]

Step 3

Create a reference to class-map-name , and enters policy-map class configuration mode. The class is added to the end of the policy map unless insert-before is used to specify the class to insert before. Use the class-default keyword to select all traffic that is not currently matched by classes in the policy map.

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

Step 4

Set the CoS value to cos-value . The value can range from 0 to 7.

set cos cos-value

Note

 

VLAN QoS supports set qos-group . It does not support set cos .


Example: Configuring CoS Marking

The following is a running configuration example. Replace the placeholders with relevant values for your setup.

configure terminal
     policy-map policy1
     class class1
     set cos 3

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

show policy-map policy1

Configuring Ingress Marking

You can apply the marking instructions in a QoS policy map to ingress packets by attaching that QoS policy map to an interface. To select ingress, you specify the input keyword in the service-policy command.

For more information, see the “Attaching and Detaching a QoS Policy Action” section.

Configuring DSCP Port Marking

You can set the DSCP value for each class of traffic defined in a specified ingress policy map.

The default behavior of the device is to preserve the DSCP value or to trust DSCP. To make the port untrusted, change the DSCP value. Unless you configure a QoS policy and attach that policy to specified interfaces, the DSCP value is preserved.


Note


  • You can attach only one policy type qos map to each interface in each direction.

  • The DSCP value is trust on the Layer 3 port of a Cisco NX-OS device.


Procedure


Step 1

Enter global configuration mode.

switch# configure terminal

Step 2

Create 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.

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

Step 3

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

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

Step 4

Set the DSCP value to dscp-value. Valid values are listed in the Standard DSCP Values table in the Configuring DSCP Marking section.

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

Step 5

Return to policy-map configuration mode.

switch(config-pmap-c-qos)# exit

Step 6

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

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

Step 7

Sets the DSCP value to dscp-value. Valid values are listed in the Standard DSCP Values table in the Configuring DSCP Marking section.

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

Step 8

Returns to policy-map configuration mode.

switch(config-pmap-c-qos)# exit

Step 9

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

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

Step 10

Set the DSCP value to dscp-value. Valid values are listed in the Standard DSCP Values table in the Configuring DSCP Marking section.

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

Step 11

Return to policy-map configuration mode.

switch(config-pmap-c-qos)# exit

Step 12

Enter interface mode to configure the Ethernet interface.

switch(config)# interface ethernet slot/port

Step 13

Add policy-map-name to the input packets of the interface. You can attach only one input policy and one output policy to an interface.

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


Example: Configuring DSCP Port Marking

The following is a running configuration example. Replace the placeholders with relevant values for your setup.

configure terminal
    policy-map policy1
    class class1
    set dscp af31
    exit
    class class2
    set dscp af1
    exit
    class class-default
    set dscp af22
    exit
    interface ethernet 1/1
    service-policy input policy1

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

switch# show policy-map policy1

Verifying the Marking Configuration

To display the marking configuration information, enter the following command:

show policy-map

Configuration Examples for Marking

The following example shows how to configure marking:

configure terminal
policy-map type qos untrust_dcsp
class class-default
set precedence 3
set qos-qroup 3
set dscp 0