Information About Classification, Marking, and Policing Policies

Classification, Marking, and Policing Policy Overview

The classification, marking, and policing configuration is defined by the policies attached to an interface. Classification, marking, and policing are unaffected by any QoS commands configured on ingress interfaces or by queueing policies.

Traffic Classification

Traffic classification allows the network to recognize traffic as it falls into classes that you have configured. Network traffic must be classified to apply specific QoS to it.

Classification can be inclusive (for example, all of the traffic in a Layer 2 VLAN or all of the traffic passing through an interface) or classification can be very specific (for example, you can use a class map with match commands that recognize specific aspects of the traffic).

You can classify and apply QoS (for example, marking) and then, on another interface or network device, classify again based on the marked value and apply other QoS.

The PFC and any DFCs supports a single match command in class-map match-all class maps, except that the match protocol command can be configured in a class map with the match dscp or match precedence command.

The PFC and any DFCs supports these ACL types for use with the match access group command:

Protocol

Numbered ACLs

Extended ACLs

Named ACLs

IPv4

Yes: 1 to 99 1300 to 1999

Yes: 100 to 199 2000 to 2699

Yes

IPv6

Not applicable

Yes (named)

Yes

MAC Layer

Not applicable

Not applicable

Yes

ARP

Not applicable

Not applicable

Yes

Traffic Marking

Note Policing can also mark traffic.

Marking network traffic allows you to set or modify the attributes for a specific class of traffic, which allows class-based QoS features to recognize traffic classes based on the marking. There are two traffic marking methods:

You can apply a configured value with a policy-map set command. Table 60-2 lists the available policy-map set commands and the corresponding attribute.

Overview of Policing

Policers can be applied to ingress and egress interfaces. Ingress policing is applied first, followed by egress policing.

Policing can rate limit incoming and outgoing traffic so that it adheres to the traffic forwarding rules defined by the QoS configuration. Sometimes these configured rules for how traffic should be forwarded through the system are referred to as a contract. If the traffic does not adhere to this contract, it is marked down to a lower DSCP value or dropped.

Policing does not buffer out-of-profile packets. As a result, policing does not affect transmission delay. In contrast, traffic shaping works by buffering out-of-profile traffic, which moderates traffic bursts. (PFC QoS does not support shaping.)

The PFC and DFCs support ingress and egress PFC QoS, which includes ingress and egress policing. Policers act on ingress traffic per-port or per-VLAN. For egress traffic, the policers act per-VLAN only.

Policing uses the Layer 2 frame size. You specify the bandwidth utilization limit as a committed information rate (CIR). You can also specify a higher peak information rate (PIR). Packets that exceed a rate are “out of profile” or “nonconforming.”

In each policer, you specify if out-of-profile packets are to be dropped or to have a new DSCP value applied to them (applying a new DSCP value is called “markdown”). Because out-of-profile packets do not retain their original priority, they are not counted as part of the bandwidth consumed by in-profile packets.

If you configure a PIR, the PIR out-of-profile action cannot be less severe than the CIR out-of-profile action. For example, if the CIR out-of-profile action is to mark down the traffic, then the PIR out-of-profile action cannot be to transmit the traffic.

For all policers, PFC QoS uses a configurable global table that maps the internal DSCP value to a marked-down DSCP value. When markdown occurs, PFC QoS gets the marked-down DSCP value from the table. You cannot specify marked-down DSCP values in individual policers.

Note ● By default, the markdown table is configured so that no markdown occurs: the marked-down DSCP values are equal to the original DSCP values. To enable markdown, configure the table appropriately for your network.

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.

Per-Interface Policers

PFC QoS applies the bandwidth limits specified in a per-interface policer to matched traffic. For example, if you configure a per-interface policer to allow 1 Mbps for all matched TFTP traffic, it limits the TFTP traffic to 1 Mbps.

You define per-interface policers in a policy map class with the police command. If you attach per-interface policers to multiple ingress ports, each one polices the matched traffic on each ingress port separately.

Aggregate Policers

Aggregate Policer Overview

PFC QoS applies the bandwidth limits specified in an aggregate policer cumulatively to all flows in matched traffic. For example, if you configure an aggregate policer to allow 1 Mbps for all TFTP traffic flows on VLAN 1 and VLAN 3, it limits the TFTP traffic for all flows combined on VLAN 1 and VLAN 3 to 1 Mbps.

You create named aggregate policers with the platform qos aggregate-policer command. If you attach a named aggregate policer to multiple ingress ports, it polices the matched traffic from all the ingress ports to which it is attached.

