Basic QoS Commands

This chapter has details about the generic QoS commands. These are standard commands, which are used before applying the QoS policies or methods.

class-map

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

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

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

Syntax Description

type qos

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

traffic

(Optional) Specifies traffic type class-map.

match-all

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

match-any

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

class-map-name

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

Command Default

Type is QoS when not specified.

Command Modes

Global configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

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

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

  • match [not] dscp

  • match [not] mpls experimental topmost

  • match [not] precedence

  • match [not] protocol

Task ID

Task ID

Operations

qos

read, write

Examples

These examples show how to specify class1 as the name of a class and defines a class map for this class.


RP/0/(config)# class-map class1
RP/0/(config-cmap)# match dscp ipv4 1

RP/0/(config)# class-map class1
RP/0/(config-cmap)# match precedence ipv4 1

RP/0/(config)# class-map class1
RP/0/(config-cmap)# match cos 1

class (policy-map)

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

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

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

Syntax Description

type qos

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

class-name

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

class-default

Configures the default class.

Command Default

No class is specified.

Type is QoS when not specified.

Command Modes

Policy map configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

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

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

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

The 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/(config)# policy-map pm1 
RP/0/(config-pmap)# end-policy-map 
RP/0/(config)# end 
!
RP/0/# show running-config 
!
policy-map pm1
 class class-default
 !        
 end-policy-map
!
  

Task ID

Task ID

Operations

qos

read, write

Examples

This example shows how to create a policy map called policy1, which is defined to shape class1 traffic at 30 percent and default class traffic at 20 percent.

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

RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class class1
RP/0/config-pmap-c)# shape average percent 30
RP/0/(config-pmap-c)# exit


RP/0/(config-pmap)# class class-default
RP/0/(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.

end-class-map

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

end-class-map

Syntax Description

This command has no keywords or arguments.

Command Default

No default behavior or values

Command Modes

Class map configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

qos

read, write

Examples

These examples show how to end the class map configuration and exit class map configuration mode:


RP/0/(config)# class-map class1
RP/0/(config-cmap)# match dscp ipv4 1
RP/0/(config-cmap)# end-class-map 

RP/0/(config)# class-map class1 
RP/0/(config-cmap)# match precedence ipv4 1
RP/0/(config-cmap)# end-class-map 

RP/0/(config)# class-map class1
RP/0/(config-cmap)# match cos 1
RP/0/(config-cmap)# end-class-map 

end-policy-map

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

end-policy-map

Syntax Description

This command has no keywords or arguments.

Command Default

No default behavior or values

Command Modes

Policy map configuration

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

qos

read, write

Examples

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


RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class class1
RP/0/(config-pmap-c)# police rate 250
RP/0/(config-pmap)# end-policy-map 

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 global configuration 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

Command Default

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.

Command Modes

Global Configuration mode

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

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.

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.

Task ID

Task ID

Operations

qos

read, write

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.


RP/0/(config)# class-map class1
RP/0/(config-cmap)# match dscp ipv4 136

RP/0/(config)# policy-map policy1
RP/0/(config-pmap)# class class1
RP/0/(config-pmap-c)# set precedence 3
RP/0/(config-pmap-c)# exit

RP/0/(config-pmap)# class class-default
RP/0/(config-pmap-c)# queue-limit  1000000 bytes
  

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 EXEC mode.

show policy-map[ interface {interface type | all} interface-path-id] [input | output ]

Syntax Description

interface type

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

all

Specifies all interfaces.

interface-path-id

Physical interface or virtual interface.

Note 

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

input

(Optional) Displays per class statistics on inbound traffic for the specified policy map and interface.

output

(Optional) Displays per class statistics on outbound traffic for the specified policy map and interface.

Command Default

None

Command Modes

EXEC mode

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The show policy-map interface command displays the statistics for classes in the service policy attached to an interface.

Task ID

Task ID

Operations

qos

read

Examples

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/# 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

Class qos-grp1
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :           885333442/900384110514         57036859
    Transmitted         :           299199945/304286344065         19278557
    Total Dropped       :           586133497/596097766449         37758302
  Queueing statistics
    Queue ID                             : 10409 
    Taildropped(packets/bytes)           : 586133497/596097766449
Class qos-grp2
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :                   0/0                    0
    Transmitted         :                   0/0                    0
    Total Dropped       :                   0/0                    0
  Queueing statistics
    Queue ID                             : 10410 
    Taildropped(packets/bytes)           : 0/0
Class class-default
  Classification statistics          (packets/bytes)     (rate - kbps)
    Matched             :          1487720301/1513011546117        98203543
    Transmitted         :          1182422140/1202523316380        78285945
    Total Dropped       :           305298161/310488229737         19917598
  Queueing statistics
    Queue ID                             : 10408 
    Taildropped(packets/bytes)           : 305298161/310488229737

This table describes the significant fields shown in the display.

Table 1. show policy-map interface Field Descriptions

Field

Description

Classification Statistics

Matched

Number of packets or bytes that matched this class.

Transmitted

Number of packets or bytes transmitted for this class.

Total Dropped

Number of packets or bytes dropped for this class.

Policing Statistics

Policed(conform)

Number of packets or bytes that conformed to the police rate for this class.

Policed(exceed)

Number of packets or bytes that exceeded the police rate for this class.

Policed(violate)

Number of packets or bytes that violated the police rate for this class.

Policed and dropped

Number of packets or bytes dropped by the policer of this class.

Queueing Statistics

Queue ID

VOQ number of the packet in this class.

Taildropped (bytes)

Number of bytes taildropped for this queue.

show running-configuration class-map

To display the configured class-map details, use the show running-configuration class-map command in EXEC mode.

show running-configuration class-map

Syntax Description

This command has no keywords or arguments.

Command Default

None

Command Modes

EXEC

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The show running-configuration class-map is used for getting the class-map details.

Task ID

Task ID Operation

qos

read

Examples

This example shows the configured class-map details:

show running-config class-map
class-map match-any CLASS_1_egress_COS
macth qos-group1
end-class-map
!
class-map match-any CLASS_2_egress_COS
macth qos-group2
end-class-map
!
class-map match-any CLASS_3_egress_COS
macth qos-group3
end-class-map
!
class-map match-anyCLASS_1_ingress_COS
macth cos4
end-class-map
!
class-map match-anyCLASS_2_ingress_COS
macth cos7
end-class-map
!
class-map match-anyCLASS_3_ingress_COS
macth cos3
end-class-map
!

show running-configuration policy-map

To display the configured policy-map details, use the show running-configuration policy-map command in EXEC mode.

show running-configuration policy-map

Syntax Description

This command has no keywords or arguments.

Command Default

None

Command Modes

EXEC

Command History

Release Modification

Release 6.1.42

This command was introduced.

Usage Guidelines

The show running-configuration policy-map command is used for getting the policy-map details.

Task ID

Task ID Operation

qos

read

Examples

This example shows the configured policy-map details.

show running-config policy-map
policy-map egress_POLICY_L2
class CLASS_1_egress_COS
shape average 2 gbps
!
class CLASS_2_egress_COS
shape average 4 gbps
!
class CLASS_3_egress_COS
shape average 4 gbps
!
class class-default
!
end-policy-map
!
policy-map ingress_POLICY_L2
classCLASS_1_ingress_COS
set traffic-class1
!
classCLASS2_ingress_COS
set qos-group2
!
classCLASS_3_ingress_COS
set qos-group3
!
class class-default
!
end-policy-map
!