QoS Classification Commands

This chapter describes the commands used for QoS packet classification.

class (policy-map)

To specify the name of the class whose policy you want to create or change, use the class command in policy map configuration mode. To remove a class from the policy map, use the no form of this command.

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

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

Syntax Description

type qos

(Optional) Specifies a quality-of-service (QoS) class.

class-name

Name of the class for which you want to configure or modify policy.

class-default

Configures the default class.

Command Default

No class is specified.

Type is QoS when not specified.

Command Modes

Policy map configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

Within a policy map, the class (policy-map) command can be used to specify the name of the class whose policy you want to create or change. The policy map must be identified first.

To identify the policy map (and enter the required policy map configuration mode), use the policy-map command before you use the class (policy-map) command. After you specify a policy map, you can configure the policy for new classes or modify the policy for any existing classes in that policy map.

The class name that you specify in the policy map ties the characteristics for that class—that is, its policy—to the class map and its match criteria, as configured using the class-map command.

The Single-Rate Two-Color (SR2C) in color-blind mode for confirm and exceed actions are supported in ingress direction.


Note

It is mandatory to configure all the 8 qos-group classes (including class-default) for the egress policies in the Cisco NCS 5000 Series Routers.


The class-default keyword is used for configuring default classes. It is a reserved name and cannot be used with user-defined classes. It is always added to the policy map (type qos) even if the class is not configured. For example, the following configuration shows that the class has not been configured, but the running configuration shows ‘class class-default’.

RP/0/RP0/CPU0:router(config)# policy-map pm1 
RP/0/RP0/CPU0:router(config-pmap)# end-policy-map 
RP/0/RP0/CPU0:router(config)# end 
!
RP/0/RP0/CPU0:router# show running-config 
!
policy-map pm1
 class class-default
 !        
 end-policy-map
!
  

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to create a policy map called policy-in which is defined to policer class1 traffic at 30 percent and default class traffic at 20 percent.

RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match precedence 3
RP/0/RP0/CPU0:router(config-cmap)#  exit

RP/0/RP0/CPU0:router(config)# policy-map policy-in
RP/0/RP0/CPU0:router(config-pmap)# class class1...
RP/0/RP0/CPU0:routerconfig-pmap-c)# police rate percent 30
RP/0/RP0/CPU0:router(config-pmap-c-police)# exit
RP/0/RP0/CPU0:router(config-pmap-c)# exit

RP/0/RP0/CPU0:router(config-pmap)# class class-default
RP/0/RP0/CPU0:router(config-pmap-c)# police rate percent 20

The default class is used for packets that do not satisfy configured match criteria for class1. Class1 must be defined before it can be used in policy1, but the default class can be directly used in a policy map, as the system defines it implicitly.

class-map

To define a traffic class and the associated rules that match packets to the class, use the class-map command in XR Config mode. To remove an existing class map from the router, use the no form of this command.

class-map [type [traffic | qos]] [match-all] [match-any] class-map-name

no class-map [type [traffic | qos]] [match-all] [match-any] class-map-name

Syntax Description

type qos

(Optional) Specifies a quality-of-service (QoS) class-map.

traffic

(Optional) Specifies traffic type class-map.

match-all

(Optional) Specifies a match on all of the match criteria.

match-any

(Optional) Specifies a match on any of the match criteria. This is the default.

class-map-name

Name of the class for the class map. The class name is used for the class map and to configure policy for the class in the policy map. The class name can be a maximum of 63 characters, must start with an alphanumeric character, and in addition to alphanumeric characters, can contain any of the following characters: . _ @ $ % + | # : ; - =

Command Default

Type is QoS when not specified.

Command Modes

XR Config mode

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

The class-map command specifies the name of the class for which you want to create or modify class map match criteria. Use of this command enables class map configuration mode in which you can enter any match command to configure the match criteria for this class. Packets arriving on the interface are checked against the match criteria configured for a class map to determine if the packet belongs to that class.


Note

It is mandatory to configure all the 8 qos-group classes (including class-default) for the egress policies in Cisco NCS 5001 and Cisco NCS 5002 Routers. One class-map can match only one qos-group.


These commands can be used in a class map match criteria for the ingress direction:

  • match access-group
  • match [not] cos
  • match [not] dscp
  • match [not] mpls experimental topmost
  • match [not] precedence
  • match precedence
  • match [not] protocol