You can configure up to 1,023 aggregate policers; the configured aggregate policers can be applied to interfaces to configure up to 16,384 policer instances.

Distributed Aggregate Policers

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:

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.

Microflow Policers

PFC QoS applies the bandwidth limit specified in a microflow policer separately to each flow in matched traffic. For example, if you configure a microflow policer to limit the TFTP traffic to 1 Mbps on VLAN 1 and VLAN 3, then 1 Mbps is allowed for each flow in VLAN 1 and 1 Mbps for each flow in VLAN 3. In other words, if there are three flows in VLAN 1 and four flows in VLAN 3, the microflow policer allows each of these flows 1 Mbps.

You can configure PFC QoS to apply the bandwidth limits in a microflow policer as follows:

You can create microflow policers with up to 127 different rate and burst parameter combinations.

You create microflow policers in a policy map class with the police flow command.

You can configure a microflow policer to use only source addresses, which applies the microflow policer to all traffic from a source address regardless of the destination addresses.

You can configure a microflow policer to use only destination addresses, which applies the microflow policer to all traffic to a destination address regardless of the source addresses.

For MAC-Layer microflow policing, 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. You can configure MAC ACLs to filter IPX traffic.

You cannot apply microflow policing to ARP traffic.

With releases earlier than Release 15.1(1)SY1, policies attached with the output keyword do not support microflow policing.

You can include both an aggregate policer and a microflow policer in each policy map class to police a flow based on both its own bandwidth utilization and on its bandwidth utilization combined with that of other flows.

Note If traffic is both aggregate and microflow policed, then the aggregate and microflow policers must both be in the same policy-map class and each must use the same conform-action and exceed-action keyword option: drop, set-dscp-transmit, set-prec-transmit, or transmit.

For example, you could create a microflow policer with a bandwidth limit suitable for individuals in a group, and you could create a named aggregate policer with bandwidth limits suitable for the group as a whole. You could include both policers in policy map classes that match the group’s traffic. The combination would affect individual flows separately and the group aggregately.

For policy map classes that include both an aggregate and a microflow policer, PFC QoS responds to an out-of-profile status from either policer and, as specified by the policer, applies a new DSCP value or drops the packet. If both policers return an out-of-profile status, then if either policer specifies that the packet is to be dropped, it is dropped; otherwise, PFC QoS applies a marked-down DSCP value.

Policy Map Overview

Policy maps can contain one or more policy map classes, each with different policy map commands.

Configure a separate policy map class in the policy map for each type of traffic that an interface receives. Put all commands for each type of traffic in the same policy map class. PFC QoS does not attempt to apply commands from more than one policy map class to matched traffic.

Configuring Policy Map Class Actions

Policy Map Class Action Restrictions

Policy maps can contain one or more policy map classes.

Put all commands for each type of traffic in the same policy map class.

PFC QoS only applies commands from one policy map class to traffic. After traffic has matched the filtering in one policy map class, QoS does not apply the filtering configured in other policy map classes.

For hardware-switched traffic, PFC QoS does not support the bandwidth, priority, queue-limit, or random-detect policy map class commands. You can configure these commands because they can be used for software-switched traffic.

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:

Command

Purpose

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:

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.

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.

– 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).

– 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:

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.

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.

– 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).

– 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.

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:

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:

To remove the identity policy, use the no identity policy policy_name command.

After the policy maps have been defined, configure the Cisco AV pair attributes in each user profile on the RADIUS server using the policy map names:

cisco-avpair = “ip:sub-policy-In=in_policy_name”

cisco-avpair = “ip:sub-policy-Out=out_policy_name”

To set the Cisco AV pair attributes on the RADIUS server, perform the following task:

Command or Action

Purpose

sub-policy-In= in_policy_name

sub-policy-Out= out_policy_name

Enters the two Cisco AV pairs for service policy on the RADIUS server in the user file. When the switch requests the policy name, this information in the user file is supplied.

A RADIUS user file contains an entry for each user that the RADIUS server will authenticate. Each entry, which is also referred to as a user profile, establishes an attribute the user can access.

In this example, you have configured a service policy that attaches a QoS policy map to the interface and specifies the direction (inbound for data packets traveling into the interface or outbound for data packets leaving the interface).

The policy map applied in the inbound direction is example_in_qos and the outbound policy map is example_out_qos.

This example shows the configuration in the user file on the RADIUS server: