QoS Classification Commands

This chapter describes the commands used for QoS packet classification.

match dscp

To identify specific IP differentiated services code point (DSCP) values as match criteria for a class map, use the match dscp command in class map configuration mode. To remove a DSCP value from a class map, use the no form of this command.

match [not] dscp { [ipv4 | ipv6] dscp-value [dscp-value1 . . . dscp-value7] | | [min-value - max-value]}

no match [not] dscp { [ipv4 | ipv6] dscp-value [dscp-value1 . . . dscp-value7] | | [min-value - max-value]}

Syntax Description

not

(Optional) Negates the specified match result.

ipv4

(Optional) Specifies the IPv4 DSCP value.

ipv6

(Optional) Specifies the IPv6 DSCP value.

dscp-value

IP DSCP value identifier that specifies the exact value or a range of values. Range is 0 - 63. Up to 64 IP DSCP values can be specified to match packets. Reserved keywords can be specified instead of numeric values.

min-value

Lower limit of DSCP range to match. Value range is 0 - 63.

max-value

Upper limit of DSCP range to match. Value range is 0 - 63.

Command Default

Matching on IP Version 4 (IPv4) and IPv6 packets is the default.

Command Modes

Class map configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The match dscp command is supported only in the ingress direction. The minimum value is 0 and maximum value is 63. The maximum allowed entries: 64.

The match dscp command specifies a DSCP value that is used as the match criteria against which packets are checked to determine if they belong to the class specified by the class map.

To use the match dscp command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish

The match dscp command examines the higher-order six bits in the type of service (ToS) byte of the IP header. If you specify more than one match dscp command in a class map, the new values are added to the existing statement.

The IP DSCP value is used as a matching criterion only. The value has no mathematical significance. For instance, the IP DSCP value 2 is not greater than 1. The value simply indicates that a packet marked with the IP DSCP value of 2 should be treated differently than a packet marked with an IP DSCP value of 1. The treatment of these marked packets is defined by the user through the setting of policies in policy map class configuration mode.

Table 1. IP DSCP Reserved Keywords

DSCP Value

Reserved Keyword

0

default

10

AF11

12

AF12

14

AF13

18

AF21

20

AF22

22

AF23

26

AF31

28

AF32

30

AF33

34

AF41

36

AF42

38

AF43

46

EF

8

CS1

16

CS2

24

CS3

32

CS4

40

CS5

48

CS6

56

CS7

ipv4

ipv4 dscp

ipv6

ipv6 dscp

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to configure the service policy called policy1. In this example, class map dscp14 evaluates all packets entering for an IP DSCP value of 14. If the incoming packet has been marked with the IP DSCP value of 14, the packet is queued to the class queue with the bandwidth setting of 1000 mbps.


RP/0/(config)# class-map dscp14
RP/0/(config-cmap)# match dscp ipv4 14
RP/0/(config-cmap)# exit

RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class dscp14
RP/0/(config-pmap-c)#bandwidth 1000 mbps
RP/0/(config-pmap-c)#exit
RP/0/(config-pmap)# exit

RP/0/(config)# interface HundredGigE 0/7/0/0
RP/0/(config-if)# service-policy input policy1

match mpls experimental topmost

To identify specific three-bit experimental (EXP) field values in the topmost Multiprotocol Label Switching (MPLS) label as match criteria for a class map, use the match mpls experimental topmost command in class map configuration mode. To remove experimental field values from the class map match criteria, use the no form of the command.

match [not] mpls experimental topmost exp-value [exp-value1 . . . exp-value7]

no match [not] mpls experimental topmost exp-value [exp-value1 . . . exp-value7]

Syntax Description

not

not

exp-value

Experimental value that specifies the exact value from 0 to 7. Up to eight experimental values can be specified to match MPLS headers.

Command Default

No default behavior or values

Command Modes

Class map configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The match mpls experimental topmost command is supported only in the ingress direction. The minimum value is 0 and maximum value is 7. The maximum allowed entries: 8.

The match mpls experimental topmost command is used by the class map to identify MPLS experimental values matching on a packet.

To use the match mpls experimental topmost command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. If you specify more than one match mpls experimental topmost command in a class map, the new values are added to the existing match statement.

This command examines the three experimental bits contained in the topmost label of an MPLS packet. Up to eight experimental values can be matched in one match statement. For example, match mpls experimental topmost 2 4 5 7 returns matches for experimental values of 2, 4, 5, and 7. Only one of the four values is needed to yield a match (OR operation).

The experimental values are used as a matching criterion only. The value has no mathematical significance. For instance, the experimental value 2 is not greater than 1. The value indicates that a packet marked with the experimental value of 2 should be treated differently than a packet marked with the EXP value of 1. The treatment of these different packets is defined by the user through the setting of QoS policies in policy map class configuration mode.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to configure the service policy called policy1 and attach service policy policy1 to an interface.


