To specify or modify the bandwidth allocated for 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.
Specifies the amount of bandwidth in kbps to be assigned to the class. Implies that the class where this is applied is given a minimum bandwidth guarantee of bandwidth-value kbps. The amount of bandwidth configured should be large enough to also accommodate Layer 2 overhead.
percentx%
Specifies the amount of bandwidth, in percentage from the available bandwidth, to be assigned to the class. The value ranges from 1 to 100 percent.
remaining percentx%
Specifies that the class where the command is specified should be given x% of the excess bandwidth, where excess bandwidth is the bandwidth in excess of all the minimum bandwidth guarantees of all the classes at the same level. The value ranges from 1 to 100 percent.
remaining ratioratio
Specifies a bandwidth-remaining ratio for class-level or subinterface-level queues to be used during congestion to determine the amount of excess bandwidth (unused by priority traffic) to allocate to non priority queues. The value should be between 1 to 127.
Command Default
Bandwidth is not specified.
Command Modes
Policy-map class configuration (config-pmap-c)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
The restrictions and usage guidelines to configure quality of service (QoS) egress bandwidth on a CPT system are as follows:
Bandwidth action is not supported on classes with match criteria as qos-group 3 or 7, or multicast-priority class.
The bandwidth command cannot be used in combination with Bandwidth Remaining Ratio (BRR) or Bandwidth Remaining Percentage (BRP) in a class-map or a policy-map.
The system does not validate for the total CIR configured on all the targets under the various congestion points. Therefore, ensure that the total committed information rate (CIR) configured does not exceed the total bandwidth available:
Total CIR configured under a 1 Gbps interface shall not exceed 1 Gbps; this includes CIR in policy applied on interface as well as services on that interface.
Total CIR configured under a 10 Gbps interface shall not exceed 10 Gbps; this includes CIR in policy applied on interface as well as services on that interface.
Total CIR on all targets on a CPT 50 shelf shall not exceed 9.882 Gbps; this is the least bandwidth for a CPT 50 shelf in a scenario where only one of the interconnects for a CPT50 shelf is functional.
Total CIR on all the unicast targets on two SFP+ interfaces on a fabric card shall not exceed 13 Gbps. The same is applicable if two CPT 50 shelves are connected to the two SFP+ interfaces of the same fabric card.
The restrictions and usage guidelines to configure QoS egress bandwidth remaining ratio or bandwidth remaining percent on a CPT system are as follows:
The bandwidth remaining ratio and bandwidth remaining percent command is not supported in combination with bandwidth action in a class-map or a policy-map.
The bandwidth remaining ratio and bandwidth remaining percent command is not supported on classes with match criteria as qos-group 3 or 7 or multicast-priority class
BRR is implemented on logical interfaces using hierarchical policy-maps.
Examples
The following example shows how to configure bandwidth remaining ratio at the egress:
Router(config)# policy-map BRR
Router(config-pmap)# class Test1
Router(config-pmap-c)# bandwidth remaining ratio 10
Router(config-pmap-c)# exit
Router(config-pmap)# class Test2
Router(config-pmap-c)# bandwidth remaining ratio 20
Router(config-pmap-c)# exit
Router(config-pmap)# class Test3
Router(config-pmap-c)# bandwidth remaining ratio 30
Router(config-pmap-c)# exit
Router(config-pmap)# class class-default
Router(config-pmap-c)#bandwidth remaining ratio 40
This example shows how to configure minimum bandwidth guarantee at the egress:
Router# config terminal
Router(config)# policy-map Test
Router(config-pmap)# class class-default
Router(config-pmap-c)# bandwidth 10000
Router(config-pmap-c)# exit
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
class-name {class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
show policy-map interface
Displays the statistics and the configurations of the input and output policies that are attached to an interface.
show policy-map
Displays the policy-map information.
class
To specify the name of the class whose policy you want to create or change, or to specify the default class (commonly known as the class-default class) before you configure its policy, 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 {class-name| class-default}
no class {class-name| class-default}
Syntax Description
class-name
User-defined class name to which the policy applies.
class-default
Specifies that the policy applies to the default traffic class.
Command Default
A class is not specified.
Command Modes
Policy-map configuration (config-pmap)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
Within a policy map, the class command can be used to specify the name of the class whose policy you want to create or change. First, the policy map must be identified. 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 to specify the predefined default class called class-default. The class-default class is the class to which traffic is directed if that traffic does not match any of the match criteria in the configured class maps.
Examples
The following example shows how to configure policing actions:
Configures traffic policing on the basis of a percentage of bandwidth available on an interface.
class-map
To create a class map to be used for matching packets to a specified class, use the class-map command in global configuration mode. To remove an existing class-map from the router, use the no form of this command. The class-map command enters class-map configuration mode in which you can enter one of the match commands to configure the match criteria for this class.
class-map [match-any] class-map-name
no class-map [match-any] class-map-name
Syntax Description
[match-any]
(Optional) Specifies that one of the match criterion must be met. Use this keyword only if you have to specify more than one match command.
class-map-name
Name of the class for the class-map. This argument is used for both the class-map and to configure a policy for the class in the policy map. The class name cannot contain spaces and can have a maximum of 40 alphanumeric characters.
Command Default
Class-map is not configured by default.
Command Modes
Global configuration (config)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
Use the class-map command to specify the class that you create or modify to meet the class-map match criteria. This command enters class-map configuration mode where you can enter one of the match commands to configure the match criteria for this class. Packets that arrive at either the input interface or the output interface (determined by how the service-policy command is configured) are checked against the match criteria configured for a class-map to determine if the packets belong to that class.
In the class-map configuration mode, the following configuration commands are available:
exit—Used to exit from class-map configuration mode.
no—Used to remove a match statement from a class-map.
match—Used to configure classification criteria. The optional match subcommands and the description are listed in this table.
Command
Description
match coscos-number
Example:
Router(config-cmap)# match cos 2
Matches a packet on the basis of a Layer 2 class of service (CoS) number.
cos-number— CoS value. The value can range from 0 to 7.
match ip precedence ip-precedence-value
Example:
Router(config-cmap)# match ip precedence 5
Identifies the IP precedence value as match criteria.
ip-precedence-value— IP precedence value. The value can range from 0 to 7.
match ip dscpip- dscp-value
Example:
Router(config-cmap)# match ip dscp 6
Identifies a specific IP differentiated services code point (DSCP) value as a match criterion.
ip- dscp-value — IP DSCP value. The value can range from 0 to 63.
match mpls experimental topmostexp-value
Example:
Router(config-cmap)# match mpls experimental topmost 5
Matches the Multiprotocol Label Switching (MPLS) experimental (EXP) value in the topmost label.
exp-value — MPLS EXP value. The value can range from 0 to 7.
Examples
The following example shows how to configure a class-map named ipp5, and enter a match statement for IP precedence 5:
Router# enable
Router# configure terminal
Router(config)# class-map ipp5
Router(config-cmap)# match ip precedence 5
The following example shows how to a configure class-map on multiple match statements:
Router# enable
Router# configure terminal
Router(config)# class-map match-any IPP
Router(config-cmap)# match ip precedence 3
Router(config-cmap)# match ip precedence 4
The following example shows how to display class-map information for a specific class-map:
Router# show class-map ipp5
class Map match-any ipp5 (id 1)
match ip precedence 5
Related Commands
Command
Description
class class-default
Specifies that the policy applies to the default traffic class.
classclass-name
User-defined class name to which the policy applies.
match cos
Matches a packet on the basis of a Layer 2 CoS number.
match ip precedence
Identifies the IP precedence value as match criteria.
match ip dscp
Identifies a specific IP DSCP value as a match criterion.
match mpls experimental topmost
Matches the MPLS EXP value in the topmost label.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show class-map
Displays the class-map information.
match ip precedence
To specify the IP precedence values to use as the match criteria, use the match ip precedence command in the class-map configuration mode. To remove IP precedence values from a class map, use the no form of this command.
match [ip] precedenceip-precedence-value
no match [ip] precedenceip-precedence-value
Syntax Description
ip
(Optional) Specifies that the match is for IPv4 packets.
ip-precedence-value
IP precedence value. The value can range from 0 to 7.
You can enter up to four different values, separated by a space.
Command Default
IP precedence values are not configured as the match criteria.
Command Modes
Class-map configuration mode (config-cmap)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
You can enter up to four matching criteria, separated by a space, in
one
match ip precedence
statement.
Examples
The following example shows how to configure a class-map named ipp5, and enter a match statement for IP precedence 5:
Router# enable
Router# configure terminal
Router(config)# class-map ipp5
Router(config-cmap)# match ip precedence 5
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
policy-map
Creates or modifies a policy-map that can be attached to one or more targets to specify a service policy.
service-policy (service configuration)
Attaches a policy-map to an input or an output target.
show class-map
Displays all class-maps and their matching criteria.
set ip precedence
Marks the precedence value in the IP header with a value between 0 to 7.
match cos
To match a packet on the basis of a Layer 2 class of service (CoS) marking, use the match cos command in class-map configuration mode. To remove a specific Layer 2 CoS marking as a match criterion, use the no form of this command.
match coscos-number
no match coscos-number
Syntax Description
cos-number
Packet CoS bit value. Specifies that the packet CoS bit value must match the specified CoS value. The value can range from 0 to 7.
You can enter up to four different values, separated by a space.
Command Default
Packets are not matched on the basis of a Layer 2 CoS marking.
Command Modes
Class-map configuration (config-cmap)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
You can enter up to four matching criteria, separated by a space, in
one
match cos
statement.
Examples
The following example shows a logical OR operation in a child policy with match cos and class-default in a parent class.
Router(config)# class-map match-any childOR
Router(config-cmap)# match cos 5
Router(config)# policy-map testchildOR
Router(config-pmap)# class childOR
Router(config-pmap-c)# police cir percent 10
Router(config)# policy-map parentOR
Router(config-pmap)# class class-default
Router(config-pmap-c)# police cir percent 20
Router(config-pmap-c)# service-policy testchildOR
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show class-map
Displays all class-maps and their matching criteria.
set cos
Sets the Layer 2 CoS value of an outgoing packet.
service-policy (service configuration)
Attaches a policy-map to an input or an output target.
match ip dscp
To specify one or more differentiated service code point (DSCP) values as a match criterion, use the match ip dscp command in the class-map configuration mode. To remove a specific DSCP value from a class map, use the no form of this command.
match [ip] dscpip- dscp-value
no match [ip] dscpip- dscp-value
Syntax Description
ip
(Optional) Specifies that the match is for IPv4 packets.
ip- dscp-value
IP DSCP value. The value can range from 0 to 63.
You can enter up to eight different values, separated by a space.
Command Default
DSCP values are not configured as the match criteria.
Command Modes
Class-map configuration mode (config-cmap)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
You can enter up to eight IP DSCP values, separated by a space, in
one
match ip dscp
statement.
Examples
The following example shows how to set multiple match criteria; in this case, two IP DSCP value:
Router# enable
Router# configure terminal
Router(config)# class-map ipdscp5
Router(config-cmap)# match ip dscp 1 5
Related Commands
Command
Description
class-map
Creates a class map to be used for matching packets to a specified class.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
service-policy
Attaches a policy map to an input or an output target.
show class-map
Displays all class-maps and their matching criteria.
set ip dscp
Marks the precedence value in the IP header with a value between 0 to 63.
match mpls experimental topmost
To match the Multiprotocol Label Switching (MPLS) experimental (EXP) value in the topmost label header, use the match mpls experimental topmost command in the class-map configuration mode. To remove the EXP match criterion, use the no form of this command.
match mpls experimental topmostexp-value
no match mpls experimental topmostexp-value
Syntax Description
exp-value
MPLS EXP value in the topmost label.
You can enter up to eight different values, separated by a space.
Command Default
MPLS EXP values are not configured as the match criteria.
Command Modes
Class-map configuration (config-cmap)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
Ingress marking of the MPLS EXP bit for MPLS traffic is not supported. Egress MPLS EXP marking is supported only in the interface mode of an MPLS interface.
Examples
The following example shows how to match the MPLS EXP value 3 in the topmost label header:
Router(config-cmap)# match mpls experimental topmost 3
Related Commands
Command
Description
platform set mpls-exp-topmost from qos-group, discard-class table
(Only for VPWS initiation and LSR scenarios) Maps the MPLS-EXP value from the table map.
match qos-group
To match a packet on the basis of traffic class represented by the qos-group, use the match qos-group command in the class-map configuration mode. To remove the group-group value, use the no form of this command.
match qos-groupqos-group-value
no match qos groupqos-group-value
Syntax Description
qos-group-value
Matches a packet on the basis of traffic class represented by the qos-group. The value can range from 0 to 7.
Command Default
A qos-group is not configured as the match criteria.
Command Modes
Class-map configuration (config-cmap)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
The match qos-group command is used by the class-map to identify a specific QoS group value marking on a packet. This command is supported only at the egress.
Examples
The following example shows a logical OR operation in a child policy with match qos-group and class-default in a parent class.
Router# enable
Router# configure terminal
Router(config)# class-map match-any childOR
Router(config-cmap)# match qos-group 1
Router(config)# policy-map testchildOR
Router(config-pmap)# class childOR
Router(config-pmap-c)# shape average 100000000
Router(config)# policy-map parentOR
Router(config-pmap)# class class-default
Router(config-pmap-c)# shape average 500000000
Router(config-pmap-c)# service-policy testchildOR
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
class-name {class-name | class-default }
Specifies the name of the class whose policy you want to create or change
policy-map
Creates or modifies a policy-map that can be attached to one or more targets to specify a service policy.
platform
To associate table maps at the egress to an interface for Virtual Private Wire Service (VPWS) initiation and Label Switching Router (LSR) scenarios use the platform set mpls-exp-topmost from qos-group, discard-class tabletable-map-name command in the service configuration mode.
To remove the table maps from the interface at egress, use the no form of the command.
platform set mpls-exp-topmost from qos-group, discard-class tabletable-map-name
no platform set mpls-exp-topmost from qos-group, discard-class tabletable-map-name
To associate table maps at the egress to an interface for Virtual Private Wire Service (VPWS) termination use the platform set cos from qos-group, discard-class tabletable-map-name table-map-name command in the service configuration mode.
To remove the table maps from the interface at egress, use the no form of the command .
platform set cos from qos-group, discard-class tabletable-map-name
no platform set cos from qos-group, discard-class tabletable-map-name
Syntax Description
set mpls-exp-topmost from qos-group, discard-class
(Only for VPWS initiation and LSR scenarios) Maps the Multiprotocol Label Switching (MPLS) experimental (EXP) value from the table map.
set cos from qos-group, discard-class
(Only for VPWS termination scenario) Maps the VLAN CoS value from the table map.
tabletable-map-name
Indicates the use of table-map.
table-map-name —Name of the table-map.
Command Default
The table-maps are not associated to the interface.
Command Modes
Service configuration mode (config-if-srv-instance).
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
This command is used only during the VPWS initiation, LSR, and VPWS termination scenarios. The platform set cos from qos-group command is accepted at the service instance level.
Examples
The following example shows how to map the MPLS-EXP value for VPWS initiation (that is, the frame contains MPLS header):
Router(config)# int tenGigabitEthernet 4/4
Router(config-if)# service-policy output egresspolicy1
Router(config-if)# platform set mpls-exp-topmost from qos-group, discard-class table test_table
The following example shows how to map the VLAN CoS value for VPWS termination where the MPLS header is removed from the frame. The platform set cos from qos-group command is accepted at the service instance level.
Router(config)# int tenGigabitEthernet 4/4
Router(config-if)# service-policy output egresspolicy1
Router(config-if)# service instance 200 ethernet
Router(config-if-srv-instance)# platform set cos from qos-group, discard-class table test_table
Related Commands
Command
Description
class-map
Creates a class map to be used for matching packets to a specified class.
class-name
Specifies the name of the class whose policy you want to create or change.
map fromfrom-value1, from-value2toto-value
Maps the QoS-group and discard values to the MPLS EXP or VLAN COS bit.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show table-map
Displays the configuration of a specified table map or all table maps.
set qos-group
Marks a QoS group identifier (ID) with a value between 0 to 7 that can be used later to classify packets.
set discard-class
Sets the discard-class internal label to a specified value between 0 to 2. This command is supported only during table-map creation.
service-policy
Attaches a policy map to an input or an output target.
table-map
Creates or specifies the name of the table map.
police (policy map)
To create a policer and configure the policy-map class to use it, use the police command in policy-map class configuration mode. To delete the policer from the policy-map class, use the no form of this command.
Specifies the committed information rate (CIR) used for policing traffic.
rate
Specifies the police rate used for policing traffic.
bps value
Average rate in bits per second. The valid values range from 8000 to 10000000000 seconds.
bc
Specifies the committed (conform) burst size used for policing traffic.
burst
Specifies the burst size used for policing traffic.
bc
Committed (conform) burst size or burst size in bytes. The valid values range from 1000 to 256000000.
Note
The burst size must be in milli-seconds or micro-seconds while using police
(percent) command.
pir
Specifies the peak information rate (PIR) used for policing traffic.
peak-rate
Specifies the peak rate used for policing traffic.
pir
Peak information rate or peak rate in bits per second. The valid values range from 8000 to 10000000000 seconds.
be
Specifies the excess burst size used for policing traffic.
peak-burst
Specifies the peak-burst size used for policing traffic.
be
Excess burst size or peak-burst size in bytes. The valid values range from 1000 to 256000000 bytes.
Note
The burst size must be in milli-seconds or micro-seconds while using police
(percent) command.
conform-action
Action to take on packets whose rate is less than the conform burst. You must specify a value for peak-burst-in-msec before you specify the conform-action.
exceed-action
Action to take on packets whose rate is within the conform and conform plus exceed burst.
violate-action
Action to take on packets whose rate exceeds the conform plus exceed burst. You must specify the exceed-action before you specify the violate-action.
action
Action taken on a packet when it conforms, exceeds, or violates the interface bandwidth:
transmit—Transmits the packet
drop—Drops the packet
set-discard-class-transmit—Sets the discard-class internal label to a specified value and transmits the packet. This action is effective only when egress QoS marking of an MPLS or VPWS traffic is achieved using table-maps.
set-cos-transmit—Sets the CoS value and transmits the packet.
set-dscp-transmit—Sets the IP DSCP value and transmit the packet.
set-precedence-transmit—Sets the IP precedence value and transmits the packet.
set-qos-transmit—Sets the QoS-group value and transmits the packet.
percent
Indicates that a percentage of bandwidth is used for calculating CIR or rate.
%
CIR or rate bandwidth percentage. The valid values range from 1 to 100.
Command Default
Policing is not configured.
Command Modes
Policy-map class configuration (config-pmap-c)
Command History
Release
Modification
9.3.0
This command was introduced
Usage Guidelines
The police command specifies the maximum bandwidth used by a traffic class through the use of a token bucket algorithm. The police (percent) command calculates the CIR on the basis of a percentage of the maximum amount of bandwidth available on the interface. When a policy map is attached to the interface, the equivalent CIR value in bits per second (bps) is calculated on the basis of the interface bandwidth and the percent value entered with this command. The police (two-rate) command configures traffic policing using two-rates, the CIR and the PIR.
Examples
The following example shows how to configure a dual rate, 3-color policer:
Router(config)# policy-map 2r3c
Router(config-pmap)# class class-default
Router(config-pmap-c)# police cir 2000000 pir 3000000
Router(config-pmap-c-police)# conform-action set-prec-transmit 3
Router(config-pmap-c-police)# exceed-action set-prec-transmit 2
Router(config-pmap-c-police)# violate-action set-prec-transmit 1
Router(config-pmap-c-police)# end
Router#
The following example shows how to configure a single rate, 2-color policer with percent:
Router(config)# policy-map 1r2c_percent
Router(config-pmap)# class class-default
Router(config-pmap-c)# police cir percent 20
Router(config-pmap-c-police)# conform-action set-cos-transmit 0
Router(config-pmap-c-police)# exceed-action drop
Router(config-pmap-c-police)# end
Router#
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
class-name {class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show policy-map
Displays the policy-map information.
policy-map
To enter policy-map configuration mode and create or modify a policy map that can be attached to one or more targets to specify a service policy, use the policy-map command in the global configuration mode. To delete a policy map, use the no form of this command.
policy-mappolicy-map-name
Syntax Description
policy-map-name
Policy map name. This is the name of the policy map and can have a maximum of 40 alphanumeric characters.
Command Default
The policy map is not configured.
Command Modes
Global configuration (config)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
Use the policy-map command to specify the name of the policy map to be created, added, or modified before you configure policies for classes whose match criteria are defined in a class map. The policy-map command enters policy-map configuration mode, in which you can configure or modify the class policies for a 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 match criteria for a class.
Examples
The following example shows how to configure policing actions:
Configures traffic policing using two rates (CIR and PIR).
show policy-map
Displays the policy-map information.
service-policy
Attaches a policy map to an input or an output target.
priority
To give priority to a class of traffic belonging to a policy map, use the priority command in the policy-map class configuration mode. To remove a previously specified priority for a class, use the no form of this command.
priority [bandwidth-value] [ percentx%]
no priority [bandwidth-value] [ percentx%]
Syntax Description
bandwidth value
Maximum bandwidth uses by a traffic class through the use of a token bucket algorithm. The bandwidth value is in kbps, and can range from 1 to 10000000.
percent
Specifies that the amount of guaranteed bandwidth is specified by the percentage of available bandwidth.
x%
Rate of traffic that is given low latency handling of x% of the parent interface bandwidth or x% parent class committed information rate (CIR) if policy not applied on an interface. The percentage can be a number from 1 to 100.
Command Default
Priority is not set.
Command Modes
Policy-map class configuration (config-pmap-c)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
The priority command enables the rate-limit option to ensure that a particular rate is not exceeded. However, in the CPT system, egress rate limiting is achieved using shapers that can cause additional delays. Hence it is advised to ensure that for low latency queuing traffic, rate limiting is done at ingress, and the rates specified at egress are just placeholders and are never hit. Hitting the rate limit at egress would mean increased latencies for low latency queuing traffic. The priority command is supported only under class-map with match qos-group 3 or 7 and multicast-priority class.
Examples
The following example shows how to configure priority queue at the egress:
Router# config terminal
Router(config)# policy-map Test1
Router(config-pmap)# class Test
Router(config-pmap-c)# priority 10000
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
class-name { class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show policy-map interface
Displays the statistics and the configurations of the input and output policies that are attached to an interface.
show policy-map
Displays the policy-map information.
service-policy
To attach a traffic policy to a target and to specify the direction in which the policy should be applied (either on packets coming into the target or packets leaving the target), use the service-policy configuration command. Only one traffic policy can be applied to an interface in a given direction. To detach a traffic policy from a target, use the no form of this command.
service-policy {input | output}policy-map-name
no service-policy {input | output}policy-map-name
Syntax Description
input
Attaches the policy-map to the input target.
output
Attaches the policy-map to the output target.
policy-map-name
Name of a service policy map (created using the policy-map command) to be attached. The name can be a maximum of 40 alphanumeric characters.
Command Default
A service policy is not specified nor a policy map is attached.
Command Modes
Service configuration mode (config-if-srv-instance).
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
The input and output keywords indicate the direction in which the policy map is applied. The value for the policy-map-name argument represents a quality of service (QoS) policy map configured on the CPT system using the policy-mappolicy-map-name global configuration command. The policy-map must already exist and must contain the QoS feature to be applied to the target, according to the provisions specified by the service level agreement (SLA).
Examples
The following example shows how to attach a traffic policy to a target:
Router# enable
Router# configure terminal
Router(config)# interface TenGigabitEthernet 4/1
Router(config-if)# service instance 100 ethernet
Router(config-if-srv-instance)# service-policy input policy1
Router(config-if-srv-instance)# end
The following example shows how to remove a traffic policy from a target:
Router# enable
Router# configure terminal
Router(config)# interface TenGigabitEthernet 4/1
Router(config-if)# service instance 100 ethernet
Router(config-if)# no service-policy input policy1
Router(config-if)# end
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
class-name {class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show policy-map interface
Displays the statistics and the configurations of the input and output policies that are attached to an interface.
show policy-map
Displays the policy-map information.
set cos
To set the Layer 2 class of service (CoS) value of a packet, use the set cos command in the policy-map class configuration mode. To remove a specific CoS value setting, use the no form of this command.
set coscos-value
no set cos
Syntax Description
cos-value
CoS value between 0 to 7 in an 802.1Q tagged frame.
Command Default
This command is disabled by default.
Command Modes
Policy-map class configuration (config-pmap-c)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
For Multiprotocol Label Switching (MPLS) traffic flows, the set cos command can be used only in service policies that are attached in the output direction of an interface. Packets entering an interface cannot be set with a CoS value.
For Ethernet virtual circuit (EVC) traffic flows, the set cos command can be used only in service policies that are attached in the input direction of an interface.
Examples
The following example shows how to create a service policy called policy1. This service policy is associated to a previously defined classification policy through the use of the class command. This example assumes that a classification policy called class1 was previously configured. This example configures marking to set the cos value:
Router# enable
Router# configure terminal
Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)# set cos 1
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
class-name {class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
set ip precedence
Marks the IP precedence in the ToS byte with a value between 0 to 7.
set ip dscp
Marks the IP DSCP in the ToS byte with a value between 0 to 63.
set qos group
Marks a QoS group ID with a value between 0 to 7 that can be used later to classify packets.
set discard-class
Sets the discard-class internal label to a specified value between 0 to 2. This command is supported only during table-map creation.
set discard-class
To mark a packet with a discard-class value, use the set discard-class command in policy-map class configuration mode. To remove the marked discard-class value of a packet, use the no form of this command.
set discard-classvalue
no set discard-classvalue
Syntax Description
value
Discard-class internal label to a specified value. This is a value specified between 0 to 2. This command is supported only during table-map creation.
Command Default
This command is disabled by default.
Command Modes
Policy-map class configuration (config-pmap-c)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
This command is supported only during table-map creation.
Examples
The following example shows the usage of set discard-class command:
!Ingress policy-map for pseudo-wire initiation
policy-map IngressPolicyMap
class IngressClassmap1
set qos-group 1
set discard-class 0
class IngressClassmap2
set qos-group 2
set discard-class 1
class IngressClassmap3
set qos-group 3
set discard-class 2
class IngressClassmap4
set qos-group 4
set discard-class 0
Related Commands
Command
Description
class-map
Creates a class map to be used for matching packets to a specified class.
class-name {class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
map fromfrom-value1, from-value2toto-value
Maps the QoS-group and discard values to the MPLS EXP or VLAN COS bit.
platform set mpls-exp-topmost from qos-group, discard-class tabletable-map-name
(Only for VPWS initiation and LSR scenarios) Maps the MPLS-EXP value from the table map.
platform set cos from qos-group, discard-class tabletable-map-name
(Only for VPWS termination scenario) Maps the VLAN CoS value from the table map.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
set qos-groupqos group value
Marks a QoS group identifier (ID) with a value between 0 to 7 that can be used later to classify packets.
service-policy
Attaches a policy map to an input or an output target.
table-maptable-map-name
Creates or specifies the name of the table map.
set ip dscp
To mark a packet by setting the IP differentiated services code point (DSCP) value in the type of service (ToS) byte, use the set ip dscp command in policy-map class configuration mode. To remove a previously set IP DSCP value, use the no form of this command.
set ip dscpip-dscp-value
no set ip dscp
Syntax Description
ip-dscp-value
Marks the IP DSCP in the ToS byte with a value between 0 to 63.
Command Default
This command is disabled by default.
Command Modes
Policy-map class configuration (config-pmap-c)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
The set ip dscp command cannot be used with the set ip precedence
command to mark the same packet. The
two values, DSCP and precedence, are mutually exclusive. A packet
can have one value or the other, but
not both.
Examples
The following example shows the creation of a service policy called policy1. This service policy is associated to a previously defined classification policy through the use of the class command. This example assumes that a classification policy called class1 was previously configured. This example configures marking to set the IP DSCP value:
Router# enable
Router# configure terminal
Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)# set ip dscp 7
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
class-name { class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
set cos
Marks the CoS value between 0 to 7 in an 802.1Q tagged frame
set ip precedence
Marks the IP precedence in the ToS byte with a value between 0 to 7.
set qos group
Marks a QoS group ID with a value between 0 to 7 to classify packets.
set discard-class
Sets the discard-class internal label to a specified value between 0 to 2. This command is supported only during table-map creation.
set ip precedence
To set the precedence value in the IP header, use the set ip precedence command in the policy-map class configuration mode. To leave the precedence value at the current setting, use the no form of this command.
set ip precedence ip-precedence-value
no set ip precedence
Syntax Description
ip-precedence-value
Marks the precedence value in the IP header with a value between 0 to 7.
Command Default
This command is disabled by default.
Command Modes
Policy-map class configuration (config-pmap-c)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
The set ip precedence command cannot be used with the set ip dscp
command to mark the same packet. The
two values, DSCP and precedence, are mutually exclusive. A packet
can have one value or the other, but
not both.
Examples
The following example shows the creation of a service policy called policy1. This service policy is associated to a previously defined classification policy through the use of the class command. This example assumes that a classification policy called class1 was previously configured. This example configures marking to set the IP precedence value:
Router# enable
Router# configure terminal
Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)# set ip precedence 1
Related Commands
Command
Description
class-map
Creates a class map to be used for matching packets to a specified class.
class-name { class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
set coscos value
Marks the CoS value between 0 to 7 in an 802.1Q tagged frame.
set ip dscpip dscp value
Marks the IP DSCP in the ToS byte with a value between 0 to 63.
set qos groupqos group value
Marks a QoS group identifier (ID) with a value between 0 to 7 that can be used later to classify packets.
set discard-classvalue
Sets the discard-class internal label to a specified value between 0 to 2. This command is supported only during table-map creation.
set qos-group
To set a quality of service (QoS) group ID to classify packets, use the set qos-group command in the policy-map class configuration mode. To remove the group ID, use the no form of this command.
set qos-groupqos-group-value
no set qos-groupqos-group-value
Syntax Description
qos-group-value
Marks a QoS group identifier (ID) with a value between 0 to 7 is used to classify packets.
Command Default
This command is disabled by default.
Command Modes
Policy-map class configuration (config-pmap-c)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
The set qos-group command enables you to associate a group ID with a packet.
Examples
The following example shows the creation of a service policy called policy1. This service policy is associated to a previously defined classification policy through the use of the class command. This example assumes that a classification policy called class1 was previously configured. This example configures marking to set the qos-group value:
Router# enable
Router# configure terminal
Router(config)# policy-map policy1
Router(config-pmap)# class class1
Router(config-pmap-c)# set qos-group 1
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
class-name {class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
set cos
Marks the CoS value between 0 to 7 in an 802.1Q tagged frame.
set ip dscp
Marks the IP DSCP in the ToS byte with a value between 0 to 63.
set ip precedence
Marks the IP precedence in the ToS byte with a value between 0 to 7.
set discard-class
Sets the discard-class internal label to a specified value between 0 to 2. This command is supported only during table-map creation.
shape
To control the traffic going out of an interface in order to match its flow to the speed of the remote target interface and to ensure that the traffic conforms to policies contracted for it, use the shape command in the policy-map class configuration mode. To remove shaping and leave the traffic unshaped, use the no form of this command.
The following example shows how the shape average command is applied at the parent level of an H-QoS policy-map:
Router# enable
Router# configure terminal
Router(config)# policy-map child2
Router(config-pmap)# class test
Router(config-pmap-c)# shape average 100000000
Router(config)# policy-map parent
Router(config-pmap)# class class-default
Router(config-pmap-c)# shape average 300000000
Router(config-if)# service-policy child2
Related Commands
Command
Description
class-map
Creates a class map to be used for matching packets to a specified class.
class-name { class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show policy-map interface
Displays the statistics and the configurations of the input and output policies that are attached to an interface.
show policy-map
Displays the policy-map information.
show class-map
To display class maps and their matching criteria, use the show class-map command in user EXEC or privileged EXEC mode.
show class-map [class-map-name]
Syntax Description
class-map-name
(Optional) Name of the class-map. The class-map name can be a maximum of 40 alphanumeric characters.
Command Default
All class maps are displayed.
Command Modes
User EXEC (>), Privileged EXEC (#)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
You can use the show class-map command to display all class maps and their matching criteria. If you enter the optional class-map-name argument, the specified class map and its matching criteria will be displayed.
Examples
The following is a sample output from the show class-map command displaying a specific class map:
Router# show class-map ipp5
class Map match-any ipp5 (id 1)
match ip precedence 5
Related Commands
Command
Description
class-map
Creates a class map to be used for matching packets to a specified class.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show policy-map
Displays the configuration of all classes for a specified service policy map or all classes for all existing policy maps.
show policy-map
To display the configuration of all classes for a specified service policy map or of all classes for all existing policy maps, use the show policy-map command in user EXEC or privileged EXEC mode.
show policy-map [policy-map-name]
Syntax Description
policy-map
(Optional) Name of the service policy map whose complete configuration is to be displayed. The name can be a maximum of 40 characters.
Command Default
All existing policy map configurations are displayed.
Command Modes
User EXEC (>) and Privileged EXEC (#)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
The show policy-map command displays the configuration of a policy map created using the policy-map command. You can use the show policy-map command to display all class configurations comprising any existing service policy map, whether or not that policy map has been attached to an interface.
Examples
The following is a sample output from the show policy-map command that displays police actions on separate lines:
Router# show policy-map Premium
Policy Map Premium
Class P1
priority
police percent 50 25 ms 0 ms
conform-action transmit
exceed-action transmit
violate-action drop
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show policy-map class
To display the configuration for the specified class of the specified policy map, use the show policy-map class command in user EXEC or privileged EXEC mode.
show policy-mappolicy-map-nameclassclass-name
Syntax Description
policy-map-name
Name of a policy map that contains the class configuration to be displayed.
class-name
Name of the class whose configuration is to be displayed.
Command Default
This command displays the class configuration for any service policy map.
Command Modes
User EXEC (>), Privileged EXEC (#)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
You can use the show policy-map class command to display any single class configuration for any service policy map, whether or not the specified service policy map has been attached to an interface.
Examples
The following is a sample output from the show policy-map class command displaying configurations for the class called class7 that belongs to the policy map called po1:
Router# show policy-map po1 class class7
Class class7
Bandwidth 937 (kbps) Max Thresh 64 (packets)
Related Commands
Command
Description
class-map
Creates a class-map to be used for matching packets to a specified class.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show policy-map
Displays the configuration of all classes for a specified service policy map or all classes for all existing policy maps.
show policy-map interface
To display the statistics and the configurations of the input and output policies that are attached to an interface, use the show policy-map interface command in user EXEC or privileged EXEC mode.
show policy-map interfaceinterface-type interface-number
Syntax Description
interface-type
Type of interface
interface-number
Interface number.
Command Default
This command displays the packet statistics of all classes that are configured for all service policies on the specified interface.
Command Modes
Privileged EXEC (#)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
The show policy-map interface command displays the packet statistics for classes on the specified policy-map interface only if a service policy has been attached to the interface.
Examples
The following is a sample output from the show policy-map interface command:
Creates a class-map to be used for matching packets to a specified class.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
show policy-map
Displays the configuration of all classes for a specified service policy map or all classes for all existing policy maps.
table-map (value mapping)
To create a table-map that is used for mapping the values from qos-group and discard-class to the Multiprotocol Label Switching (MPLS) experimental (EXP) or Ethernet class of service (CoS) bit at egress use the table-map (value mapping) command in the global configuration mode. To disable the use of this table map, use the no form of this command. .
no table-maptable-map-namemap fromfrom-value1, from-value2toto-value
Syntax Description
table-map-name
Name of the table-map. This can have a maximum of 40 alphanumeric characters.
map from
Indicates that a “map from” value is used. Maps the qos-group and discard values to the MPLS EXP or VLAN CoS bit.
from-value1
Value of the qos-group, which can range from 0 to 7.
from-value2
Value of the discard class, which can range from 0 to 2.
to
Indicates that a “map to” value is used. Maps the QoS-group and discard values to the MPLS EXP or VLAN CoS bit.
to-value
Value of the MPLS EXP or VLAN CoS bits, which can range from 0 to 7.
Command Default
Table-map is not configured.
Command Modes
Global configuration (config)
Command History
Release
Modification
9.3.0
This command was introduced.
Usage Guidelines
If a table-map is not attached, the MPLS EXP or the VLAN COS bit is set to zero. Also, the system default setting is zero.
Examples
The following example shows how to create a table map that contains multiple entries.
Router# enable
Router# configure terminal
Router(config)# table-map test_table
Router(config-tablemap)# map from 0,2 to 2
Router(config-tablemap)# map from 0,0 to 0
Related Commands
Command
Description
class-map
Creates a class map to be used for matching packets to a specified class.
class-name {class-name | class-default }
Specifies the name of the class whose policy you want to create or change.
policy-map
Creates or modifies a policy map that can be attached to one or more targets to specify a service policy.
platform set mpls-exp-topmost from qos-group, discard-class table
(Only for VPWS initiation and LSR scenarios) Maps the MPLS-EXP value from the table map.
platform set cos from qos-group, discard-class table
(Only for VPWS termination scenario) Maps the VLAN CoS value from the table map.
show table-map
Displays the configuration of a specified table map or all table maps.
set qos-group
Marks a QoS group ID with a value between 0 to 7 that can be used later to classify packets.
set discard-class
Sets the discard-class internal label to a specified value between 0 to 2. This command is supported only during table-map creation.