Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco
NCS 540 Series Routers
First Published: 2015-12-23
Last Modified: 2018-08-01
Americas Headquarters
Cisco Systems, Inc.
170 West Tasman Drive
San Jose, CA 95134-1706
USA
http://www.cisco.com
Tel: 408 526-4000
800 553-NETS (6387)
Fax: 408 527-0883
THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS,
INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS.
THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH
THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY,
CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY.
NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS" WITH ALL FAULTS.
CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE.
IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT
LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network
topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional
and coincidental.
All printed copies and duplicate soft copies of this document are considered uncontrolled. See the current online version for the latest version.
Cisco has more than 200 offices worldwide. Addresses and phone numbers are listed on the Cisco website at www.cisco.com/go/offices.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com
go trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
iv
Preface
This preface contains these sections:
• Changes to This Document, on page v
• Obtaining Documentation and Submitting a Service Request, on page v
Changes to This Document
This table lists the technical changes made to this document since it was first released.
Table 1: Changes to This Document
SummaryDate
Initial release of this document.December 2015
July 2016
November 2016
May 2017
Republished with documentation updates for Cisco
IOS XR Release 6.0.2 features.
Republished with documentation updates for Cisco
IOS XR Release 6.1.x features
Republished with documentation updates for Cisco
IOS XR Release 6.1.31 features
Republished for Release 6.3.2.March 2018
Republished for Release 6.5.1.July 2018
Obtaining Documentation and Submitting a Service Request
For information on obtaining documentation, using the Cisco Bug Search Tool (BST), submitting a service
request, and gathering additional information, see What's New in Cisco Product Documentation.
To receive new and revised Cisco technical content directly to your desktop, you can subscribe to the What's
New in Cisco Product Documentation RSS feed. RSS feeds are a free service.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
v
Obtaining Documentation and Submitting a Service Request
Preface
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
vi
QoS Classification Commands
Note
All commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 540
Series Router that is introduced from Cisco IOS XR Release 6.3.2. References to earlier releases in Command
History tables apply to only the Cisco NCS 5500 Series Router.
This chapter describes the commands used for QoS packet classification.
• class (policy-map), on page 2
• class-map, on page 4
• end-class-map, on page 6
• end-policy-map, on page 7
• hw-module profile qos ingress-model peering, on page 8
• hw-module profile qos max-classmap-size, on page 9
• hw-module profile stats qos-enhanced, on page 10
• match access-group, on page 11
• match cos, on page 13
• match dei, on page 15
• match dscp, on page 16
• match mpls experimental topmost, on page 19
• match precedence, on page 21
• match protocol, on page 23
• match qos-group, on page 25
• random-detect discard-class, on page 27
• set cos , on page 29
• set dei, on page 30
• set discard-class, on page 31
• set dscp, on page 33
• set mpls experimental, on page 34
• set precedence, on page 35
• set qos-group, on page 37
• shape average, on page 39
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
1
class (policy-map)
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}
QoS Classification Commands
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
(Optional) Specifies a quality-of-service (QoS) class.type qos
class-name
Name of the class for which you want to configure or modify policy.
Configures the default class.class-default
No class is specified.
Type is QoS when not specified.
Policy map configuration
ModificationRelease
This command was introduced.Release 6.0
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 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 pm2
RP/0/RP0/CPU0:router(config-pmap)# class p2
RP/0/RP0/CPU0:router(config-pmap-c)# set precedence 3
RP/0/RP0/CPU0:router(config-pmap-c)# end-policy-map
RP/0/RP0/CPU0:router(config)# commit
RP/0/RP0/CPU0:router(config)# end
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
2
QoS Classification Commands
RP/0/RP0/CPU0:router# show run policy-map pm2
policy-map pm2
class p2
set precedence 3
!
class class-default
!
end-policy-map
!
class (policy-map)
Task ID
Examples
OperationsTask
ID
qos
read,
write
This example shows how to create a policy map called policy1, which is defined to shape 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 policy1
RP/0/RP0/CPU0:router(config-pmap)# class class1
RP/0/RP0/CPU0:routerconfig-pmap-c)# shape average percent 30
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)# shape average 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.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
3
class-map
class-map
QoS Classification Commands
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.
(Optional) Specifies a quality-of-service (QoS) class-map.type qos
(Optional) Specifies traffic type class-map.traffic
(Optional) Specifies a match on all of the match criteria.match-all
(Optional) Specifies a match on any of the match criteria. This is the default.match-any
class-map-name
Type is QoS when not specified.
XR Config mode
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.
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: . _ @ $ % + | # : ; - =
ModificationRelease
This command was introduced.Release 6.0
These commands can be used in a class map match criteria for the ingress direction:
• match access-group
• match [not] dscp
• match [not] mpls experimental topmost
• match [not] precedence
• match [not] protocol
Task ID
ID
qos
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
4
OperationsTask
read,
write
QoS Classification Commands
class-map
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
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
5
end-class-map
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
QoS Classification Commands
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Examples
This command has no keywords or arguments.
No default behavior or values
Class map configuration
ModificationRelease
This command was introduced.Release 6.0
No specific guidelines impact the use of this command.
OperationsTask
ID
qos
read,
write
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
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
6
QoS Classification Commands
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
end-policy-map
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Examples
This command has no keywords or arguments.
No default behavior or values
Policy map configuration
ModificationRelease
This command was introduced.Release 6.0
No specific guidelines impact the use of this command.
OperationsTask
ID
qos
read,
write
This example shows how to end the policy map configuration and exit policy map configuration
mode.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
7
hw-module profile qos ingress-model peering
hw-module profile qos ingress-model peering
To enable the peering QoS profile feature, use the hw-module profile qos ingress-model peering command
in the XR Config mode. To disable this feature, use the no form of this command.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
8
QoS Classification Commands
hw-module profile qos max-classmap-size
To define the maximum number of class-maps per policy, use the hw-module profile qos max-classmap-size
command in the XR Config mode.
hw-module profile qos max-classmap-sizesize
hw-module profile qos max-classmap-size
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Indicates the maximum number of class-maps permitted per policy. Range is between 4 to 32, in powers
size
of 2.
Default size is 32.
XR Config mode
ModificationRelease
This command was introduced.Release
6.0.0
The router must be reloaded for the hw-module command to be functional.
This command only applies to ingress policies and only 4, 8, 16, or 32 classes per policy-map are supported.
Egress policies can support up to 8 classes per policy-map.
OperationTask
ID
qos
read,
write
The following example shows how to change the maximum number of class-maps to 16.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
9
hw-module profile stats qos-enhanced
hw-module profile stats qos-enhanced
To enable the four counter mode in the system, use the hw-module profile stats qos-enhancedcommand in
XR Config mode. To disable this mode, use the no form of the command. In the four counter mode, statistics
for conform, violate, and exceed packets are collected in the hardware and displayed using the show policy-map
command.
hw-module profile stats qos-enhanced
QoS Classification Commands
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
This command has no keywords or arguments.
The qos-enhanced mode is disabled by default, and therefore only the conform and violate statistics are
available in the two counter mode.
XR Config mode
ModificationRelease
This command was introduced.Release
6.2.1
The router must be reloaded for the hw-module command to be functional.
OperationTask
ID
qos
read,
write
The following example shows how to enable the four counter mode on the router.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
10
QoS Classification Commands
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
match access-group
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Specifies the name of the IPv4 access group to be matched.ipv4
Specifies the name of the IPv6 access group to be matched.ipv6
access-group-name
By default, if neither IPv6 nor IPv4 is specified as the match criteria for a class map, IPv4 addressing is used.
Class map configuration
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 maximum allowed entries:
8
ACL whose contents are used as the match criteria against which packets are checked
to determine if they belong to this class.
ModificationRelease
This command was introduced.Release 6.0
Task ID
Examples
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.
OperationsTask
ID
qos
This example shows how to specify a class map called map1 and configures map1 to be used as the
match criteria for this class:
read,
write
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
11
match access-group
QoS Classification Commands
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
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
12
QoS Classification Commands
match cos
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 cos {cos-value [cos-value1 ... cos-value7]}
no match cos {cos-value [cos-value1 ... cos-value7]}
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
cos-value
Identifier that specifies the exact value from 0 to 7. Up to eight CoS identifiers can be specified
to match packets.
No match criteria are specified.
Class map configuration
ModificationRelease
This command was introduced.Release 6.1.2
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.
OperationsTask
ID
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 HundredGigE 0/0/0/3. 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
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
14
QoS Classification Commands
match dei
match dei
To specify a drop eligible indicator (DEI) value as a match criteria in a class map, use the match dei command
in class map configuration mode. To remove a specified DEI value from the matching criteria for a class map,
use the no form of this command.
match dei value
no match dei
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Examples
value
Value of the DEI bit. Can be 0 or 1.
There is no default DEI value; it must be specified.
Class map configuration
ModificationRelease
This command was introduced.Release
6.1.2
The match dei command specifies a DEI 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.
OperationTask
ID
qos
read,
write
In this example, DEI value is specified as the matching criteria in a class map.
RP/0/RP0/CPU0:router(config)# class-map match-any match-dei
RP/0/RP0/CPU0:router(config-cmap)# match dei 0
RP/0/RP0/CPU0:router(config-cmap)# exit
RP/0/RP0/CPU0:router(config)# policy-map p1
RP/0/RP0/CPU0:router(config-pmap)# class match-dei
RP/0/RP0/CPU0:router(config-pmap)# set dei 1
RP/0/RP0/CPU0:router(config-pmap-c)#exit
RP/0/RP0/CPU0:router(config)# interface HundredGigE 0/5/0/0.0 l2transport
RP/0/RP0/CPU0:router(config-subif)# encapsulation dot1q 1
RP/0/RP0/CPU0:router(config-subif)# rewrite ingress tag push dot1ad 5 symmetric
RP/0/RP0/CPU0:router(config-subif)# service-policy input p1
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
15
match dscp
match dscp
QoS Classification Commands
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
Command Default
Command Modes
Command History
Usage Guidelines
(Optional) Negates the specified match result.not
(Optional) Specifies the IPv4 DSCP value.ipv4
(Optional) Specifies the IPv6 DSCP value.ipv6
dscp-value
min-value
max-value
Matching on IP Version 4 (IPv4) and IPv6 packets is the default.
Class map configuration
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.
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. Table 2: IP DSCP Reserved Keywords, on page 17 describes the
reserved keywords.
Lower limit of DSCP range to match. Value range is 0 - 63.
Upper limit of DSCP range to match. Value range is 0 - 63.
ModificationRelease
This command was introduced.Release 6.0
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.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
16
QoS Classification Commands
Table 2: IP DSCP Reserved Keywords
match dscp
DSCP
Value
Reserved
Keyword
default0
AF1110
AF1212
AF1314
AF2118
AF2220
AF2322
AF3126
AF3228
AF3330
AF4134
AF4236
Task ID
ID
qos
AF4338
EF46
CS18
CS216
CS324
CS432
CS540
CS648
CS756
ipv4 dscpipv4
ipv6 dscpipv6
OperationsTask
read,
write
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
17
match dscp
QoS Classification Commands
Examples
This example shows how to configure the service policy called policy1 and attach service policy
policy1 to an interface HundredGigE 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 packet is queued to the class queue with the bandwidth setting of 1000 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
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
18
QoS Classification Commands
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]
match mpls experimental topmost
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
notnot
exp-value
No default behavior or values
Class map configuration
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 matchmpls 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).
Experimental value that specifies the exact value from 0 to 7. Up to eight experimental values
can be specified to match MPLS headers.
ModificationRelease
This command was introduced.Release 6.0
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
ID
qos
OperationsTask
read,
write
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
19
match mpls experimental topmost
QoS Classification Commands
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 mplsmap1 evaluates all packets entering
HundredGigabit 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 packet is queued to the class
queue with the bandwidth setting of 1000 mbps.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
20
QoS Classification Commands
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]
match precedence
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
(Optional) Negates the specified match result.not
(Optional) Specifies the IPv4 precedence value.ipv4
(Optional) Specifies the IPv6 precedence value.ipv6
precedence-value
Matching on both IP Version 4 (IPv4) and IPv6 packets is the default.
Class map configuration
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.
An IP precedence value identifier that specifies the exact value. Reserved keywords can
be specified instead of numeric values. Table 3: IP Precedence Values and Names, on
page 22 describes the reserved keywords.
Up to eight precedence values can be matched in one match statement.
ModificationRelease
This command was introduced.Release 6.0
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, matchprecedence 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.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
21
match precedence
Table 3: IP Precedence Values and Names
NameValue
routine0
priority1
immediate2
flash3
flash-override4
critical5
internet6
network7
ipv4
ipv4
precedence
QoS Classification Commands
Task ID
Examples
ipv6
ipv6
precedence
OperationsTask
ID
qos
read,
write
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.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
22
QoS Classification Commands
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.
A protocol identifier. A single value for protocol-value (any combination of numbers and
names) can be matched in one match statement.
min-value
max-value
Lower limit of protocol range to match. Minimum value is 0.
Upper limit of protocol range to match. Maximum value is 255.
No default behavior or values
Class map configuration
ModificationRelease
This command was introduced.Release 6.0
The match protocol command is supported only in ingress direction. The maximum allowed entry is 1.
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 4: Protocol Names and Descriptions
DescriptionName
Authentication Header Protocolahp
Encapsulation Security Payloadesp
Cisco Generic Routing Encapsulation Tunnelinggre
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
23
match protocol
QoS Classification Commands
DescriptionName
Internet Control Message Protocolicmp
Internet Gateway Message Protocoligmp
Cisco IGRP Routing protocoligrp
IP in IP tunnelingipinip
Any IPv4 protocolipv4
Any IPv6 protocolipv6
Any MPLS packetmpls
KA9Q NOS Compatible IP over IP Tunnelingnos
Open Shortest Path First, Routing Protocolospf
Payload Compression Protocolpcp
Task ID
Examples
Protocol Independent Multicastpim
Stream Control Transmission Protocolsctp
Transport Control Protocoltcp
User Datagram Protocoludp
OperationsTask
ID
qos
read,
write
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
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
24
QoS Classification Commands
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 thematching criteria for a class map, use the no form of this command.
matchqos-group [qos-group-value ]
no matchqos-group
match qos-group
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
qos-group-value
QoS group value identifier that specifies the exact value from 1 to 7. Range is not
supported.
No match criteria are specified.
Class map configuration
ModificationRelease
This command was introduced.Release 6.0
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 ingress
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
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
25
match qos-group
QoS Classification Commands
match qos-group 1
policy-map test-egress
class qg1
shape average percent 70
Task ID
Examples
OperationsTask
ID
qos
read,
write
This example shows a service policy called policy1 attached to an HundredGigabit Ethernet interface
0/1/0/9. In this example, class map qosgroup5 will evaluate all packets leaving HundredGigabit
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 packet is queued to the class queue with the bandwidth setting of 1000 mbps.
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
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
26
QoS Classification Commands
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.
Default unit for max-threshold and min-threshold is packets.
Policy map class configuration
Discard class value. The value is 0 or 1.
Minimum threshold in number of packets. The value range of this argument is from 0 to
1073741823 in bytes.
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.
(Optional) Units for the threshold values. Values can be:
• bytes—bytes
• gbytes—gigabytes
• kbytes—kilobytes
• mbytes —megabytes
• ms—milliseconds
• packets—packets (default)
• us—microseconds
Command History
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.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
ModificationRelease
This command was introduced.Release 6.0
27
random-detect discard-class
QoS Classification Commands
Task ID
Examples
OperationsTask
ID
qos
read,
write
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:
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
28
QoS Classification Commands
set cos
set cos
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
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Examples
cos-value
Specific IEEE 802.1Q CoS value from 0 to 7.
No Layer 2 CoS value of an outgoing packet is set.
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.1.2
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. Only unconditional COS marking in the
ingress direction is supported.
OperationsTask
ID
qos
read,
write
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 interface HundredGigE 0/0/0/3.
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)# interface HundredGigE 0/0/0/3
RP/0/RP0/CPU0:router(config-if)# service-policy input cos-set
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
29
set dei
set dei
QoS Classification Commands
To set the drop eligible indicator (DEI) value in a policy map class, use the set dei command in policy map
class configuration mode. To remove a specified DEI value from a policy map class, use the no form of this
command.
set dei value
no set dei
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Examples
Value of the DEI bit. Can be 0 or 1.
value
There is no default DEI value; it must be specified.
Policy map class configuration
ModificationRelease
This command was introduced.Release
6.1.2
The set dei command specifies a DEI value in a policy map class. For example, traffic can be policed and
the excess traffic can be marked with DEI value of 1, so that it can be preferentially dropped in the egress
interface or further downstream, when there is congestion.
OperationTask
ID
qos
read,
write
In this example, 802.1ad CoS plus DEI is derived from the incoming 802.1q CoS. Packets with a
CoS value of 0 are remarked with a DEI value of 1.
RP/0/RP0/CPU0:router(config)# class-map match-any remark-cos
RP/0/RP0/CPU0:router(config-cmap)# match cos 0
RP/0/RP0/CPU0:router(config-cmap)# exit
RP/0/RP0/CPU0:router(config)# policy-map p1
RP/0/RP0/CPU0:router(config-pmap)# class remark-cos
RP/0/RP0/CPU0:router(config-pmap-c)# set dei 1
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config)# interface HundredGigE0/5/0/0.0 l2transport
RP/0/RP0/CPU0:router(config-subif)# encapsulation dot1q 1
RP/0/RP0/CPU0:router(config-subif)# rewrite ingress tag push dot1ad 5 symmetric
RP/0/RP0/CPU0:router(config-subif)# service-policy input p1
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
30
QoS Classification Commands
set discard-class
To set the discard class and Quality of Service (QoS) group identifiers on IP Version 4 (IPv4) or Multiprotocol
Label Switching (MPLS) packets, use the set discard-class command in policy map class configuration
mode. To leave the discard-class values unchanged, use the no form of this command.
set discard-class discard-class-value
no set discard-class discard-class-value
set discard-class
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Note
discard-class-value
Discard class ID. An integer 0 to 1, to be marked on the packet.
No default behavior or values
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0
The set discard-class command associates a discard class ID with a packet. After the discard class is set,
other QoS services such as Weighted Random Early Detection (WRED) can operate on the bit settings.
Discard-class indicates the discard portion of the per hop behavior (PHB). The set discard-class command
is typically used in Pipe mode. Discard-class is required when the input PHB marking is used to classify
packets on the output interface.
The set discard-class command is supported only in the ingress direction.Unconditional discard-class
marking is supported.
The discard-class values can be used to specify the type of traffic that is dropped when there is congestion.
1. Marking of the discard class has only local significance on a node.
2. Discard class cannot be associated with a QoS profile in peering mode.
Task ID
OperationsTask
ID
qos
read,
write
Examples
This example shows how to set the discard class value to 1 for packets that match the MPLS
experimental bits 1:
RP/0/RP0/CPU0:router(config)# class-map cust1
RP/0/RP0/CPU0:router(config-cmap)# match mpls experimental topmost 1
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
32
QoS Classification Commands
set dscp
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 [tunnel] dscp-value
no set dscp [tunnel] dscp-value
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
tunnel
(Optional) Sets the DSCP on the outer IP header. This command is available on Layer 3
interfaces in the ingress direction.
dscp-value
Number from 0 to 63 that sets the DSCP value. Reserved keywords can be specified instead
of numeric values. Table 2: IP DSCP Reserved Keywords, on page 17 describes the reserved
keywords.
No default behavior or values
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0
After the DSCP bit is set, other quality-of-service (QoS) services can then operate on the bit settings. The setdscp is supported only in the ingress direction.
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.
OperationsTask
ID
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
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
33
set mpls experimental
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
QoS Classification Commands
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Specifies to set the EXP value of the topmost label.topmost
exp-value
Value of the MPLS packet label. Range is 0 to 7.
No MPLS experimental value is set
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0
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 queuing is acted on it
thereafter.
OperationsTask
ID
qos
read,
write
Examples
34
This example shows how to set the MPLS experimental to 5 for packets that match access list 101:
RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match access-group ipv4 acl101
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)# set mpls experimental topmost 5
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
QoS Classification Commands
set precedence
To set the precedence value in the IP header, use the set precedence command in policy map class
configuration mode. To leave the precedence value unchanged, use the no form of this command.
set precedence [tunnel] value
no set precedence [tunnel] value
set precedence
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
(Optional) Sets the IP precedence on the outer IP header.tunnel
value
Number or name that sets the precedence bits in the IP header. Range is from 0 to 7. Reserved
keywords can be specified instead of numeric values. Table 3: IP Precedence Values and Names,
on page 22 describes the reserved keywords.
No default behavior or values
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0
Precedence can be set using a number or corresponding name. After IP Precedence bits are set, other QoS
services can then operate on the bit settings.
The set precedence command is supported only in the ingress direction. Unconditional precedence marking
is supported.
The network gives priority (or some type of expedited handling) to the marked traffic. IP precedence can be
set at the edge of the network (or administrative domain) and have queueing act on it thereafter.
The mapping from keywords such as 0 (routine) and 1 (priority) to a precedence value is useful only in some
instances. That is, the use of the precedence bit is evolving. You can define the meaning of a precedence value
by enabling other features that use the value. In the case of high-end Internet QoS, IP precedences can be used
to establish classes of service that do not necessarily correspond numerically to better or worse handling in
the network.
Task ID
OperationsTask
ID
qos
read,
write
Examples
This example shows how to set the IP precedence to 5 (critical) for packets that match the access
control list named customer1:
RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match access-group ipv4 customer1
RP/0/RP0/CPU0:router(config-cmap)# exit
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
35
set precedence
QoS Classification Commands
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)# set precedence 5
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# exit
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
36
QoS Classification Commands
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
set qos-group
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
qos-group-value
QoS group ID. An integer from 1 to 7, to be marked on the packet.
The qos-group-value is used to select a CoSQ and eventually to a VOQ
No group ID is specified.
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0
The set qos-group command is supported only in the ingress direction.
The set qos-group will be used as internal priority to choose the queue on the egress port.
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
OperationsTask
ID
qos
read,
write
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
37
set qos-group
QoS Classification Commands
Examples
This example sets the QoS group to 5 for packets that match the MPLS experimental bit 1:
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
38
QoS Classification Commands
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
shape average
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
percent percentage
rate
units
Specifies the interface bandwidth in percentage. Values can be from 1 to 100.
Average shaping rate in the specified units. Values can be from 1 to 4294967295.
(Optional) Units for the bandwidth. Values can be:
• bps—bits per second (default)
• gbps—gigabits per second
• kbps—kilobits per second
• mbps—megabits per second
units: bps
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0
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
OperationsTask
ID
qos
read,
write
Examples
This example sets traffic shaping to 50 percent of the parent shaper rate milliseconds:
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)# shape average percent 50
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
39
shape average
QoS Classification Commands
This example shows how to set traffic shaping to 100000 kbps:
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)# shape average 100000 kbps
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
40
Congestion Management Commands
Note
All commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 540
Series Router that is introduced from Cisco IOS XR Release 6.3.2. References to earlier releases in Command
History tables apply to only the Cisco NCS 5500 Series Router.
This chapter describes the commands used to manage congestion.
• decapsulate gre, on page 42
• police rate, on page 43
• policy-map, on page 45
• priority (QoS), on page 47
• vrf-policy, on page 48
• show qos interface , on page 49
• show policy-map interface, on page 55
• show policy-map targets, on page 60
• show policy-map type pbr, on page 62
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
41
decapsulate gre
decapsulate gre
To enable decapsulation of the Generic Routing Encapsulation (GRE) packets, use the decapsulate gre
command in policy map class configuration mode. To remove a previously configured GRE decapsulation
for a class, use the no form of this command.
decapsulate gre
no decapsulate gre
Congestion Management Commands
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Examples
No default action.
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0.1
This command applies only to the incoming IPv4 packets only.
OperationsTask
ID
qos
read,
write
This example shows how to configure decapsulation of the GRE packets :
RP/0/RP0/CPU0:router(config)# policy-map type pbr gre-policy
RP/0/RP0/CPU0:router(config-pmap)# class type traffic gre-class
RP/0/RP0/CPU0:router(config-pmap-c)# decapsulate gre
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
42
Congestion Management Commands
police rate
To configure traffic policing and enter policy map police configuration mode, use the police rate command
in policy map class configuration mode. To remove traffic policing from the configuration, use the no form
of this command.
Committed information rate (CIR). Range is from 1 to 4294967295.
(Optional) Unit of measurement for the CIR. Values can be:
• bps —bits per second (default)
• gbps —gigabits per second
• kbps —kilobits per second
• mbps —megabits per second
Specifies the police rate as a percentage of the CIR. Range is from 1 to 100. See
the Usage Guidelines for information on how to use this keyword.
(Optional) Specifies the burst size in the specified burst-units . The default burst
value is 10 milliseconds of the CIR. The maximum burst value allowed is 4194304
bytes.
(Optional) Unit of measurement for the burst values. Values can be:
• bytes —bytes (default)
• gbytes —gigabytes
• kbytes —kilobytes
• mbytes —megabytes
• ms —milliseconds
• us —microseconds
• packets —packets
peak-burst peak-burst
Command Default
Command Modes
No restrictions on the flow of data are applied to any interface.
Policy map class configuration
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
(Optional) Specifies the Peak Information Rate (PIR) in the specified units.peak-rate value
(Optional) Specifies the peak burst size in the specified burst-units. The default
peak burst value is 10 milliseconds of the PIR. The maximum peak-burst value
allowed is 8388608 bytes. Also, the difference of the peak-burst value and burst
value cannot be larger than 4194304 bytes.
43
police rate
Congestion Management Commands
Command History
Usage Guidelines
ModificationRelease
This command was introduced.Release 6.0
Policer conditional set is unsupported.
Policing can be applied only in the ingress direction.
For police rate commands, interpret the percent keyword in this way:
• For a one-level policy, the percent keyword specifies the CIR as a percentage of the link rate. For
example, the command police rate percent 35 configures the CIR as 35% of the link rate.
Note
Configured values take into account the Layer 2 encapsulation applied to traffic. This applies to ingress
policing. For Ethernet transmission, the encapsulation is considered to be 14 bytes, whereas for IEEE 802.1Q,
the encapsulation is 18 bytes.
For more information, see the Committed Bursts and Excess Bursts section in the Modular QoS ConfigurationGuide for Cisco NCS 5500 Series Routers.
Note
A police rate minimum of 21 kbps is supported.
Task ID
OperationsTask
ID
qos
read,
write
In this example for MPLS, traffic policing is configured with the average rate at 250 kbps, and the
normal burst size at 50 bytes for all packets leaving HundredGigE interface 0/1/0/0:
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
44
Congestion Management Commands
policy-map
To create or modify a policy map that can be attached to one or more interfaces to specify a service policy,
use the policy-map command in XR Config mode. To delete a policy map, use the no form of this command.
policy-map [type qos] policy-name
no policy-map [type qos] policy-name
policy-map
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
type qos
qos
policy-name
A policy map does not exist until one is configured. Because a policy map is applied to an interface, no
restrictions on the flow of data are applied to any interface until a policy map is created.
Type is QoS when not specified.
XR Config mode
Use the policy-map command to specify the name of the policy map to be created, added to, or modified
before you can configure policies for classes whose match criteria are defined in a class map. Entering the
policy-map command enables policy map configuration mode in which you can configure or modify the
class policies for that policy map.
(Optional) Specifies type of the
service policy.
(Optional) Specifies a
quality-of-service (QoS) policy
map.
Name of the policy map.
ModificationRelease
This command was introduced.Release 6.0
You can configure class policies in a policy map only if the classes have match criteria defined for them. Use
the class-map and match commands to configure the match criteria for a class.
A single policy map can be attached to multiple interfaces concurrently.
The number of classes per policy-map supported in the egress direction is 8 and ingress direction is 32.
For egress classification, in order to see statistics on all 8 CoSQs, you are recommended to configure all 8
classes including class-default.
Task ID
ID
qos
OperationsTask
read,
write
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
45
policy-map
Congestion Management Commands
Examples
These examples show how to create a policy map called policy1 and configures two class policies
included in that policy map. The policy map is defined to contain policy specification for class1 and
the default class (called class-default) to which packets that do not satisfy configured match criteria
are directed. Class1 specifies policy for traffic that matches access control list 136.
RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match access-group ipv4 136
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)# set precedence 3
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)# queue-limit 1000000 bytes
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
46
Congestion Management Commands
priority (QoS)
To assign priority to a traffic class based on the amount of available bandwidth within a traffic policy, use
the priority command in policy map class configuration mode. To remove a previously specified priority
for a class, use the no form of this command.
priority [level priority-level]
no priority
priority (QoS)
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
level priority-level
(Optional) Sets multiple levels of priority to a traffic class. Level 1 through 7. Default
level is 1. Level 1 traffic has higher priority.
No default action.
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0
The priority command configures low-latency queueing (LLQ), providing strict priority queueing (PQ).
Strict PQ allows delay-sensitive data such as voice to be dequeued and sent before packets in other queues
are dequeued. The priority command is supported only in the egress direction. No policer is allowed with
a priority class. To limit the priority traffic use the shape average command.
The priority command sets up classes based on a variety of criteria (not just User Datagram Protocol [UDP]
ports) and assigns a priority to them.
The bandwidth and priority commands cannot be used in the same class, within the same policy map. These
commands can be used together in the same policy map.
OperationsTask
ID
qos
read,
write
Examples
This example shows how to configure priority queuing for the policy map named policy1 :
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)# priority level 1
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
47
vrf-policy
vrf-policy
Congestion Management Commands
To apply a policy on a per VPN routing and forwarding (VRF) basis, use the vrf-policy command in global
configuration mode. To remove the association of the policy on a VRF, use the no form of this command.
vrf-policy vrf vrf-name address-family {ipv4 | ipv6 } policy type pbr input policy-name
no vrf-policy vrf vrf-name address-family {ipv4 | ipv6 } policy type pbr input policy-name
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
vrf vrf-name
policy type pbr input policy-name
Sets the VRF name.
Sets the policy name.
No default action.
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0.1
This command is supported with sub-mode. This command applies only to the incoming IPv4 packets only.
Use this command to apply a PBR policy on a per VRF basis during the classification and decapsulation of
GRE packets.
OperationsTask
ID
qos
read,
write
Examples
48
This example shows how to apply an already configured policy on a per VRF basis:
/* Configuring a VRF */
RP/0/RP0/CPU0:router(config)# vrf gre-vrf address-family ipv4 unicast
...
/* Configuring a policy */
RP/0/RP0/CPU0:router(config)# policy-map type pbr gre-policy
...
/* Applying the policy on the VRF */
RP/0/RP0/CPU0:router(config)# vrf-policy vrf gre-vrf address-family ipv4 policy type pbr
input gre-policy
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
Congestion Management Commands
show qos interface
To display QoS information for a specific interface, use the show qos interface command in the XR EXEC
mode.
show qos interface interface-name {input|output}[location node-id]
show qos interface
Syntax Description
Command Default
Command Modes
Command History
interface-name
input
output
location node-id
No default behavior or values
XR EXEC mode
Interface name. For more information about the
syntax for the router, use the question mark (?) online
help function.
Note
Use the show interfaces command to see
a list of all interfaces currently configured
on the router.
Attaches the specified policy map to the input
interface.
Attaches the specified policy map to the output
interface.
(Optional) Displays detailed QoS information for the
designated node. The node-id argument is entered
in the rack/slot/module notation.
ModificationRelease
This command was introduced.Release 6.0
Usage Guidelines
The show qos interface command displays configuration for all classes in the service policy that is attached
to an interface.
Use this command to check the actual values programmed in the hardware from the action keywords in the
police rate command.
Task ID
OperationsTask
ID
readqos
Examples
This is the sample output shows the QoS information on a interface hundredGigE 0/6/0/18
that are in the input direction:
RP/0/RP0/CPU0:router# show qos interface hundredGigE 0/6/0/18 input
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
49
show qos interface
Congestion Management Commands
Wed Dec 2 22:34:20.241 UTC
NOTE:- Configured values are displayed within parentheses
Interface HundredGigE0/6/0/18 ifh 0x3000210 -- input policy
NPU Id:3
Total number of classes:28
Interface Bandwidth:100000000 kbps
Accounting Type:Layer1 (Include Layer 1 encapsulation and above)
-----------------------------------------------------------------------------Level1 Class=exp-classifier-af1
New topmost exp=7
Default Policer Bucket ID=0x102a0
Default Policer Stats Handle=0x8b304d98
Policer not configured for this class
Level1 Class=exp-classifier-af2
New topmost exp=6
Default Policer Bucket ID=0x102a1
Default Policer Stats Handle=0x8b304b48
Policer not configured for this class
Level1 Class=exp-classifier-af3
New topmost exp=5
Default Policer Bucket ID=0x102a2
Default Policer Stats Handle=0x8b3048f8
Policer not configured for this class
Level1 Class=exp-classifier-af4
New topmost exp=3
Default Policer Bucket ID=0x102a3
Default Policer Stats Handle=0x8b3046a8
Policer not configured for this class
Level1 Class=exp-classifier-be1
New topmost exp=4
Default Policer Bucket ID=0x102a4
Default Policer Stats Handle=0x8b304458
Policer not configured for this class
Level1 Class=inet4-classifier-af1
New qos group=1
Default Policer Bucket ID=0x102a5
Default Policer Stats Handle=0x8b304208
Policer not configured for this class
Level1 Class=inet4-classifier-af2
New qos group=2
Default Policer Bucket ID=0x102a6
Default Policer Stats Handle=0x8b303fb8
Policer not configured for this class
Level1 Class=inet4-classifier-af3
New qos group=3
Default Policer Bucket ID=0x102a7
Default Policer Stats Handle=0x8b303d68
Policer not configured for this class
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
50
Congestion Management Commands
Level1 Class=inet4-classifier-af4
New qos group=4
Default Policer Bucket ID=0x102a8
Default Policer Stats Handle=0x8b303b18
Policer not configured for this class
Level1 Class=inet4-classifier-be1
New qos group=5
Default Policer Bucket ID=0x102a9
Default Policer Stats Handle=0x8b3038c8
Policer not configured for this class
Level1 Class=inet4-classifier-nc1
New qos group=6
Default Policer Bucket ID=0x102aa
Default Policer Stats Handle=0x8b303678
Policer not configured for this class
Level1 Class=inet6-classifier-af1
New qos group=1
show qos interface
Default Policer Bucket ID=0x102ab
Default Policer Stats Handle=0x8b303428
Policer not configured for this class
Level1 Class=inet6-classifier-af2
New qos group=2
Default Policer Bucket ID=0x102ac
Default Policer Stats Handle=0x8b3031d8
Policer not configured for this class
Level1 Class=inet6-classifier-af3
New qos group=3
Default Policer Bucket ID=0x102ad
Default Policer Stats Handle=0x8b302f88
Policer not configured for this class
Level1 Class=inet6-classifier-af4
New qos group=4
Default Policer Bucket ID=0x102ae
Default Policer Stats Handle=0x8b302d38
Policer not configured for this class
Level1 Class=inet6-classifier-be1
New qos group=5
Default Policer Bucket ID=0x102af
Default Policer Stats Handle=0x8b302ae8
Policer not configured for this class
Level1 Class=inet6-classifier-nc1
New qos group=6
Default Policer Bucket ID=0x102b0
Default Policer Stats Handle=0x8b302898
Policer not configured for this class
Level1 Class=inet-classifier-ipv6-af1
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
51
show qos interface
Congestion Management Commands
New qos group=1
Default Policer Bucket ID=0x102b1
Default Policer Stats Handle=0x8b302648
Policer not configured for this class
Level1 Class=inet-classifier-ipv6-af2
New qos group=2
Default Policer Bucket ID=0x102b2
Default Policer Stats Handle=0x8b3023f8
Policer not configured for this class
Level1 Class=inet-classifier-ipv6-af3
New qos group=3
Default Policer Bucket ID=0x102b3
Default Policer Stats Handle=0x8b3021a8
Policer not configured for this class
Level1 Class=inet-classifier-ipv6-af4
New qos group=4
Default Policer Bucket ID=0x102b4
Default Policer Stats Handle=0x8b301f58
Policer not configured for this class
Level1 Class=inet-classifier-ipv6-af5
New qos group=5
Default Policer Bucket ID=0x102b5
Default Policer Stats Handle=0x8b301d08
Policer not configured for this class
Level1 Class=inet-classifier-ipv6-af6
New qos group=6
Default Policer Bucket ID=0x102b6
Default Policer Stats Handle=0x8b301ab8
Policer not configured for this class
Level1 Class=inet-management-classifier-af4
New qos group=7
Default Policer Bucket ID=0x102b7
Default Policer Stats Handle=0x8b301868
Policer not configured for this class
Level1 Class=exp-classifier-nc1
New qos group=6
New topmost exp=2
Default Policer Bucket ID=0x102b8
Default Policer Stats Handle=0x8b301618
Policer not configured for this class
Level1 Class=inet-management-classifier-nc1
New prec=6
New qos group=5
Default Policer Bucket ID=0x102b9
Default Policer Stats Handle=0x8b3013c8
Policer not configured for this class
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
52
Congestion Management Commands
Level1 Class=inet6-management-classifier-nc1
New qos group=4
Default Policer Bucket ID=0x102ba
Default Policer Stats Handle=0x8b301178
Policer not configured for this class
Level1 Class=class-default
Default Policer Bucket ID=0x102bb
Default Policer Stats Handle=0x8b3074e8
Policer not configured for this class
This is the sample output shows the QoS information on a interface hundredGigE 0/6/0/18
that are in the output direction:
RP/0/RP0/CPU0:router# show qos interface hundredGigE 0/6/0/18 output
Wed Dec 2 22:34:25.476 UTC
NOTE:- Configured values are displayed within parentheses
Interface HundredGigE0/6/0/18 ifh 0x3000210 -- output policy
NPU Id:3
Total number of classes:3
Interface Bandwidth:100000000 kbps
VOQ Base:11176
VOQ Stats Handle:0x887a6e18
Accounting Type:Layer1 (Include Layer 1 encapsulation and above)
-----------------------------------------------------------------------------Level1 Class (HP7)=qos-1
Egressq Queue ID=11177 (HP7 queue)
Queue Max. BW.=0 kbps (default)
TailDrop Threshold=125304832 bytes / 10 ms (default)
WRED not configured for this class
show qos interface
Level1 Class (HP6)=qos-2
Egressq Queue ID=11178 (HP6 queue)
Queue Max. BW.=0 kbps (default)
TailDrop Threshold=125304832 bytes / 10 ms (default)
WRED not configured for this class
Level1 Class=class-default
Egressq Queue ID=11176 (Default LP queue)
Queue Max. BW.=101803495 kbps (default)
Queue Min. BW.=0 kbps (default)
Inverse Weight / Weight=1 / (BWR not configured)
TailDrop Threshold=1253376 bytes / 10 ms (default)
WRED not configured for this class
This table describes the significant fields shown in the display.
Table 5: show QoS interface Field Descriptions
DescriptionField
Level 1 class identifier in decimal format.Level 1 class
Policer bucket identifier.Policer Bucket ID
Policer statistics handle for this class.Policer Stats Handle
VOQ number of the packet in this class.Queue ID
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
Maximum bandwidth of the queue.Queue Max. BW
53
show qos interface
Congestion Management Commands
DescriptionField
Minimum bandwidth of the queue.Queue Min. BW
Inverse Weight / Weight
TailDrop Threshold
Remaining bandwidth weight.
Note
The hardware weight is expressed in
inverse value.
Number of bytes taildropped for this queue and the
default/user-configured queue-limit expressed in
milliseconds/user-configured unit.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
54
Congestion Management Commands
show policy-map interface
To display policy information and statistics for all classes configured for all service policies on the specified
interface, use the show policy-map interface command in XR EXEC mode.
show policy-map[interface {interface type| all} interface-path-id][{input |output }]
show policy-map interface
Syntax Description
Command Default
Command Modes
Command History
interface type
interface-path-id
input
output
None
XR EXEC mode
Interface type. For more information, use the question
mark (?) online help function.
Specifies all interfaces.all
Physical interface or virtual interface.
Note
For more information about the syntax for the router,
use the question mark (?) online help function.
(Optional) Displays per class statistics on inbound
traffic for the specified policy map and interface.
(Optional) Displays per class statistics on outbound
traffic for the specified policy map and interface.
Use the show interfaces command to see
a list of all interfaces currently configured
on the router.
ModificationRelease
Usage Guidelines
Task ID
Examples
The show policy-map interface command displays the statistics for classes in the service policy attached to
an interface.
The show policy-map interface command does not display the statistics and counters for the egress marking
policy.
OperationsTask
ID
readqos
This sample output shows how to display policy statistics information for all classes on the
interface hundredGigE 0/6/0/18 that are in the input direction:
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
This command was introduced.Release 6.0
55
show policy-map interface
RP/0/RP0/CPU0:router# show policy-map interface hundredGigE 0/6/0/18 input
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
57
show policy-map interface
Class class-default
This sample output shows how to display policy statistics information for all classes on the
interface hundredGigE 0/6/0/0 that are in the output direction:
RP/0/RP0/CPU0:router# show policy-map interface hundredGigE 0/6/0/0 output
Wed Dec 9 16:18:10.179 UTC
HundredGigE0/6/0/0 output: test-pol-out
This table describes the significant fields shown in the display.
Table 6: show policy-map interface Field Descriptions
DescriptionField
Classification statistics
Matched
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
58
Number of packets or bytes that matched this class.
Number of packets or bytes transmitted for this class.Transmitted
Number of packets or bytes dropped for this class.Total Dropped
Congestion Management Commands
Policing statistics
show policy-map interface
DescriptionField
Policed(conform)
Queuing statistics
Queue ID
Number of packets or bytes that conformed to the police rate for this class.
Number of packets or bytes that exceeded the police rate for this class.Policed(exceed)
Number of packets or bytes that violated the police rate for this class.Policed(violate)
Number of packets or bytes dropped by the policer of this class.Policed and dropped
VOQ number of the packet in this class.
Number of bytes taildropped for this queue.Taildropped (bytes)
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
59
show policy-map targets
show policy-map targets
To display information about the interfaces on which policy maps are applied, use the show policy-map
targets command in XR EXEC mode.
show policy-map targets [{location node-id|pmap-name name|type qos [{location
node-id|pmap-name name}]}]
Congestion Management Commands
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
location node-id
(Optional) Displays information about the interfaces on which policy maps are applied
for the specified location. The node-id argument is entered in the rack/slot/module
notation.
pmap-name name
(Optional) Displays information about the interfaces on which the specified policy map
is applied.
type qos
(Optional) Displays information about the interfaces on which QoS policy maps are
applied. This is the default type.
The default QoS policy type is QoS.
XR EXEC mode
ModificationRelease
This command was introduced.Release 6.0
For a short period of time while a QoS policy is being modified, there might not be any policy in effect on
the interfaces in which the modified policy is used. For this reason, modify QoS policies that affect the fewest
number of interfaces at a time. Use the show policy-map targets command to identify the number of
interfaces that will be affected during policy map modification.
Task ID
OperationsTask
ID
readqos
Examples
In this example, the TenGigabit Ethernet interface 4/0/10/0 has one policy map attached as a main
policy. Outgoing traffic on this interface will be affected if the policy is modified:
RP/0/RP0/CPU0:router# show policy-map targets
Wed Dec 2 22:35:13.993 UTC
1) Policymap: test-qlimitType: qos
Targets (applied as main policy):
TenGigE0/4/0/10/0 output
TenGigE0/6/0/30/1 output
Total targets: 2
Targets (applied as child policy):
Total targets: 0
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
60
Congestion Management Commands
2) Policymap: test-priorityType: qos
Targets (applied as main policy):
Targets (applied as child policy):
Total targets: 0
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
61
show policy-map type pbr
show policy-map type pbr
To view details of the configured PBR policy and related statistics, use the show policy-map type pbr vrf
vrf-name addr-family ipv4 statistics command in XR EXEC mode.
show policy-map type pbr vrf vrf-name addr-family {ipv4 | ipv6 } statistics
Congestion Management Commands
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Examples
vrf vrf-name
Sets the VRF name.
No default action.
XR EXEC mode
ModificationRelease
This command was introduced.Release 6.0.1
This command applies only to the incoming IPv4 packets only.
OperationsTask
ID
readqos
This example shows how to view details of the configured PBR policy and related statistics:
/* Configuring a VRF */
RP/0/RP0/CPU0:router(config)# vrf gre-vrf address-family ipv4 unicast
...
/* Configuring a policy */
RP/0/RP0/CPU0:router(config)# policy-map type pbr gre-policy
...
/* Applying the policy on the VRF */
RP/0/RP0/CPU0:router(config)# vrf-policy vrf gre-vrf address-family ipv4 policy type pbr
input gre-policy
/* Displaying policy details and statistics */
RP/0/RP0/CPU0:router# show policy-map type pbr vrf gre-vrf addr-family ipv4 policy type pbr
input gre-policy
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
62
Congestion Avoidance Commands
Note
All commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 540
Series Router that is introduced from Cisco IOS XR Release 6.3.2. References to earlier releases in Command
History tables apply to only the Cisco NCS 5500 Series Router.
This chapter describes commands used to avoid congestion.
Congestion avoidance is achieved through packet dropping.
• bandwidth (QoS), on page 64
• bandwidth remaining, on page 66
• queue-limit, on page 68
• random-detect, on page 71
• service-policy (interface), on page 73
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
63
bandwidth (QoS)
bandwidth (QoS)
To specify the minimum bandwidth allocated to a class belonging to a policy map, use the bandwidth
command in policy map class configuration mode. To remove the bandwidth specified for a class, use the no
form of this command.
bandwidth {rate [units]|percent percentage-value}
no bandwidth {rate [units]|percent percentage-value}
Congestion Avoidance Commands
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
rate
units
percent percentage-value
The default units is kbps.
Policy map class configuration
The bandwidth command is used to specify the minimum guaranteed bandwidth allocated for traffic matching
a particular class. Bandwidth may be defined as a specific value or may be set as a percentage of the interface
bandwidth.
Minimum bandwidth, in the units specified, to be assigned to the class. Range is
from 1 to 4294967295.
Specifies the units for the bandwidth. Values can be:
• bps—bits per second
• gbps—gigabits per second
• kbps—kilobits per second (default)
• mbps—megabits per second
Specifies the amount of minimum guaranteed bandwidth, based on an absolute
percentage of available bandwidth. Range is from 1 to 100.
ModificationRelease
This command was introduced.Release 6.0
If a percentage value is set, the accuracy that can be expected is 1 percent.
The bandwidth command is supported only in the egress direction.
A policy map can have a single bandwidth statement per class. Both percentage and actual value bandwidth
configurations can be used within a policy map.
The bandwidth command does not specify how the bandwidth is to be shared. Instead it specifies how much
bandwidth is guaranteed per class, by setting the number of tokens that are assigned to the token bucket of a
particular class. For configured behavior to work correctly, you must ensure that the sum of the bandwidths
plus any priority traffic is not greater than the bandwidth of the interface itself. If the interface is oversubscribed,
unpredictable behavior results.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
64
Congestion Avoidance Commands
bandwidth (QoS)
Task ID
Examples
OperationsTask
ID
qos
read,
write
This example shows how to guarantee 50 percent of the interface bandwidth to a class called class1
and 10 percent of the interface bandwidth to a class called class2:
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)# bandwidth percent 50
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)# bandwidth percent 10
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
65
bandwidth remaining
bandwidth remaining
To specify how to allocate leftover bandwidth to various classes, use the bandwidth remaining command
in policy map class configuration mode. To return to the system defaults, use the no form of this command.
Specifies the amount of guaranteed bandwidth, based on an absolute percentage
of the available bandwidth. Range is from 1 to 100.
ratio ratio-value
Specifies the amount of guaranteed bandwidth, based on a bandwidth ratio
value. Range is 1 to 2000.
No bandwidth is specified.
Policy map class configuration
ModificationRelease
This command was introduced.Release 6.0
Bandwidth, bandwidth remaining, shaping, queue-limit and WRED commands can be configured together in
the same class.
The bandwidth remaining command is supported only in the egress direction.
The available bandwidth is equally distributed among those queueing classes that do not have the remaining
bandwidth explicitly configured.
The bandwidth remaining command is used to proportionally allocate bandwidth to the particular classes,
but there is no reserved bandwidth capacity.
On egress, if the bandwidth remaining command is not present, then the bandwidth is shared equally among
the configured queueing classes present in the policy-map.
Task ID
OperationsTask
ID
qos
read,
write
Examples
This example shows how the remaining bandwidth is shared by classes class1 and class2 in a 20:80
ratio.
RP/0/RP0/CPU0:router(config)# policy-map policy1
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
66
Congestion Avoidance Commands
RP/0/RP0/CPU0:router(config-pmap)# class class1
RP/0/RP0/CPU0:router(config-pmap-c)# bandwidth remaining percent 20
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)# bandwidth remaining percent 80
bandwidth remaining
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
67
queue-limit
queue-limit
Congestion Avoidance Commands
To specify or modify the maximum number of packets the queue can hold for a class policy configured in a
policy map for each port, use the queue-limit command in policy map class configuration mode. To remove
the queue packet limit from a class, use the no form of this command.
queue-limit value [unit ] | percent <1-100>
no queue-limit
Syntax Description
Command Default
value
unit
percent
The default value is 10 milliseconds for all queues including the high-priority queues.
Maximum threshold for tail drop in bytes. Range is from 1 to 4294967295.
(Optional) Units for the queue limit value. Values can be:
• bytes —bytes
• kbytes —kilobytes
• mbytes —megabytes
• ms —milliseconds
• packets —packets (default)
• us —microseconds
Note
(Optional) Allows you to specify queue limit thresholds as a percentage of the total buffer limit for
each port. This makes your provisioning model simpler and makes it easier for you to adjust the
queue burst limit, irrespective of the queue’s service rate. The calculation is based on the assumption
that a port takes 40 milli-seconds of buffering at port-rate. This option was introduced in Release
6.1.2.
When the specified units is packets, packets are assumed to be 256 bytes in size.
Command Modes
Command History
Usage Guidelines
68
Policy map class configuration
When configuring the queue-limit command, you must configure one of the following commands: priority,
shape average, bandwidth or bandwidth remaining, except for the default class. The default value is 10
milliseconds for all queues including the high-priority queues.
The queue-limit command is supported only in the egress direction.
Packets satisfying the match criteria for a class accumulate in the queue reserved for the class until they are
serviced by the scheduling mechanism. The queue-limit command defines the maximum threshold for a
class. When that threshold is reached, enqueued packets to the class queue result in tail drop (packet drop).
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
ModificationRelease
This command was introduced.Release 6.0
Congestion Avoidance Commands
Tail drop is a congestion avoidance technique that drops packets when an output queue is full, until congestion
is eliminated.
Use the show qos interface command to display the queue limit and other QoS values.
Queue Limit Default Values
These default values are used when queue-limit is not configured in the class:
• If QoS is configured and Weighted Random Early Detection (WRED) is not configured:
• If QoS is configured and WRED is configured:
queue-limit
• Queue limit is 10 ms at the guaranteed service rate of the queue for non-priority queues.
• Queue limit is 10 ms at the interface rate for priority classes
• Queue limit is two times the WRED maximum threshold. The maximum threshold can be an
explicitly configured value or an implicit 10 ms.
• If more than one WRED profile is configured in the class, the maximum threshold is the maximum
for all profiles.
• When the queue-limit is configured in time units, the guaranteed service rate (for the non-priority
class) or the interface rate (for the priority class) is used to compute the queue-limit.
These restrictions apply to queue limits:
• For releases before Release 6.3.2, the queue limit should be at least the maximum MTU size, which is
fixed at 9 * 1024 bytes = 9kb. From Release 6.3.2 onwards, the minimum queue limit is the interface
MTU (which is dynamically configured).
• Queue limit should be 3 GB, which is the maximum packet buffer size in ingress and egress queuing
ASICs.
• Only time-based units are allowed on bundle targets.
Guaranteed Service Rate
The guaranteed service rate is defined as the service rate of the queue when all queues are backlogged and
derived as:
guaranteed service rate of c1 = 30 percent LR + (40 percent * 50 percent * LR)
guaranteed service rate of c2 = 20 percent LR + (30 percent * 50 percent * LR)
guaranteed service rate of class-default = 30 percent * 50 percent * LR
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
69
queue-limit
Congestion Avoidance Commands
• Where LR is line rate of the target on which service policy "sample_policy" is attached.
• 50 percent is unallocated bandwidth.
Task ID
Examples
OperationsTask
ID
qos
read,
write
This example shows how to set the queue limit for a class to 1000000 packets for policy map policy1:
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)# queue-limit 1000000
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
70
Congestion Avoidance Commands
random-detect
To enable random early detection (RED), use the random-detect command in policy map class configuration
mode. To remove RED, use the no form of this command.
random-detect {default|discard-class value|min-threshold [units] max-threshold [units]}
no random-detect
random-detect
Syntax Description
Command Default
Command Modes
Enables RED with default minimum and maximum thresholds.default
discard-class value
min-threshold
max-threshold
units
Default unit for max-threshold and min-threshold is packets.
Policy map class configuration
Discard-class based WRED (up to 2 values, which is 0 and 1).
Minimum threshold in number of packets. The value range of this argument is from
0 to 1073741823 in packets.
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 queue length
exceeds the maximum threshold, RED drops all packets with the specified discard
class value.
(Optional) Units for the threshold values. Values can be:
• bytes—bytes
• gbytes—gigabytes
• kbytes—kilobytes
• mbytes —megabytes
• ms —milliseconds
• packets —packets (default)
• us —microseconds
Command History
Usage Guidelines
The RED congestion avoidance technique takes advantage of the congestion control mechanism of TCP. By
randomly dropping packets before periods of high congestion, RED tells the packet source to decrease its
transmission rate. Assuming the packet source is using TCP, it decreases its transmission rate until all the
packets reach their destination, indicating that the congestion is cleared. You can use RED as a way to cause
TCP to slow transmission of packets. TCP not only pauses, but it also restarts quickly and adapts its transmission
rate to the rate that the network can support.
RED distributes losses in time and maintains normally low queue depth while absorbing traffic bursts. When
enabled on an interface, RED begins dropping packets when congestion occurs at a rate you select during
configuration.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
ModificationRelease
This command was introduced.Release 6.0
71
random-detect
Congestion Avoidance Commands
When time units are used, the guaranteed service rate is used to compute thresholds. The default minimum
threshold is 6 ms and the maximum threshold is 10 ms.
When the value of the units argument is packets, packets are assumed to be 256 bytes in size.
Weighted Random Early Detection
The following restriction apply to Weighted Random Early Detection (WRED):
• For thresholds in time units, the guaranteed service rate is used to calculate the thresholds in bytes.
For bundles, queue limit and WRED thresholds are supported in time units only.
Task ID
Examples
OperationsTask
ID
qos
read,
write
This example shows how to enable RED using a minimum threshold value of 1000000 and a maximum
threshold value of 2000000:
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)# random-detect 1000000 2000000
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
72
Congestion Avoidance Commands
service-policy (interface)
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
service-policy (interface)
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Attaches the specified policy map to the input interface.input
Attaches the specified policy map to the output interface.output
policy-map
Name of a service policy map (created using the policy-map command) to be attached.
No service policy is specified.
Interface configuration.
ModificationRelease
This command was introduced.Release 6.0
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.
OperationsTask
ID
qos
read,
write
Examples
This example shows policy map policy2 applied to HundredGigabitEthernet 0/0/0/1.
RP/0/RP0/CPU0:router(config)# class-map class2
RP/0/RP0/CPU0:router(config)# match precedence ipv4 2
RP/0/RP0/CPU0:router(config-cmap)# exit
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
74
Hierarchical Modular QoS Commands
Note
All commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 540
Series Router that is introduced from Cisco IOS XR Release 6.3.2. References to earlier releases in Command
History tables apply to only the Cisco NCS 5500 Series Router.
This chapter describes the commands used to manage hierarchical modular QoS.
Modular QoS Command Reference for Cisco NCS 5500 Series and Cisco NCS 540 Series Routers
75
hw-module profile qos hqos-enable
hw-module profile qos hqos-enable
To enable H-QoS profile, use the hw-module profile qos hqos-enable command in XR Config mode. To
remove the H-QoS profile, use the no form of the command.
hw-module profile qos hqos-enable
no hw-module profile qos hqos-enable
Hierarchical Modular QoS Commands
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
This command has no keywords or arguments.
H-QoS is disabled by default.
XR Config mode
ModificationRelease
This command was introduced.Release
6.3.1
After enabling H-QoS profile, the router must be reloaded.
OperationTask
ID
qos
read,
write
The following example shows how to enable the H-QoS profile on the router.
To control the scale of bundle sub-interfaces and the number of members per bundle, use the hw-module
profile qos max-trunks or hw-module profile bundle-scale (only from Release 6.5.1) command in XR
Config mode.
hw-module profile qos max-trunks {256|512|1024}
hw-module profile bundle-scale {256|512|1024}
Syntax Description
Command Default
Command Modes
Command History
Usage Guidelines
Task ID
Permits up to 128 bundle sub-interfaces, each containing up to 64 member-links256
Permits up to 384 bundle sub-interfaces, each containing up to 32 member-links.512
Permits up to 896 bundle sub-interfaces, each containing up to 16 member-links.1024
hw-module profile qos max-trunks 256, that is, permits up to 128 bundle sub-interfaces, each containing up
to 64 member-links.
XR Config mode
ModificationRelease
This command was introduced.Release
6.3.1
Release
6.5.1
The router must be reloaded for the hw-module command to be functional.
ID
The hw-module profile qos max-trunks <256/512/1024> command is replaced with the
hw-module profile bundle-scale <256/512/1024> command
OperationTask
qos
The following example shows how to change the scale of bundle interfaces to 256.