Table Of Contents
QoS: Percentage-Based Policing
Prerequisites for QoS: Percentage-Based Policing
Restrictions for QoS: Percentage-Based Policing
Information About QoS: Percentage-Based Policing
Benefits for QoS: Percentage-Based Policing
Defining Class and Policy Maps for QoS: Percentage-Based Policing
Traffic Regulation Mechanisms and Bandwidth Percentages
Specifying Burst Size in Milliseconds Option
How to Configure QoS: Percentage-Based Policing
Configuring a Class and Policy Map
Attaching the Policy Map to an Interface
Configuration Examples for QoS: Percentage-Based Policing
Specifying Traffic Policing on the Basis of a Bandwidth Percentage: Example
Verifying the Configuration: Example
QoS: Percentage-Based Policing
The QoS: Percentage-Based Policing feature allows you to configure traffic policing and traffic shaping on the basis of a percentage of bandwidth available on the interface. This feature also allows you to specify the committed burst (bc) size and the excess burst (be) size (used for configuring traffic policing) in milliseconds (ms). Configuring traffic policing in this manner enables you to use the same policy map for multiple interfaces with differing amounts of bandwidth.
Feature History for QoS: Percentage-Based Policing
Finding Support Information for Platforms and Cisco IOS Software Images
Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.
Contents
•
Prerequisites for QoS: Percentage-Based Policing
•
Restrictions for QoS: Percentage-Based Policing
•
Information About QoS: Percentage-Based Policing
•
How to Configure QoS: Percentage-Based Policing
•
Configuration Examples for QoS: Percentage-Based Policing
Prerequisites for QoS: Percentage-Based Policing
•
For input traffic policing on a Cisco 7500 series router, verify that distributed Cisco Express Forwarding (dCEF) is enabled on the interface on which traffic policing is configured.
•
For output traffic policing on a Cisco 7500 series router, ensure that the incoming traffic is dCEF-switched. Traffic policing cannot be used on the switching path unless dCEF switching is enabled.
Restrictions for QoS: Percentage-Based Policing
The shape (percent) command, when used in "child" (nested) policy maps, is not supported on the Cisco 7500, the Cisco 7200, or lower series routers. Therefore, the shape (percent) command cannot be configured for use in nested policy maps on these routers.
Information About QoS: Percentage-Based Policing
To configure QoS: Percentage-Based Policing, you need to understand the following concepts:
•
Benefits for QoS: Percentage-Based Policing
•
Defining Class and Policy Maps for QoS: Percentage-Based Policing
•
Traffic Regulation Mechanisms and Bandwidth Percentages
•
Specifying Burst Size in Milliseconds Option
Benefits for QoS: Percentage-Based Policing
Increased Flexibility and Ease-of-Use
This feature provides the ability to configure traffic policing and traffic shaping on the basis of a percentage of bandwidth available on an interface, and it allows you to specify burst sizes in milliseconds. Configuring traffic policing and traffic shaping in this manner enables you to use the same policy map for multiple interfaces with differing amounts of bandwidth. That is, you do not have to recalculate the bandwidth for each interface or configure a different policy map for each type of interface.
Defining Class and Policy Maps for QoS: Percentage-Based Policing
To configure the QoS: Percentage-Based Policing feature, you must define a traffic class, configure a policy map, and then attach that policy map to the appropriate interface. These three tasks can be accomplished by using the Modular Quality of Service (QoS) Command-Line Interface (CLI) (MQC).
The MQC is a command-line interface that allows you to define traffic classes, create and configure traffic policies (policy maps), and then attach these traffic policies to interfaces.
In the MQC, the class-map command is used to define a traffic class (which is then associated with a traffic policy). The purpose of a traffic class is to classify traffic.
The MQC consists of the following three processes:
•
Defining a traffic class with the class-map command.
•
Creating a traffic policy by associating the traffic class with one or more QoS features (using the policy-map command).
•
Attaching the traffic policy to the interface with the service-policy command.
A traffic class contains three major elements: a name, a series of match commands, and, if more than one match command exists in the traffic class, an instruction on how to evaluate these match commands (that is, match-all or match-any). The traffic class is named in the class-map command line; for example, if you enter the class-map cisco command while configuring the traffic class in the CLI, the traffic class would be named "cisco".
The match commands are used to specify various criteria for classifying packets. Packets are checked to determine whether they match the criteria specified in the match commands. If a packet matches the specified criteria, that packet is considered a member of the class and is forwarded according to the QoS specifications set in the traffic policy. Packets that fail to meet any of the matching criteria are classified as members of the default traffic class.
Traffic Regulation Mechanisms and Bandwidth Percentages
Cisco IOS quality of service (QoS) offers two kinds of traffic regulation mechanisms—traffic policing and traffic shaping. A traffic policer typically drops traffic that violates a specific rate. A traffic shaper typically delays excess traffic using a buffer to hold packets and shapes the flow when the data rate to a queue is higher than expected.
Traffic shaping and traffic policing can work in tandem and can be configured in a class map. Class maps organize data packets into specific categories ("classes") that can, in turn, receive a user-defined QoS treatment when used in policy maps (sometimes referred to as "service policies").
Before this feature, traffic policing and traffic shaping were configured on the basis of a user-specified amount of bandwidth available on the interface. Policy maps were then configured on the basis of that specific amount of bandwidth, meaning that separate policy maps were required for each interface.
This feature provides the ability to configure traffic policing and traffic shaping on the basis of a percentage of bandwidth available on the interface. Configuring traffic policing and traffic shaping in this manner enables customers to use the same policy map for multiple interfaces with differing amounts of bandwidth.
Configuring traffic policing and shaping on the basis of a percentage of bandwidth is accomplished by using the police (percent) and shape (percent) commands. For more information about these commands, see the "Command Reference" section later in this document.
Specifying Burst Size in Milliseconds Option
The purpose of the burst parameters (bc and be) is to drop packets gradually, as is done with Weighted Random Early Detection (WRED), and to avoid tail drop. Setting sufficiently high burst values helps to ensure good throughput.
This feature allows you the option of specifying the committed burst (bc) size and the extended burst (be) as milliseconds (ms) of the class bandwidth when you configure traffic policing. The number of milliseconds is used to calculate the number of bytes that will be used by the QoS: Percentage-Based Policing feature.
Specifying these burst sizes in milliseconds is accomplished by using the bc and be keywords (and their associated arguments) of the police (percent) and shape (percent) commands.
For more information about these commands, see the "Command Reference" section later in this document.
How to Configure QoS: Percentage-Based Policing
See the following sections for configuration tasks for the QoS: Percentage-Based Policing and Shaping feature. Each task in the list is identified as either required or optional.
•
Configuring a Class and Policy Map (required)
•
Attaching the Policy Map to an Interface (required)
•
Verifying the Configuration (optional)
Configuring a Class and Policy Map
A class map is used to organize traffic into specific categories or classes. These categories or classes of traffic are associated with a traffic policy or policy map. In turn, the policy map is used in conjunction with the class map to apply a specific QoS feature to the traffic. In this instance, the QoS feature of percentage-based policing will be applied.
To configure a class map and associate the class map with a specific policy map, perform the following steps.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
policy-map policy-name
4.
class {class-name | class-default}
5.
police cir percent percentage [burst-in-ms] [bc conform-burst-in-msec ms] [be peak-burst-in-msec ms] [pir percent percent]
6.
exit
DETAILED STEPS
Attaching the Policy Map to an Interface
After a policy map is created, the next step is to attach the policy map to an interface. Policy maps can be attached to either the input or output direction of the interface.
![]()
Note
Depending on the needs of your network, you may need to attach the policy map to a subinterface, an ATM PVC, a Frame Relay DLCI, or other type of interface.
To attach the policy map to an interface, perform the following steps.
SUMMARY STEPS
1.
enable
2.
configure terminal
3.
interface type number
4.
pvc [name] vpi/vci [ilmi | qsaal | smds]
5.
service-policy {input | output} policy-map-name
6.
exit
DETAILED STEPS
Command or Action PurposeStep 1
enable
Example:Router> enable
Enables privileged EXEC mode.
•
Enter your password if prompted.
Step 2
configure terminal
Example:Router# configure terminal
Enters global configuration mode.
Step 3
interface type number
Example:Router(config)#
interface s4/0
Configures an interface (or subinterface) type and enters interface configuration mode.
•
Enter the interface type number.
Step 4
pvc [name] vpi/vci [ilmi | qsaal | smds]
Example:Router(config-if)# pvc cisco 0/16 ilmi
(Optional) Creates or assigns a name to an ATM PVC and specifies the encapsulation type on an ATM PVC. Enters ATM VC configuration mode.
Note
This step is required only if you are attaching the policy map to an ATM PVC. If you are not attaching the policy map to an ATM PVC, skip this step and proceed with Step 5.
Step 5
service-policy {input | output} policy-map-name
Example:Router(config-if)#
service-policy input policy1
Specifies the name of the policy map to be attached to the input or output direction of the interface.
Note
Policy maps can be configured on ingress or egress routers. They can also be attached in the input or output direction of an interface. The direction (input or output) and the router (ingress or egress) to which the policy map should be attached varies according your network configuration. When using the service-policy command to attach the policy map to an interface, be sure to choose the router and the interface direction that are appropriate for your network configuration.
•
Enter the policy map name.
Step 6
exit
Example:Router(config-if)# exit
(Optional) Exits interface configuration mode.
Verifying the Configuration
To verify the configuration, perform the following steps.
SUMMARY STEPS
1.
enable
2.
show class-map [class-map-name]
or
show policy-map interface interface-name
3.
exit
DETAILED STEPS
Troubleshooting Tips
The commands in the "Verifying the Configuration" section allow you to verify that you achieved the intended configuration and that the feature is functioning correctly. If, after using the show commands listed above, you find that the configuration is not correct or the feature is not functioning as expected, perform these operations:
If the configuration is not the one you intended, complete the following procedures:
1.
Use the show running-config command and analyze the output of the command.
2.
If the policy map does not appear in the output of the show running-config command, enable the logging console command.
3.
Attach the policy map to the interface again.
If the packets are not being matched correctly (for example, the packet counters are not incrementing correctly), complete the following procedures:
1.
Run the show policy-map command and analyze the output of the command.
2.
Run the show running-config command and analyze the output of the command.
3.
Use the show policy-map interface command and analyze the output of the command. Check the the following findings:
a.
If a policy map applies queueing, and the packets are matching the correct class, but you see unexpected results, compare the number of the packets in the queue with the number of the packets matched.
b.
If the interface is congested, and only a small number of the packets are being matched, check the tuning of the transmission (tx) ring, and evaluate whether the queueing is happening on the tx ring. To do this, use the show controllers command, and look at the value of the tx count in the output of the command.
Configuration Examples for QoS: Percentage-Based Policing
This section provides the following configuration examples:
•
Specifying Traffic Policing on the Basis of a Bandwidth Percentage: Example
•
Verifying the Configuration: Example
Specifying Traffic Policing on the Basis of a Bandwidth Percentage: Example
The following example configures traffic policing using a committed information rate (CIR) and a peak information rate (PIR) on the basis of a percentage of bandwidth. In this example, a CIR of 20 percent and a PIR of 40 percent have been specified. Additionally, an optional bc value and be value (300 ms and 400 ms, respectively) have been specified.
Router> enableRouter# configure terminalRouter(config)# policy-map policy1Router(config-pmap)# class class1Router(config-pmap-c)# police cir percent 20 bc 300 ms be 400 ms pir percent 40Router(config-pmap-c-police)# exitAfter the policy map and class maps are configured, the policy map is attached to interface as shown in the following example.
Router> enableRouter# configure terminalRouter(config-if)#interface s4/0
Router(config-if)#service-policy input policy1
Router(config-if)# exitVerifying the Configuration: Example
This section contains sample output from the show policy-map interface command and the show policy-map command. The output from these commands can be used to verify and monitor the feature configuration on your network.
The following is sample output from the show policy-map command. This sample output displays the contents of a policy map called "policy1." In policy 1, traffic policing on the basis of a CIR of 20 percent has been configured, and the bc and be have been specified in milliseconds. As part of the traffic policing configuration, optional conform, exceed, and violate actions have been specified.
Router# show policy-map policy1Policy Map policy1Class class1police cir percent 20 bc 300 ms pir percent 40 be 400 msconform-action transmitexceed-action dropviolate-action dropThe following is sample output from the show policy-map interface command. This sample displays the statistics for the serial 2/0 interface on which traffic policing has been enabled. The committed burst (bc) and excess burst (be) are specified in milliseconds (ms).
Router# show policy-map interface s2/0Serial2/0Service-policy output: policy1 (1050)Class-map: class1 (match-all) (1051/1)0 packets, 0 bytes5 minute offered rate 0 bps, drop rate 0 bpsMatch: ip precedence 0 (1052)police:cir 20 % bc 300 mscir 409500 bps, bc 15360 bytespir 40 % be 400 mspir 819000 bps, be 40960 bytesconformed 0 packets, 0 bytes; actions:transmitexceeded 0 packets, 0 bytes; actions:dropviolated 0 packets, 0 bytes; actions:dropconformed 0 bps, exceed 0 bps, violate 0 bpsClass-map: class-default (match-any) (1054/0)0 packets, 0 bytes5 minute offered rate 0 bps, drop rate 0 bpsMatch: any (1055)0 packets, 0 bytes5 minute rate 0 bpsIn this example, the CIR and PIR are displayed in bps, and both the committed burst (bc) and excess burst (be) are displayed in bits.
The CIR, PIR bc, and be are calculated on the basis of the formulas described below.
Formula for Calculating the CIR
When calculating the CIR, the following formula is used:
•
CIR percentage specified (as shown in the output of the show policy-map command) * bandwidth (BW) of the interface (as shown in the output of the show interfaces command) = total bits per second
On the serial 2/0 interface, the bandwidth (BW) is 2048 kbps. To see the bandwidth of the interface, use the show interfaces command. A sample is shown below:
Router # show interfaces s2/0Serial2/0 is administratively down, line protocol is down Hardware is M4T MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec, rely 255/255, load 1/255The following values are used for calculating the CI:.
20 % * 2048 kbps = 409600 bps
Formula for Calculating the PIR
When calculating the PIR, the following formula is used:
•
PIR percentage specified (as shown in the output of the show policy-map command) * bandwidth (BW) of the interface (as shown in the output of the show interfaces command) = total bits per second
On the serial 2/0 interface, the bandwidth (BW) is 2048 kbps. To see the bandwidth of the interface, use the show interfaces command. A sample is shown below:
Router # show interfaces s2/0 Serial2/0 is administratively down, line protocol is down Hardware is M4T MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec, rely 255/255, load 1/255The following values are used for calculating the PIR:
40 % * 2048 kbps = 819200 bps
![]()
Note
Discrepancies between this total and the total shown in the output of the show policy-map interface command can be attributed to a rounding calculation or to differences associated with the specific interface configuration.
Formula for Calculating the Committed Burst (bc)
When calculating the bc, the following formula is used:
•
The bc in milliseconds (as shown in the show policy-map command) * the CIR in bits per seconds = total number bytes
The following values are used for calculating the bc:
300 ms * 409600 bps = 15360 bytes
Formula for Calculating the Excess Burst (be)
When calculating the bc and the be, the following formula is used:
•
The be in milliseconds (as shown in the show policy-map command) * the PIR in bits per seconds = total number bytes
The following values are used for calculating the be:
400 ms * 819200 bps = 40960 bytes
Additional References
The following sections provide references related to the QoS: Percentage-Based Policing feature.
Related Documents
Related Topic Document TitleQoS commands: complete command syntax, command modes, command history, defaults, usage guidelines, and examples
Cisco IOS Quality of Service Solutions Command Reference, Release 12.3 T
Modular QoS Command-Line Interface (CLI) (MQC)
Information about attaching policy maps to interfaces
Traffic shaping
Traffic policing
dCEF
Commands related to dCEF
Cisco IOS Switching Services Command Reference, Release 12.3 T
Standards
Standards TitleNo new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
—
MIBs
RFCs
Technical Assistance
Command Reference
This section documents modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.3 command reference publications.
police (percent)
To configure traffic policing on the basis of a percentage of bandwidth available on an interface, use the police command in policy-map class configuration mode. To remove traffic policing from the configuration, use the no form of this command.
police cir percent percentage [burst-in-msec] [bc conform-burst-in-msec ms] [be peak-burst-in-msec ms] [pir percent percentage]
no police cir percent percentage [burst-in-msec] [bc conform-burst-in-msec ms] [be peak-burst-in-msec ms] [pir percent percentage]
Syntax Description
Defaults
The default bc and be is 4 ms.
Command Modes
Policy-map class configuration
Command History
Usage Guidelines
This command calculates the cir and pir 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 and pir values in bits per second (bps) are calculated on the basis of the interface bandwidth and the percent value entered with this command. The show policy-map interface command can then be used to verify the bps rate calculated.
The calculated cir and pir bps rates must be in the range of 8000 and 2000000000 bps. If the rates are outside this range, the associated policy map cannot be attached to the interface. If the interface bandwidth changes (for example, more is added), the bps values of the cir and the pir are recalculated on the basis of the revised amount of bandwidth. If the cir and pir percentages are changed after the policy map is attached to the interface, the bps values of the cir and pir are recalculated.
Conform Burst and Peak Burst Sizes in Milliseconds
This command also allows you to specify the values for the conform burst size and the peak burst size in milliseconds. If you want bandwidth to be calculated as a percentage, the conform burst size and the peak burst size must be specified in milliseconds (ms).
Hierarchical Policy Maps
Policy maps can be configured in two-level (nested) hierarchies; a top (or "parent") level and a secondary (or "child") level. The police (percent) command can be configured for use in either a parent or child policy map.
Notes About Bandwidth and Hierarchical Policy Maps
The police (percent) command uses the maximum rate of bandwidth available as the reference point for calculating the bandwidth percentage. When the police (percent) command is configured in a child policy map, the police (percent) command uses the bandwidth amount specified in the next higher-level policy (in this case, the parent policy map). If the parent policy map does not specify the maximum bandwidth rate available, the police (percent) command uses the maximum bandwidth rate available on the next higher level (in this case, the physical interface, the highest point in the hierarchy) as the reference point. The police (percent) command always looks to the next higher level for the bandwidth reference point. The following sample configuration illustrates this point:
Policymap parent_policyclass parentshape average 512000service-policy child_policyPolicymap child_policyclass normal_typepolice cir percent 30In this sample configuration, there are two hierarchical policies; one called parent_policy and one called child_policy. In the policy map called child_policy, the police command has been configured in the class called normal_type. In this class, the percentage specified by for the police (percent) command is 30 percent. The command will use 512 kbps, the peak rate, as the bandwidth reference point for class parent in the parent_policy. The police (percent) command will use 512 kbps as the basis for calculating the cir rate (512 kbps * 30 percent).
interface serial 4/0service-policy output parent_policyPolicymap parent_policyclass parentbandwidth 512service-policy child_policyIn the above example, there is one policy map called parent_policy. In this policy map, a peak rate has not been specified. The bandwidth command has been used, but this command does not represent the maximum rate of bandwidth available. Therefore, the police (percent) command will look to the next higher level (in this case Serial interface 4/0) to get the bandwidth reference point. Assuming the bandwidth of the Series interface s4/0 is 1.5 Mbps, the police (percent) command will use 1.5 Mbps as the basis for calculating the cir rate (1500000 * 30 percent).
How Bandwidth Is Calculated
The police (percent) command is often used in conjunction with the bandwidth and priority commands. The bandwidth and priority commands can be used to calculate the total amount of bandwidth available on an entity (for example, a physical interface). When the bandwidth and priority commands calculate the total amount of bandwidth available on an entity, the following guidelines are invoked:
•
If the entity is a physical interface, the total bandwidth is the bandwidth on the physical interface.
•
If the entity is a shaped ATM permanent virtual circuit (PVC), the total bandwidth is calculated as follows:
–
For a variable bit rate (VBR) virtual circuit (VC), the sustained cell rate (SCR) is used in the calculation.
–
For an available bit rate (ABR) VC, the minimum cell rate (MCR) is used in the calculation.
For more information on bandwidth allocation, refer to the"Congestion Management Overview" chapter in the Cisco IOS Quality of Service Solutions Configuration Guide.
Examples
The following example configures traffic policing using a CIR and a PIR on the basis of a percentage of bandwidth. In this example, a CIR of 20 percent and a PIR of 40 percent have been specified. Additionally, an optional bc value and be value (300 ms and 400 ms, respectively) have been specified.
Router> enableRouter# configure terminalRouter (config)# policy-map policy1Router(config-pmap)# class class1Router(config-pmap-c)# police cir percent 20 bc 300 ms be 400 ms pir percent 40Router(config-pmap-c-police)# exitAfter the policy map and class maps are configured, the policy map is attached to interface as shown in the following example.
Router> enableRouter# configure terminalRouter(config-if)#interface s4/0
Router(config-if)#service-policy input policy1
Router(config-if)# exitRelated Commands
shape (percent)
To specify average or peak rate traffic shaping on the basis of a percentage of bandwidth available on an interface, use the shape command in policy-map class configuration mode. To remove traffic shaping, use the no form of this command.
shape {average | peak} percent percentage [sustained-burst-in-msec ms] [be excess-burst-in-msec ms] [bc committed-burst-in-msec ms]
no shape {average | peak} percent percentage [sustained-burst-in-msec ms] [be excess-burst-in-msec ms] [bc committed-burst-in-msec ms]
Syntax Description
Defaults
The default bc and be is 4 ms.
Command Modes
Policy-map class configuration
Command History
Usage Guidelines
This command calculates the committed information rate (CIR) on the basis of a percentage of the available bandwidth on the interface. Once 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 show policy-map interface command can then be used to verify the cir bps value calculated.
The calculated cir bps rate must be in the range of 8000 and 154400000 bps. If the rate is less than 8000 bps, the associated policy map cannot be attached to the interface. If the interface bandwidth changes (for example, more is added), the cir bps values are recalculated on the basis of the revised amount of bandwidth. If the cir percentage is changed after the policy map is attached to the interface, the bps value of the cir is recalculated.
Conform Burst and Peak Burst Sizes in Milliseconds
This command also allows you to specify the values for the conform burst size and the peak burst size in milliseconds. If you want bandwidth to be calculated as a percentage, the conform burst size and the peak burst size must be specified in milliseconds (ms).
Hierarchical Policy Maps
The shape (percent) command, when used in "child" (hierarchical) policy maps, is not supported on the Cisco 7500, the Cisco 7200, or lower series routers. Therefore, the shape (percent) command cannot be configured for use in hierarchical policy maps on these routers.
How Bandwidth Is Calculated
The shape (percent) command is often used in conjunction with the bandwidth and priority commands. The bandwidth and priority commands can be used to calculate the total amount of bandwidth available on an entity (for example, a physical interface). When the bandwidth and priority commands calculate the total amount of bandwidth available on an entity, the following guidelines are invoked:
•
If the entity is a physical interface, the total bandwidth is the bandwidth on the physical interface.
•
If the entity is a shaped ATM permanent virtual circuit (PVC), the total bandwidth is calculated as follows:
–
For a variable bit rate (VBR) virtual circuit (VC), the sustained cell rate (SCR) is used in the calculation.
–
For an available bit rate (ABR) VC, the minimum cell rate (MCR) is used in the calculation.
For more information on bandwidth allocation, refer to the "Congestion Management Overview" chapter in the Cisco IOS Quality of Service Solutions Configuration Guide.
Examples
The following example configures traffic shaping using an average shaping rate on the basis of a percentage of bandwidth. In this example, 25 percent of the bandwidth has been specified. Additionally, an optional be value and bc value (300 ms and 400 ms, respectively) have been specified.
Router> enableRouter# configure terminalRouter (config)# policy-map policy1Router(config-pmap)# class class1Router(config-pmap-c)# shape average percent 25 20 ms be 300 ms bc 400 ms
Router(config-pmap-c)# exitAfter the policy map and class maps are configured, the policy map is attached to interface as shown in the following example.
Router> enableRouter# configure terminalRouter(config)#interface s4/0
Router(config-if)#service-policy input policy1
Router(config-if)# exitRelated Commands
show policy-map
To display the configuration of all classes for a specified service policy map or all classes for all existing policy maps, use the show policy-map command in EXEC mode.
show policy-map [policy-map]
Syntax Description
policy-map
(Optional) Name of the service policy map whose complete configuration is to be displayed.
Defaults
All existing policy map configurations are displayed.
Command Modes
EXEC
Command History
Usage Guidelines
The show policy-map command displays the configuration of a service 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 service policy map has been attached to an interface.
Examples
The following is sample output from the show policy-map command. This sample output displays the contents of a policy map called "policy1." In policy 1, traffic policing on the basis of a committed information rate (CIR) of 20 percent has been configured, and the bc and be have been specified in milliseconds. As part of the traffic policing configuration, optional conform, exceed, and violate actions have been specified.
Router# show policy-map policy1Policy Map policy1Class class1police cir percent 20 bc 300 ms pir percent 40 be 400 msconform-action transmitexceed-action dropviolate-action dropTable 1 describes the significant fields shown in the display.
Related Commands
show policy-map interface
To display the packet statistics of all classes that are configured for all service policies either on the specified interface or subinterface or on a specific permanent virtual circuit (PVC) on the interface, use the show policy-map interface command in EXEC mode.
show policy-map interface interface-name [vc [vpi/] vci][dlci dlci] [ input | output]
Syntax Description
Defaults
No default behavior or values
Command Modes
EXEC
Command History
Usage Guidelines
The show policy-map interface command displays the configuration for classes on the specified interface or the specified PVC only if a service policy has been attached to the interface or the PVC.
Examples
The following is sample output from the show policy-map interface command. This sample displays the statistics for the serial 2/0 interface on which traffic policing has been enabled. The committed (conform) burst (bc) and excess (peak) burst (be) are specified in milliseconds (ms).
Router# show policy-map interface s2/0Serial2/0Service-policy output: policy1 (1050)Class-map: class1 (match-all) (1051/1)0 packets, 0 bytes5 minute offered rate 0 bps, drop rate 0 bpsMatch: ip precedence 0 (1052)police:cir 20 % bc 300 mscir 409500 bps, bc 15360 bytespir 40 % be 400 mspir 819000 bps, be 40960 bytesconformed 0 packets, 0 bytes; actions:transmitexceeded 0 packets, 0 bytes; actions:dropviolated 0 packets, 0 bytes; actions:dropconformed 0 bps, exceed 0 bps, violate 0 bpsClass-map: class-default (match-any) (1054/0)0 packets, 0 bytes5 minute offered rate 0 bps, drop rate 0 bpsMatch: any (1055)0 packets, 0 bytes5 minute rate 0 bpsIn this example, the CIR and PIR are displayed in bps, and both the committed burst (bc) and excess burst (be) are displayed in bits.
The CIR, PIR bc, and be are calculated on the basis of the formulas described below.
Formula for Calculating the CIR
When calculating the CIR, the following formula is used:
•
CIR percentage specified (as shown in the output of the show policy-map command) * bandwidth (BW) of the interface (as shown in the output of the show interfaces command) = total bits per second
According to the output of the show interfaces command for the serial 2/0 interface, the interface has a bandwidth (BW) of 2048 kbps.
Router # show interfaces s2/0 Serial2/0 is administratively down, line protocol is down Hardware is M4T MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec, rely 255/255, load 1/255The following values are used for calculating the CIR:
20 % * 2048 kbps = 409600 bps
Formula for Calculating the PIR
When calculating the PIR, the following formula is used:
•
PIR percentage specified (as shown in the output of the show policy-map command) * bandwidth (BW) of the interface (as shown in the output of the show interfaces command) = total bits per second
According to the output of the show interfaces command for the serial 2/0 interface, the interface has a bandwidth (BW) of 2048 kbps.
Router # show interfaces s2/0 Serial2/0 is administratively down, line protocol is down Hardware is M4T MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec, rely 255/255, load 1/255The following values are used for calculating the PIR:
40 % * 2048 kbps = 819200 bps
![]()
Note
Discrepancies between this total and the total shown in the output of the show policy-map interface command can be attributed to a rounding calculation or to differences associated with the specific interface configuration.
Formula for Calculating the Committed Burst (bc)
When calculating the bc, the following formula is used:
•
The bc in milliseconds (as shown in the show policy-map command) * the CIR in bits per seconds = total number bytes
The following values are used for calculating the bc:
300 ms * 409600 bps = 15360 bytes
Formula for Calculating the Excess Burst (be)
When calculating the bc and the be, the following formula is used:
•
The be in milliseconds (as shown in the show policy-map command) * the PIR in bits per seconds = total number bytes
The following values are used for calculating the be:
400 ms * 819200 bps = 40960 bytes
Table 2 describes the significant fields shown in the display.
Table 2 show policy-map interface Field Descriptions1
Field DescriptionService-policy output
Name of the output service policy applied to the specified interface or VC.
Class-map
Class of traffic being displayed. Output is displayed for each configured class in the policy. The choice for implementing class matches (for example, match-all or match-any) can also appear next to the traffic class.
packets and bytes
Number of packets (also shown in bytes) identified as belonging to the class of traffic being displayed.
offered rate
Rate, in kbps, of packets coming in to the class.
drop rate
Rate, in kbps, at which packets are dropped from the class. The drop rate is calculated by subtracting the number of successfully transmitted packets from the offered rate.
Match
Match criteria specified for the class of traffic. Choices include criteria such as the Layer 3 packet length, IP precedence, IP differentiated services code point (DSCP) value, Multiprotocol Label Switching (MPLS) experimental value, access groups, and quality of service (QoS) groups. For more information about the variety of match criteria options that are available, refer to the "Configuring the Modular Quality of Service Command-Line Interface" chapter of the Cisco IOS Quality of Service Solutions Configuration Guide.
police
Indicates that traffic policing has been enabled. Display includes the CIR, PIR (in both a percentage of bandwidth and in bps) and the bc and be in bytes and milliseconds. Also displays the optional conform, exceed, and violate actions, if any, and the statistics associated with these optional actions.
1 A number in parentheses may appear next to the service-policy output name, class-map name, and match criteria information. The number is for Cisco internal use only and can be disregarded.
Related Commands
![]()
Copyright © 2004, 2005 Cisco Systems, Inc. All rights reserved.