RP/0/(config)# class-map mplsmap1
RP/0/(config-cmap)# match mpls experimental topmost 1
RP/0/(config-cmap)# exit

RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class mplsmap1
RP/0/(config-pmap-c)# bandwidth 1000 mbps
RP/0/(config-pmap-c)#exit
RP/0/(config-pmap)#exit

RP/0/(config)# interface HundredGigabitEthernet  0/1/0/9
RP/0/(config-if)# service-policy input  policy1
  

match precedence

To identify IP precedence values as match criteria, use the match precedence command in class map configuration mode. To remove precedence values from a class map, use the no form of this command.

match [not] precedence [ipv4 | ipv6] precedence-value [precedence-value1 . . . precedence-value7]

no match [not] precedence [ipv4 | ipv6] precedence-value [precedence-value1 . . . precedence-value7]

Syntax Description

not

(Optional) Negates the specified match result.

ipv4

(Optional) Specifies the IPv4 precedence value.

ipv6

(Optional) Specifies the IPv6 precedence value.

precedence-value

An IP precedence value identifier that specifies the exact value. Reserved keywords can be specified instead of numeric values.

Up to eight precedence values can be matched in one match statement.

Command Default

Matching on both IP Version 4 (IPv4) and IPv6 packets is the default.

Command Modes

Class map configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The match precedence command is supported only in the ingress direction. The minimum value is 0 and maximum value is 7. The maximum allowed entries: 8.

The match precedence command specifies a precedence value that is used as the match criteria against which packets are checked to determine if they belong to the class specified by the class map.

To use the match precedence command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. If you specify more than one match precedence command in a class map, the new values are added to the existing statement.

The match precedence command examines the higher-order three bits in the type of service (ToS) byte of the IP header. Up to eight precedence values can be matched in one match statement. For example, match precedence ipv4 0 1 2 3 4 5 6 7 returns matches for IP precedence values of 0, 1, 2, 3, 4, 5, 6, and 7. Only one of the eight values is needed to yield a match (OR operation).

The precedence values are used as a matching criterion only. The value has no mathematical significance. For instance, the precedence value 2 is not greater than 1. The value simply indicates that a packet marked with the precedence value of 2 is different than a packet marked with the precedence value of 1. The treatment of these different packets is defined by the user through the setting of QoS policies in policy map class configuration mode.

This table lists the IP precedence value number and associated name in descending order of importance.

Table 2. IP Precedence Values and Names

Value

Name

0

routine

1

priority

2

immediate

3

flash

4

flash-override

5

critical

6

internet

7

network

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to configure the service policy called policy1 and attach service policy policy1 to an interface. In this example, class map ipprec5 evaluates all packets entering HundredGigabit Ethernet interface 0/1/0/9 for a precedence value of 5. If the incoming packet has been marked with the precedence value of 5, the packet is queued to the class queue with the bandwidth setting of 1000 mbps.


RP/0/# configure
RP/0/(config)# class-map ipprec5
RP/0/(config-cmap)# match precedence ipv4 5	
RP/0/(config-cmap)# exit

RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class ipprec5
RP/0/(config-pmap-c)# bandwidth 1000 mbps
RP/0/(config-pmap)# exit

RP/0/(config)# interface HundredGigabitEthernet  0/1/0/9
RP/0/(config-if)# service-policy input policy1
  

match qos-group

To identify specific quality-of-service (QoS) group values as match criteria in a class map, use the match qos-group command in class map configuration mode. To remove a specific QoS group value from the matching criteria for a class map, use the no form of this command.

Syntax Description

not

(Optional) Negates the specified match result.

qos-group-value

QoS group value identifier that specifies the exact value from 1 to 7. Range is not supported.

Command Default

No match criteria are specified.

Command Modes

Class map configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The match qos-group command is supported only in the egress direction. The egress default class will implicitly match qos-group 0. The minimum value is 1 and maximum value is 7. The maximum allowed entries: 7.

The match qos-group command sets the match criteria for examining QoS groups marked on the packet. One class map can match only one qos-group value from 1 to 7. The qos-group values 1 to 7 maps to queue 1 to 7 on the egress port. Queue 0 is reserved for class-default.

The QoS group value is used as a matching criterion only. The value has no mathematical significance. For instance, the QoS group value 2 is not greater than 1. The value simply indicates that a packet marked with the QoS group value of 2 should be treated differently than a packet marked with a QoS group value of 1. The treatment of these different packets is defined using the service-policy command in policy map class configuration mode.

The QoS group setting is limited in scope to the local router. Typically, the QoS group is set on the local router to be used locally and the router to give differing levels of service based on the group identifier.