The command used in a class map match criteria for the egress direction:
  • match [not] qos-group

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to specify class1 as the name of a class and defines a class map for this class. The packets that match the access list 1 are matched to class class1.


RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match access-group ipv4 1

conform-action

To configure the action to take on packets that conform to the rate limit, use the conform-action command in policy map police configuration mode. To remove a conform action from the policy-map, use the no form of this command.

conform-action [drop | set options | transmit]

no conform-action [drop | set options | transmit]

Syntax Description

drop

(Optional) Drops the packet.

set options

(Optional) Configures the specified packet properties. Replace options with one of the following keywords or keyword arguments:

  • cos value —Sets the class of service value. Range is 0 to 7.
  • dscp value —Sets the differentiated services code point (DSCP) value and sends the packet. Range is 0 to 63.
  • qos-group value —Sets the QoS group value. Range is 1 to 7.

transmit

(Optional) Transmits the packets.

Command Default

By default, if no action is configured on a packet that conforms to the rate limit, the packet is transmitted.

Command Modes

Policy map police configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

For more information regarding the traffic policing feature, see the police rate command.

At least two set of actions for each policer action can be configured by using the conform-action command.

Task ID

Task ID

Operations

qos

read, write

Examples

In this example of MPLS, traffic policing is configured to set DSCP bits for packets that conform to the rate limit:


RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match mpls experimental topmost 1
RP/0/RP0/CPU0:router(config-cmap)# exit

RP/0/RP0/CPU0:router(config)# policy-map policy-in
RP/0/RP0/CPU0:router(config-pmap)# class class1
RP/0/RP0/CPU0:router(config-pmap-c)# police rate 100 mbps burst 2 kbytes 
RP/0/RP0/CPU0:router(config-pmap-c-police)# conform-action set dscp 1
RP/0/RP0/CPU0:router(config-pmap-c-police)# conform-action set qos-group 1
RP/0/RP0/CPU0:router(config-pmap-c-police)# exit
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit

RP/0/RP0/CPU0:router(config)# interface TenGigE 0/1/0/9
RP/0/RP0/CPU0:router(config-if) service-policy input policy-in

end-class-map

To end the configuration of match criteria for the class and to exit class map configuration mode, use the end-class-map command in class map configuration mode.

end-class-map

Syntax Description

This command has no keywords or arguments.

Command Default

No default behavior or values

Command Modes

Class map configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to end the class map configuration and exit class map configuration mode:


RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match access-group ipv4 1
RP/0/RP0/CPU0:router(config-cmap)# end-class-map 

end-policy-map

To end the configuration of a policy map and to exit policy map configuration mode, use the end-policy-map command in policy map configuration mode.

end-policy-map

Syntax Description

This command has no keywords or arguments.

Command Default

No default behavior or values

Command Modes

Policy map configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to end the policy map configuration and exit policy map configuration mode.


RP/0/RP0/CPU0:router(config)# policy-map policy1
RP/0/RP0/CPU0:router(config-pmap)# class class1
RP/0/RP0/CPU0:router(config-pmap-c)# police rate 250
...
...
RP/0/RP0/CPU0:router(config-pmap)# class class7
...
...
RP/0/RP0/CPU0:router(config-pmap)# end-policy-map 

exceed-action

To configure the action to take on packets that exceed the rate limit, use the exceed-action command in policy map police configuration mode. To remove an exceed action from the policy-map, use the no form of this command.

exceed-action [drop | set options | transmit]

no exceed-action [drop | set options | transmit]

Syntax Description

drop

(Optional) Drops the packet.

set options

Configures the specified packet properties. Replace options with one of the following keywords or keyword arguments:

  • cos value —Sets the class of service value. Range is 0 to 7.
  • dscp value —Sets the differentiated services code point (DSCP) value and sends the packet. Range is 0 to 63.
  • qos-group value —Sets the QoS group value. Range is 1 to 7.

transmit

(Optional) Transmits the packets.

Command Default

By default, if no action is configured on a packet that exceeds the rate limit, the packet is dropped.

Command Modes

Policy map police configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

For more information regarding the traffic policing feature, see the police rate command.

At least two set of actions for each policer action can be configured by using the exceed-action command.

Task ID

Task ID

Operations

qos

read, write

Examples

In this example for MPLS, traffic policing is configured to drop traffic for interface TenGigE 0/7/0/0 that exceeds the rate limit:


RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match mpls experimental topmost 0
RP/0/RP0/CPU0:router(config-cmap)# exit

