Configuring Policy Map Class Policing
Policy Map Class Policing Restrictions
- PFC QoS does not support the set-qos-transmit policer keyword.
- PFC QoS does not support the set-dscp-transmit or set-prec-transmit keywords as arguments to the exceed-action keyword.
- PFC QoS does not detect the use of unsupported keywords until you attach a policy map to an interface.
- Policing with the conform-action transmit keywords sets the port trust state of matched traffic to trust DSCP or to the trust state configured by a trust command in the policy map class.
Using a Named Aggregate Policer
To use a named aggregate policer, perform this task:
|
|
Router(config-pmap-c)# police aggregate aggregate_name |
Configures the policy map class to use a previously defined named aggregate policer. |
- When distributed aggregate policing is enabled, note the following information:
–
Distributed aggregate policers synchronize policing on interfaces supported by different DFC-equipped switching modules or the PFC. Distributed aggregate policing applies to the first 4,096 aggregate policers of these types:
—Aggregate policers applied to VLAN, tunnel, or port channel interfaces.
—Shared aggregate policers.
—Aggregate policers in egress policies.
–
Distributed aggregate policers in excess of the hardware-supported capacity function as nondistributed aggregate policers.
- When distributed aggregate policing is not enabled, note the following information:
–
Aggregate policing works independently on each DFC-equipped switching module and independently on the PFC, which supports any non-DFC-equipped switching modules. Aggregate policing does not combine flow statistics from different DFC-equipped switching modules. You can display aggregate policing statistics for each DFC-equipped switching module and for the PFC and any non-DFC-equipped switching modules supported by the PFC.
–
Each PFC or DFC polices independently, which might affect QoS features being applied to traffic that is distributed across the PFC and any DFCs. Examples of these QoS feature are:
—Policers applied to a port channel interface.
—Policers applied to a switched virtual interface.
—Egress policers applied to either a Layer 3 interface or an SVI.
–
Policers affected by this restriction deliver an aggregate rate that is the sum of all the independent policing rates.
Configuring a Per-Interface Policer
To configure a per-interface policer, perform this task:
|
|
Router(config-pmap-c)# police bits_per_second normal_burst_bytes [ maximum_burst_bytes ] [ pir peak_rate_bps ] [[[ conform-action { drop | set-dscp-transmit dscp_value | set-prec-transmit ip_precedence_value | transmit }] exceed-action { drop | policed-dscp | transmit }] violate-action { drop | policed-dscp | transmit }] |
Creates a per-interface policer and configures the policy-map class to use it. |
- When you apply both ingress policing and egress policing to the same traffic, both the input policy and the output policy must either mark down traffic or drop traffic. PFC QoS does not support ingress markdown with egress drop or ingress drop with egress markdown.
- Policing uses the Layer 2 frame size.
- See the “Restrictions for PFC QoS” section for information about rate and burst size granularity.
- The valid range of values for the CIR bits_per_second parameter is as follows:
–
Minimum—32 kilobits per second, entered as 32000
–
Maximum—64 gigabits per second, entered as 64000000000
- The normal_burst_bytes parameter sets the CIR token bucket size.
- The maximum_burst_bytes parameter sets the PIR token bucket size.
- When configuring the size of a token bucket, note the following information:
–
Because the token bucket must be large enough to hold at least one frame, configure the token bucket size to be larger than the maximum size of the traffic being policed.
–
For TCP traffic, configure the token bucket size as a multiple of the TCP window size, with a minimum value at least twice as large as the maximum size of the traffic being policed.
–
The maximum_burst_bytes parameter must be set larger than the normal_burst_bytes parameter.
–
To sustain a specific rate, set the token bucket size to be at least the rate value divided by 2000.
–
The minimum token bucket size is 1 byte, entered as 1.
–
The maximum token bucket size is 512 megabytes, entered as 512000000.
- The valid range of values for the pir bits_per_second parameter is as follows:
–
Minimum—32 kilobits per second, entered as 32000 (the value cannot be smaller than the CIR bits_per_second parameters)
–
Maximum—64 gigabits per second, entered as 64000000000
- (Optional) You can specify a conform action for matched in-profile traffic as follows:
–
The default conform action is transmit, which sets the policy map class trust state to trust DSCP unless the policy map class contains a trust command.
–
To set PFC QoS labels in untrusted traffic, you can enter the set-dscp-transmit keyword to mark matched untrusted traffic with a new DSCP value or enter the set-prec-transmit keyword to mark matched untrusted traffic with a new IP precedence value. The set-dscp-transmit and set-prec-transmit keywords are only supported for IP traffic. PFC QoS sets egress ToS and CoS from the configured value.
–
You can enter the drop keyword to drop all matched traffic.
–
Ensure that aggregate and microflow policers that are applied to the same traffic each specify the same conform-action behavior.
- (Optional) For traffic that exceeds the CIR, you can specify an exceed action as follows:
–
For marking without policing, you can enter the transmit keyword to transmit all matched out-of-profile traffic.
–
The default exceed action is drop, except with a maximum_burst_bytes parameter (drop is not supported with a maximum_burst_bytes parameter).
Note When the exceed action is drop, PFC QoS ignores any configured violate action.
–
You can enter the policed-dscp-transmit keyword to cause all matched out-of-profile traffic to be marked down as specified in the markdown map.
Note When you create a policer that does not use the pir keyword and the maximum_burst_bytes parameter is equal to the normal_burst_bytes parameter (which is the case if you do not enter the maximum_burst_bytes parameter), the exceed-action policed-dscp-transmit keywords cause PFC QoS to mark traffic down as defined by the policed-dscp max-burst markdown map.
- (Optional) for traffic that exceeds the PIR, you can specify a violate action as follows:
–
For marking without policing, you can enter the transmit keyword to transmit all matched out-of-profile traffic.
–
The default violate action is equal to the exceed action.
–
You can enter the policed-dscp-transmit keyword to cause all matched out-of-profile traffic to be marked down as specified in the markdown map.
This example shows how to create a policy map named max-pol-ipp5 that uses the class-map named ipp5, which is configured to trust received IP precedence values and is configured with a maximum-capacity aggregate policer and with a microflow policer:
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# policy-map max-pol-ipp5
Router(config-pmap)# class ipp5
Router(config-pmap-c)# trust ip-precedence
Router(config-pmap-c)# police 2000000000 2000000 conform-action set-prec-transmit 6 exceed-action policed-dscp-transmit
Router(config-pmap-c)# police flow 10000000 10000 conform-action set-prec-transmit 6 exceed-action policed-dscp-transmit
Router(config-pmap-c)# end
Configuring a Per-Interface Microflow Policer
To configure a per-interface microflow policer, perform this task:
|
|
Router(config-pmap-c)# police flow [ mask { src-only | dest-only | full-flow }] bits_per_second normal_burst_bytes [[[ conform-action { drop | set-dscp-transmit dscp_value | set-prec-transmit ip_precedence_value | transmit }] exceed-action { drop | policed-dscp | transmit }] violate-action { drop | policed-dscp | transmit }] |
Creates a per-interface microflow policer and configures the policy-map class to use it. |
- When you apply both ingress policing and egress policing to the same traffic, both the input policy and the output policy must either mark down traffic or drop traffic. PFC QoS does not support ingress markdown with egress drop or ingress drop with egress markdown.
- Policing uses the Layer 2 frame size.
- See the “Restrictions for PFC QoS” section for information about rate and burst size granularity.
- You can enter the mask src-only keywords to base flow identification only on source addresses, which applies the microflow policer to all traffic from each source address. PFC QoS supports the mask src-only keywords for both IP traffic and MAC traffic.
- You can enter the mask dest-only keywords to base flow identification only on destination addresses, which applies the microflow policer to all traffic to each source address. PFC QoS supports the mask dest-only keywords for both IP traffic and MAC traffic.
- By default and with the mask full-flow keywords, PFC QoS bases IP flow identification on source IP address, destination IP address, the Layer 3 protocol, and Layer 4 port numbers.
- PFC QoS considers MAC-Layer traffic with the same protocol and the same source and destination MAC-Layer addresses to be part of the same flow, including traffic with different EtherTypes.
- Microflow policers do not support the maximum_burst_bytes parameter, the pir bits_per_second keyword and parameter, or the violate-action keyword.
Note
The flowmask requirements of microflow policing, NetFlow, and NetFlow data export (NDE) might conflict.
- The valid range of values for the CIR bits_per_second parameter is as follows:
–
Minimum—32 kilobits per second, entered as 32000
–
Maximum—64 gigabits per second, entered as 64000000000
- The normal_burst_bytes parameter sets the CIR token bucket size.
- When configuring the size of a token bucket, note the following information:
–
Because the token bucket must be large enough to hold at least one frame, configure the token bucket size to be larger than the maximum size of the traffic being policed.
–
For TCP traffic, configure the token bucket size as a multiple of the TCP window size, with a minimum value at least twice as large as the maximum size of the traffic being policed.
–
The maximum_burst_bytes parameter must be set larger than the normal_burst_bytes parameter.
–
To sustain a specific rate, set the token bucket size to be at least the rate value divided by 2000.
–
The minimum token bucket size is 1 byte, entered as 1.
–
The maximum token bucket size is 512 megabytes, entered as 512000000.
- (Optional) You can specify a conform action for matched in-profile traffic as follows:
–
The default conform action is transmit, which sets the policy map class trust state to trust DSCP unless the policy map class contains a trust command.
–
To set PFC QoS labels in untrusted traffic, you can enter the set-dscp-transmit keyword to mark matched untrusted traffic with a new DSCP value or enter the set-prec-transmit keyword to mark matched untrusted traffic with a new IP precedence value. The set-dscp-transmit and set-prec-transmit keywords are only supported for IP traffic. PFC QoS sets egress ToS and CoS from the configured value.
–
You can enter the drop keyword to drop all matched traffic.
–
Ensure that aggregate and microflow policers that are applied to the same traffic each specify the same conform-action behavior.
- (Optional) For traffic that exceeds the CIR, you can specify an exceed action as follows:
–
For marking without policing, you can enter the transmit keyword to transmit all matched out-of-profile traffic.
–
The default exceed action is drop, except with a maximum_burst_bytes parameter (drop is not supported with a maximum_burst_bytes parameter).
Note When the exceed action is drop, PFC QoS ignores any configured violate action.
–
You can enter the policed-dscp-transmit keyword to cause all matched out-of-profile traffic to be marked down as specified in the markdown map.
Note When you create a policer that does not use the pir keyword and the maximum_burst_bytes parameter is equal to the normal_burst_bytes parameter (which is the case if you do not enter the maximum_burst_bytes parameter), the exceed-action policed-dscp-transmit keywords cause PFC QoS to mark traffic down as defined by the policed-dscp max-burst markdown map.
Attaching a Policy Map to an Interface
To attach a policy map to an interface, perform this task:
|
|
|
Step 1 |
Router(config)# interface {{ vlan vlan_ID } | { type slot/port [. subinterface ]} | { port-channel number [. subinterface ]}} |
Selects the interface to configure. |
Step 2 |
Router(config-if)# service-policy [ input | output ] policy_map_name |
Attaches a policy map to the interface. |
Step 3 |
Router(config-if)# end |
Exits configuration mode. |
- Do not attach a service policy to a port that is a member of an EtherChannel.
- PFC QoS supports the output keyword only on Layer 3 interfaces (either LAN ports configured as Layer 3 interfaces or VLAN interfaces).You can attach both an input and an output policy map to a Layer 3 interface.
- VLAN-based or port-based PFC QoS on Layer 2 ports is not relevant to policies attached to Layer 3 interfaces with the output keyword.
- With releases earlier than Release 15.1(1)SY1, policies attached with the output keyword do not support microflow policing.
- You cannot attach a policy map that configures a trust state with the service-policy output command.
- Filtering based on IP precedence or DSCP in policies attached with the output keyword uses the received IP precedence or DSCP values. Filtering based on IP precedence or DSCP in policies attached with the output keyword is not based on any IP precedence or DSCP changes made by ingress QoS.
- A shared aggregate policer cannot be applied in both ingress and egress directions.
- When distributed aggregate policing is enabled, aggregate policers synchronize policing on interfaces supported by different DFC-equipped switching modules or the PFC. Distributed aggregate policing applies to the first 4,096 aggregate policer instances of these types:
–
Aggregate policers applied to VLAN, tunnel, or port channel interfaces.
–
Shared aggregate policers.
–
Aggregate policers in egress policies.
With distributed aggregate policing enabled, aggregate policers in excess of the hardware-supported capacity function as nondistributed aggregate policers.
- Nondistributed aggregate policing works independently on each DFC-equipped switching module and independently on the PFC, which supports any non-DFC-equipped switching modules. Aggregate policing does not combine flow statistics from different DFC-equipped switching modules. You can display aggregate policing statistics for each DFC-equipped switching module and for the PFC and any non-DFC-equipped switching modules supported by the PFC.
Each PFC or DFC polices independently, which might affect QoS features being applied to traffic that is distributed across the PFC and any DFCs. Examples of these QoS feature are:
–
Policers applied to a port channel interface.
–
Policers applied to a switched virtual interface.
–
Egress policers applied to either a Layer 3 interface or an SVI.
Policers affected by this restriction deliver an aggregate rate that is the sum of all the independent policing rates.
- For nonaggregate policers, each PFC or DFC polices independently, which might affect QoS features being applied to traffic that is distributed across the PFC and any DFCs. Examples of these QoS feature are:
–
Policers applied to a port channel interface.
–
Policers applied to a switched virtual interface.
–
Egress policers applied to either a Layer 3 interface or an SVI.
Policers affected by this restriction deliver an aggregate rate that is the sum of all the independent policing rates.
- When you apply both ingress policing and egress policing to the same traffic, both the input policy and the output policy must either mark down traffic or drop traffic. PFC QoS does not support ingress markdown with egress drop or ingress drop with egress markdown.
This example shows how to attach the policy map named pmap1 to gigabit Ethernet port 5/36:
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# interface gigabitethernet 5/36
Router(config-if)# service-policy input pmap1
This example shows how to verify the configuration:
Router# show policy-map interface gigabitethernet 5/36
service-policy input: pmap1
class-map: cmap1 (match-all)
police 8000 8000 conform-action transmit exceed-action drop
class-map: cmap2 (match-any)
police 8000 10000 conform-action transmit exceed-action drop