In the ingress policy-map, in order to designate the traffic class to a certain CoSQ other than CoSQ 0, the class-map needs to have an explicit set qos-group x statement, where 'x' is the CoSQ in the range of 0 to 7. The default COSQ is 0. In the egress policy-map, a class-map with a corresponding match qos-group x will allow further Quality of Service actions to be applied to the traffic class. For example,

class-map prec1
  match prec 1
 
policy-map test-ingress
  class prec1
    set qos-group 1
    police rate percent 50
 
 
class-map qg1
  match qos-group 1
 
 
policy-map test-egress
  class qg1
    shape average percent 70

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows a service policy called policy1 attached to an HundredGigabit Ethernet interface 0/1/0/9.


RP/0/(config)# class-map qosgroup5
RP/0/(config-cmap)# match qos-group 5
RP/0/(config-cmap)# exit

RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class qosgroup5
RP/0/(config-pmap-c)# bandwidth 1000 mbps
RP/0/(config-pmap-c)# exit
RP/0/(config-pmap)# exit

RP/0/(config)# interface HundredGigabitEthernet  0/1/0/9
RP/0/(config-if)# service-policy output  policy1

random-detect discard-class

To configure the Weighted Random Early Detection (WRED) thresholds for packets with a specific discard class value, use the random-detect discard-class command in policy map class configuration mode. To return the thresholds to the default for the discard class, use the no form of this command.

random-detect discard-class discard-value min-threshold [units] max-threshold [units]

no random-detect discard-class discard-value min-threshold [units] max-threshold [units]

Syntax Description

discard-value

Discard class value. The value is 0 or 1.

min-threshold

Minimum threshold in number of packets. The value range of this argument is from 0 to 1073741823 in bytes.

max-threshold

Maximum threshold in number of packets. The value range of this argument is from the value of the min-threshold argument to 1073741823. When the average queue length exceeds the maximum threshold, WRED drops all packets with the specified discard class value.

units

(Optional) Units for the threshold values.

Command Default

Default unit for max-threshold and min-threshold is packets .

Command Modes

Policy map class configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

WRED is a congestion avoidance mechanism that slows traffic by randomly dropping packets when congestion exists. WRED is most useful with protocols like TCP that respond to dropped packets by decreasing the transmission rate.

When you configure the random-detect discard-class command on an interface, packets are given preferential treatment based on the discard class of the packet.

When the value of the units argument is packets, packets are assumed to be 256 bytes in size.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to set the discard class values for discard class 1 to a minimum byte threshold of 1000000 and a maximum byte threshold of 2000000:


RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class class1
RP/0/(config-pmap-c)# random-detect discard-class 1 1000000 bytes 2000000 bytes
  

set mpls experimental

To set the experimental (EXP) value of the Multiprotocol Label Switching (MPLS) packet topmost or imposition labels, use the set mpls experimental command in policy map configuration mode. To leave the EXP value unchanged, use the no form of this command.

set mpls experimental {topmost} exp-value

no set mpls experimental {topmost} exp-value

Syntax Description

topmost

Specifies to set the EXP value of the topmost label.

exp-value

Value of the MPLS packet label. Range is 0 to 7.

Command Default

No MPLS experimental value is set

Command Modes

Policy map class configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

After the MPLS experimental bits are set, other QoS services can then operate on the bit settings.

This command is supported only in ingress direction. Unconditional MPLS experimental marking is supported.

The network gives priority (or some type of expedited handling) to the marked traffic. Typically, the MPLS experimental value is set at the edge of the network (or administrative domain) and queueing is acted on it thereafter.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to set the MPLS experimental to 5:




RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class class1
RP/0/(config-pmap-c)# set mpls experimental topmost 5
RP/0/(config-pmap-c)# exit
RP/0/(config-pmap)# exit

RP/0/(config)# interface HundredGigE 0/1/0/0
RP/0/(config-if)# service-policy input policy1
  

shape average

To shape traffic to the indicated bit rate according to the algorithm specified, use the shape average command in policy map class configuration mode. To remove traffic shaping, use the no form of this command.

shape average {percent percentage | rate [units] }

no shape average

Syntax Description

percent percentage

Specifies the interface bandwidth in percentage. Values can be from 1 to 100.

rate

Average shaping rate in the specified units. Values can be from 1 to 4294967295.

units

(Optional) Units for the bandwidth.

Command Default

units: bps

Command Modes

Policy map class configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The shape average command is supported only in the egress direction.

When you use the shape average command, egress shaping is done at the Layer 1 level and includes the Layer 1 header in the rate calculation. The minimum shape rate is 469 kbps. If you have both shape and bandwidth configured for a class, ensure that the shape percent value is always greater than the percent value for bandwidth. For bundled interfaces, shape average can be configured only as a percentage.

The priority and shape average commands can be configured together in the same class.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to set traffic shaping to 100000 kbps:


RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class class1
RP/0/(config-pmap-c)# shape average 100000 kbps