RP/0/RP0/CPU0:router(config)# policy-map policy1
RP/0/RP0/CPU0:router(config-pmap)# class class1...
RP/0/RP0/CPU0:router(config-pmap-c)# police rate 250 kbps burst 50
RP/0/RP0/CPU0:router(config-pmap-c-police)# exceed-action drop
RP/0/RP0/CPU0:router(config-pmap-c-police)# exit
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit

RP/0/RP0/CPU0:router(config)# interface TenGigE 0/7/0/0
RP/0/RP0/CPU0:router(config-if) service-policy input policy1

match access-group

To identify a specified access control list (ACL) number as the match criteria for a class map, use the match access-group command in class map configuration mode.

match access-group {ipv4 | ipv6} access-group-name

Syntax Description

ipv4

Specifies the name of the IPv4 access group to be matched.

ipv6

Specifies the name of the IPv6 access group to be matched.

access-group-name

ACL whose contents are used as the match criteria against which packets are checked to determine if they belong to this class.

Command Default

By default, if neither IPv6 nor IPv4 is specified as the match criteria for a class map, IPv4 addressing is used.

Command Modes

Class map configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

For class-based features (such as marking and policing), you define traffic classes based on match criteria, including ACLs and input interfaces. Packets satisfying the match criteria for a class constitute the traffic for that class.

The match access-group command specifies an ACL whose contents are used as the match criteria against which packets are checked to determine if they belong to the class specified by the class map.

The match access-group command is supported only in the ingress direction.

The match criteria which is not supported on match access-group is match on ttl.

Access Control Entries with TCP fields such as, SYN, ACK and FIN in the corresponding ACL are not supported.

To use the match access-group command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. You can specify up to eight IPv4 and IPv6 ACLs in a match statement.

QoS classification based on the packet length or TTL (time to live) field in the IPv4 and IPv6 headers is not supported.

When an ACL list is used within a class-map, the deny action of the ACL is ignored and the traffic is classified based on the specified ACL match parameters.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to specify a class map called map1 and configures map1 to be used as the match criteria for this class:


RP/0/RP0/CPU0:router(config)# class-map map1
RP/0/RP0/CPU0:router(config-cmap)# match access-group ipv4 map1
RP/0/RP0/CPU0:router(config-cmap)# match access-group ipv6 map2

match cos

To identify specified class of service (CoS) values as a match criteria in a class map, use the match cos command in class map configuration mode. To remove a specified CoS class value from the matching criteria for a class map, use the no form of this command.

match [not] cos {cos-value [cos-value1 . . . cos-value7]}

no match [not] cos {cos-value [cos-value1 . . . cos-value7]}

Syntax Description

not

(Optional) Negates the specified match result.

cos-value

Identifier that specifies the exact value from 0 to 7. Up to eight CoS identifiers can be specified to match packets.

Command Default

No match criteria are specified.

Command Modes

Class map configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

The match cos command is supported only in the ingress direction.

The match cos command specifies a class of service 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 cos 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 cos command in a class map, the values of subsequent match statements are added to the first match cos command.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to configure the service policy called policy-in and attach service policy policy-in to an interface TenGigE 0/7/0/0. In this example, class map cos146 evaluates all packets of service values of 1, 4, or 6. If the incoming packet has been marked with any of these CoS values, the traffic is policed at 300 mbps.


RP/0/RP0/CPU0:router(config)# class-map cos146
RP/0/RP0/CPU0:router(config-cmap)# match cos 1 4 6
RP/0/RP0/CPU0:router(config-cmap)# exit

RP/0/RP0/CPU0:router(config)# policy-map policy-in
RP/0/RP0/CPU0:router(config-pmap)# class cos146
RP/0/RP0/CPU0:router(config-pmap-c)# police rate 300 mbps
RP/0/RP0/CPU0:router(config-pmap-police)#exit
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit

RP/0/RP0/CPU0:router(config)# interface TenGigE 0/7/0/0
RP/0/RP0/CPU0:router(config-if)# service-policy input policy-in

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 eight IP DSCP values can be specified to match packets. Reserved keywords can be specified instead of numeric values. Table 1 describes the reserved keywords.

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

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 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 policy-in and attach service policy policy-in to an interface TenGigE 0/7/0/0. 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 traffic is policed at 300 mbps.


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

RP/0/RP0/CPU0:router(config)# policy-map policy-in
RP/0/RP0/CPU0:router(config-pmap)# class dscp14
RP/0/RP0/CPU0:router(config-pmap-c)#police rate 300 mbps
RP/0/RP0/CPU0:router(config-pmap-c-police)#exit
RP/0/RP0/CPU0:router(config-pmap-c)#exit
RP/0/RP0/CPU0:router(config-pmap)#exit

RP/0/RP0/CPU0:router(config)# interface TenGigE 0/7/0/0
RP/0/RP0/CPU0:router(config-if)# service-policy input policy-in

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

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 policy-in and attach service policy policy-in to an interface. In this example, class map mplsmap1 evaluates all packets entering TenGigabit Ethernet interface 0/1/0/9 for an MPLS experimental value of 1. If the incoming packet has been marked with the MPLS experimental value of 1, the traffic is policed at 300 mbps.


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

RP/0/RP0/CPU0:router(config)# policy-map policy-in
RP/0/RP0/CPU0:router(config-pmap)# class mplsmap1
RP/0/RP0/CPU0:router(config-pmap-c)# police rate 300 mbps
RP/0/RP0/CPU0:router(config-pmap-police)#exit
RP/0/RP0/CPU0:router(config-pmap-c)#exit
RP/0/RP0/CPU0:router(config-pmap)#exit

RP/0/RP0/CPU0:router(config)# interface TenGigabitEthernet  0/1/0/9
RP/0/RP0/CPU0:router(config-if)# service-policy input  policy-in
  

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. Table 1 describes the reserved keywords.

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

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 policy-in and attach service policy policy-in to an interface. In this example, class map ipprec5 evaluates all packets entering TenGigabit 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 traffic is policed at 300 mbps.


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

RP/0/RP0/CPU0:router(config)# policy-map policy-in
RP/0/RP0/CPU0:router(config-pmap)# class ipprec5
RP/0/RP0/CPU0:router(config-pmap-c)# police rate 300 mbps
RP/0/RP0/CPU0:router(config-pmap-c-police)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit

RP/0/RP0/CPU0:router(config)# interface TenGigabitEthernet  0/1/0/9
RP/0/RP0/CPU0:router(config-if)# service-policy input policy-in
  

match protocol

To identify a specific protocol as the match criterion for a class map, use the match protocol command in class map configuration mode. To remove protocol-based match criteria from a class map, use the no form of this command.

match [not] protocol {protocol-value [protocol-value1 . . . protocol-value7] | | [min-value - max-value]}

no match [not] protocol {protocol-value [protocol-value1 . . . protocol-value7] | | [ min-value - max-value]}

Syntax Description

not

(Optional) Negates the specified match result.

protocol-value

A protocol identifier. A single value for protocol-value (any combination of numbers and names) can be matched in one match statement.

min-value

Lower limit of protocol range to match. Minimum value is 0.

max-value

Upper limit of protocol range to match. Maximum value is 255.

Command Default

No default behavior or values

Command Modes

Class map configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

The match protocol command is supported only in ingress direction.

Definitions of traffic classes are based on match criteria, including protocols, access control lists (ACLs), input interfaces, QoS labels, and experimental (EXP) field values. Packets satisfying the match criteria for a class constitute the traffic for that class.

The match protocol command specifies the name of a protocol to be used as the match criteria against which packets are checked to determine if they belong to the class specified by the class map. Available protocol names are listed in the table that follows.

The protocol-value argument supports a range of protocol numbers. After you identify the class, you may use the match protocol command to configure its match criteria.

Table 3. Protocol Names and Descriptions

Name

Description

icmp

Internet Control Message Protocol

igmp

Internet Gateway Message Protocol

ospf

Open Shortest Path First, Routing Protocol

pim

Protocol Independent Multicast

tcp

Transport Control Protocol

udp

User Datagram Protocol

Task ID

Task ID

Operations

qos

read, write

Examples

In this example, all TCP packets belong to class class 1:


RP/0/RP0/CPU0:router(config)# class-map class 1
RP/0/RP0/CPU0:router(config-cmap)# match protocol tcp
  

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.

match [not] qos-group [qos-group-value 1 . . . qos-group-value7]

no match [not] qos-group

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 or a range of values from 1 to 7. Up to eight values can be entered in one match statement.

Command Default

No match criteria are specified.

Command Modes

Class map configuration

Command History

Release

Modification

Release 6.0

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.


Note

The egress policy should contain 7 match qos-group classes and a class-default to map to 8 data-traffic queues for the egress port.


Task ID

Task ID

Operations

qos

read, write

Examples

This example shows a service policy called policy-out attached to an TenGigabit Ethernet interface 0/1/0/9 . In this example, class map qosgroup5 will evaluate all packets leaving TenGigabit Ethernet interface 0/1/0/9 for a QoS group value of 5. If the packet has been marked with the QoS group value of 5, the traffic shaping is at 1 gbps.


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

RP/0/RP0/CPU0:router(config)#  policy-map policy-out
RP/0/RP0/CPU0:router(config-pmap)# class qosgroup5
RP/0/RP0/CPU0:router(config-pmap-c)# shape average 1 gbps
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit

RP/0/RP0/CPU0:router(config)# interface TenGigabitEthernet  0/1/0/9
RP/0/RP0/CPU0:router(config-if)# service-policy output  policy-out

The above example is for egress, the user has to configure all the 8 classes.

service-policy

To attach a policy map to an input interface or output interface to be used as the service policy for that interface, use the service-policy command in the appropriate configuration mode. To remove a service policy from an input or output interface, use the no form of the command.

service-policy {input | output} policy-map

no service-policy {input | output} policy-map

Syntax Description

input

Attaches the specified policy map to the input interface.

output

Attaches the specified policy map to the output interface.

policy-map

Name of a service policy map (created using the policy-map command) to be attached.

Command Default

No service policy is specified.

Command Modes

Interface configuration.

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

You can attach a single policy map to one or more interfaces to specify the service policy for those interfaces. The class policies composing the policy map are then applied to packets that satisfy the class map match criteria for the class. To apply a new policy to an interface, you must remove the previous policy. A new policy cannot replace an existing policy.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows policy map policy-in applied to Bundle-Ether interfaces 1 and 2.

RP/0/RP0/CPU0:router(config)#interface Bundle-Ether 1
RP/0/RP0/CPU0:router(config-if)#service-policy input policy-in
RP/0/RP0/CPU0:router(config-if)#exit

RP/0/RP0/CPU0:router(config)# interface Bundle-Ether 2
RP/0/RP0/CPU0:router(config-if)# service-policy output policy-out
  

set cos (outer)

To set the Layer 2 class of service (CoS) value of an outgoing packet, use the set cos command in policy map class configuration mode. To remove a specific CoS value setting, use the no form of this command.

set cos cos-value

no set cos cos-value

Syntax Description

cos-value

Specific IEEE 802.1Q CoS value from 0 to 7.

Command Default

No Layer 2 CoS value of an outgoing packet is set.

Command Modes

Policy map class configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

Use the set cos command to mark a packet that is being sent to a switch. Switches can leverage Layer 2 header information, including a CoS value marking.

The set cos command is supported only in the ingress direction. Both conditional and unconditional outer COS marking is supported.

Task ID

Task ID

Operations

qos

read, write

Examples

In this example, the policy map called cos-set is created to assign different CoS values for different service classes, and then is attached to the output TenGigE interface 0/1/0/9


RP/0/RP0/CPU0:router(config)# policy-map cos-set
RP/0/RP0/CPU0:router(config-pmap)# class class1...
RP/0/RP0/CPU0:router(config-pmap-c)# set cos 1
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# class class2...
RP/0/RP0/CPU0:router(config-pmap-c)# set cos 2
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit
RP/0/RP0/CPU0:router(config)# interface TenGigE 0/1/0/9
RP/0/RP0/CPU0:router(config-if)# service-policy input cos-set
  

set dscp

To mark a packet by setting the IP differentiated services code point (DSCP) in the type of service (ToS) byte, use the set dscp command in policy-map class configuration mode. To remove a previously set DSCP value, use the no form of this command.

set dscp dscp-value

no set dscp dscp-value

Syntax Description

dscp-value

Number from 0 to 63 that sets the DSCP value. Reserved keywords can be specified instead of numeric values. Table 1 describes the reserved keywords.

Command Default

No default behavior or values

Command Modes

Policy map class configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

After the DSCP bit is set, other quality-of-service (QoS) services can then operate on the bit settings. The set dscp is supported only in the ingress direction.

Both conditional and unconditional dscp marking is supported.

The network gives priority (or some type of expedited handling) to marked traffic. Typically, you set the DSCP value at the edge of the network (or administrative domain); data then is queued based on the DSCP value.

Task ID

Task ID

Operations

qos

read, write

Examples

In this example, the DSCP ToS byte is set to 6 in the policy map called policy-in. All packets that satisfy the match criteria of class1 are marked with the DSCP value of 6. The network configuration determines how packets are marked.


RP/0/RP0/CPU0:router (config)# policy-map policy-in 
RP/0/RP0/CPU0:router(config-pmap)# class class1...
RP/0/RP0/CPU0:router(config-pmap-c)# set dscp 6
  

set qos-group

To set the quality of service (QoS) group identifiers on packets, use the set qos-group command in policy map class configuration mode. To leave the QoS group values unchanged, use the no form of this command.

set qos-group qos-group-value

no set qos-group qos-group-value

Syntax Description

qos-group-value

QoS group ID. An integer from 1 to 7, to be marked on the packet.

Command Default

No group ID is specified.

Command Modes

Policy map class configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

The set qos-group command is supported only in the ingress direction.

The set qos-group is used to group incoming traffic and then to classify and remark packets on the egress interface

The set qos-group action overrides the default marking section.

Task ID

Task ID

Operations

qos

read, write

Examples

This example sets the QoS group to 5 for packets that match the MPLS experimental bit 1:


RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match mpls experimental topmost 1
RP/0/RP0/CPU0:router(config-cmap)# exit

RP/0/RP0/CPU0:router(config)# policy-map policy-in
RP/0/RP0/CPU0:router(config-pmap)# class class1...
RP/0/RP0/CPU0:router(config-pmap-c)# set qos-group 5
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit

RP/0/RP0/CPU0:router(config)# interface TenGigE 0/1/0/9
RP/0/RP0/CPU0:router(config-if)# service-policy input policy-in
  

Examples

This example sets the qos-group value to 5:



RP/0/RP0/CPU0:router(config)# policy-map policy-in
RP/0/RP0/CPU0:router(config-pmap)# class class1...
RP/0/RP0/CPU0:router(config-pmap-c)# set qos-group 5
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit

  

show qos summary

To view the QoS summary, use the show qos summary command in XR EXEC mode.

show qos summary {police {interface type instance | location node-location} | policy policy-name {interface type instance | location node-location} | queue {interface type instance | location node-location}} {input | output} [ location node-location ]

Syntax Description

police

Show policer interface statistics.

policy policy-name

String to identify the policy.

queue

Show queue statistics.

interface type instance

Interface type and instance. For more information, use the question mark (?) online help function .

location node-location

Identifies fully qualified location specification.

input

Shows the specified policy map to the input interface.

output

Shows the specified policy map to the output interface.

Command Default

None

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows the results of the qos summary queue of interface TEnGigE 0/0/0/9:

RP/0/RP0/CPU0:router# show qos summary queue interface TEnGigE 0/0/0/9 output
Wed Nov 25 12:13:21.769 UTC
Legend:
=======
1. Queue ID is displayed in HEX.
2. A '*' against Queue ID means class does not own the queue.
3. Length, Transmit and Drop are the queue statistics.

Policy:Class                       QueueID        Length    Transmit        Drop     Idle_ts
TenGigE0/0/0/9
qos                                                                   
 :qos1                            51                  0           0           0       00:00:00
qos                                                                   
 :qos2                            52                  0           0           0       00:00:00
qos                                                                   
 :qos3                            53                  0           0           0       00:00:00
qos                                                                   
 :qos4                            54                  0           0           0       00:00:00
qos                                                                   
 :qos5                            55                  0           0           0       00:00:00
qos                                                                   
 :qos6                            56                  0           0           0       00:00:00
qos                                                                   
 :qos7                            57                  0           0           0       00:00:00
qos                                                                   
 :class-default                   50                  0           0           0       00:00:00

  

This example shows policer interface statistics of interface TenGigE 0/0/0/5 :


RP/0/RP0/CPU0:router#  show qos summary police interface TenGigE 0/0/0/5 input
Wed Nov 25 12:10:06.521 UTC
Legend:
=======
1. Policer ID is displayed in HEX.
2. A '*' against the counter means the action is drop.
3. Conform displays match counter for non-policer leaf.

Policy:Class                       PoliceID     Conform      Exceed     Violate
TenGigE0/0/0/5
policer                                                               
 :class-default                      106         1456         1657*          0*
RP/0/RP0/CPU0:ios#
RP/0/RP0/CPU0:ios#show run policy-map policer 
Wed Nov 25 12:10:20.603 UTC
policy-map policer
 class class-default
  police rate 1 gbps burst 200 kbytes 
  ! 
 ! 
 end-policy-map
!