Control plane policing and protection

On a Catalyst 9300, the CoPP you learned elsewhere is refused: from IOS XE Fuji 16.8.1a, user-defined class maps are not supported, and only system-cpp-policy can be installed on the control plane, with system classes that cannot be modified or deleted. Each class is a group of CPU queues with a policer in hardware, so protocols sharing a class share its rate: an ARP flood can starve SSH.

In Daveth Pro (Network)4 min video · lab: Security

By , founder of Daveth · Updated

Opening frame of the video walkthrough of Control plane policing and protection

Watch this lesson

4 min · Video walkthrough

In Daveth Pro (Network)

The full 4 min walkthrough is in Daveth Pro (Network). See what the plan opens

Upcoming practical lab

Lab C13: Security

What the lab covers

What this page answers

Can you create custom CoPP class maps on a Catalyst 9300?

No. Starting from Cisco IOS XE Fuji 16.8.1a, user-defined class maps are not supported. Only system-cpp-policy can be installed on the control plane, and its system-defined classes cannot be modified or deleted. Read it in “The policy you are not allowed to write”

Why does an ARP flood affect SSH to a Catalyst switch?

ARP shares the system-cpp-police-forus class and its policer with host protocols such as Telnet, ICMP, SSH, FTP and SNMP, so a flood that exceeds the rate drops them all. Read it in “An ARP flood, and an SSH session”

Does CoPP affect CPU or data plane performance?

No. Although the policers are configured in hardware, CoPP does not affect CPU performance or the performance of the data plane; it protects the CPU from unnecessary traffic and denial of service. Read it in “What it protects, and how”

The policy you are not allowed to write

You already know how to do this, don’t you? Build a class-map for the traffic you care about, a policy-map around it, and attach it to control-plane. It is what a decade of CCIE material teaches.

On a Catalyst 9300 running , the first step is refused.

Starting from Cisco IOS XE Fuji 16.8.1a, the creation of user-defined class-maps is not supported.
Only the system-cpp-policy policy-map can be installed on the control plane interface. The system-cpp-policy policy-map and the system-defined classes cannot be modified or deleted.
This divergence is named rather than dropped. The CCIE R&S-era treatment of control plane policing teaches the model above, and it is not wrong for its era and hardware. The platform chapter is where the two part company.

So what is left for you?

Only the police action is allowed under the system-cpp-policy policy-map. The police rate for system-defined classes must be configured only in packets per second (pps).
Only ingress CoPP is supported. The system-cpp-policy policy-map is available on the control plane interface, and only in the ingress direction.

Computed from the state: everything someone reaches for, and what this platform does with it. This course's layout, not a switch's output.

what you reach for                  allowed  the chapter's reason
class-map MY-COPP                   no       no user-defined class-maps
service-policy input MY-COPP-POLICY no       only system-cpp-policy
no class routing-control            no       cannot be modified or deleted
set dscp under a class              no       police is the only action
service-policy output               no       ingress only
police 8000 (bits per second)       no       pps only
police rate 1000 pps                yes      police rate, in pps
no police rate                      yes      allowed, and recommended against

Two rows say yes, and they are the same command. A rate, or no rate. And the policy still has to be attached, in two lines the procedure prints, so SW-1 gets those first, with every class at its default:

Configuration: SW-1 installs the policy, in the lines the chapter's procedure prints.

SW-1# configure terminal
SW-1(config)# control-plane
SW-1(config-cp)# service-policy input system-cpp-policy
SW-1(config-cp)# end
Installs system-cpp-policy in FED. This command is required for you to see the FED policy. Not configuring this command will lead to an error.

What it protects, and how

What is all of this for?

The CoPP feature improves security on your device by protecting the CPU from unnecessary traffic and denial of service (DoS) attacks.
CoPP uses the modular QoS command-line interface (MQC) and CPU queues to achieve these objectives.

Everything in 4.2 protected the network from what was attached to it. This protects SW-1 from what is addressed to it.

Although the policers are configured in hardware, CoPP does not affect CPU performance or the performance of the data plane.
There is a one-to-one mapping of class-maps to policers; and one or more CPU queues map to a class-map. Enables all CPU queues by default, with their respective default rate.

Read that middle sentence twice. One policer per class. One or more queues per class. So a class is the unit you set a rate on, and a queue is the unit traffic arrives in.

A class is a group of queues

Which queues are in which class? The chapter prints a table. Here are the rows this page follows, and sys-data, for a reason that comes up below:

Published table: Table 1, System-Defined Values for CoPP (excerpt), as the chapter prints it, including its stray spaces.

Class Maps Names                      Policer Index                       CPU queues
system-cpp-police-routing-control     WK_CPP_POLICE_ROUTING_CONTROL(2)    WK_CPU_Q_ROUTING_CONTROL(4)
                                                                          WK_CPU_Q_LOW_LATENCY (27)
system-cpp-police- topology-control   WK_CPP_POLICE_TOPOLOGY_CONTROL(8)   WK_CPU_Q_TOPOLOGY_CONTROL(15)
system-cpp-police-dhcp-snooping       WK_CPP_DHCP_SNOOPING(6)             WK_CPU_Q_DHCP_SNOOPING(17)
system-cpp-police-forus               WK_CPP_POLICE_FORUS(14)             WK_CPU_Q_FORUS_ADDR_RESOLUTION(5)
                                                                          WK_CPU_Q_FORUS_TRAFFIC(2)
system-cpp-police-sys- data           WK_CPP_POLICE_SYS _DATA(10)         WK_CPU_Q_OPENFLOW (13)
                                                                          WK_CPU_Q_CRYPTO_CONTROL(23)
                                                                          WK_CPU_Q_EXCEPTION(24)
                                                                          WK_CPU_Q_EGR_EXCEPTION(28)
                                                                          WK_CPU_Q_NFL_SAMPLED_DATA(26)
                                                                          WK_CPU_Q_GOLD_PKT(31)
                                                                          WK_CPU_Q_RPF_FAILED(19)

And which protocol lands in which queue? A second table:

Published table: Table 2, CPU Queues and Associated Features (excerpt), as the chapter prints it, including its stray spaces.

CPU queue                           features (excerpt)
WK_CPU_Q_FORUS_TRAFFIC(2)           Host such as Telnet,Pingv4 and Pingv6, and SNMP
                                    Keepalive / loopback detection
                                    Initiate-Internet Key Exchange (IKE) protocol (IPSec)
WK_CPU_Q_ROUTING_CONTROL(4)         Border Gateway Protocol (BGP)
                                    Open Shortest Path First (OSPF)
                                    Open Shortest Path First version 3(OSPFv3)
                                    Enhanced Interior Gateway Routing Protocol (EIGRP)
                                    DHCPv6
                                    Intermediate System-to-Intermediate System (IS-IS)
WK_CPU_Q_FORUS_ADDR_RESOLUTION(5)   Address Resolution Protocol (ARP)
                                    IPv6 neighbor advertisement and neighbor solicitation
WK_CPU_Q_TOPOLOGY_CONTROL(15)       Spanning Tree Protocol (STP)
                                    Resilient Ethernet Protocol (REP)
                                    Shared Spanning Tree Protocol (SSTP)
WK_CPU_Q_DHCP_SNOOPING(17)          DHCP snooping
WK_CPU_Q_LOW_LATENCY(27)            Bidirectional Forwarding Detection (BFD), Precision Time Protocol (PTP)

Computed from the state: the four classes this page follows, from the published class-to-queue map and Table 2. This course's layout, not a switch's output.

class               queues                                      protocols this page follows
forus               Forus Address resolution + Forus traffic    ARP, IPv6 ND, SNMP, Telnet
routing-control     Routing Control + Low Latency               OSPF, BGP, BFD
topology-control    Topology Control                            STP
dhcp-snooping       DHCP Snooping                               DHCP snooping

Look at the routing-control row. OSPF and BGP in one queue, BFD in another, one policer over both. And forus holds ARP and IPv6 neighbor discovery in one queue, with SNMP and Telnet in the other.

Read that as a shared waiting room, because that is what a class is. Everything in it is subject to one limit, set once, regardless of which protocol you had in mind when you set it. Nobody gets their own allowance.

Which is why a rate change here is never about one protocol. You lower a number because a neighbour is chatty, and every other protocol in that class has just been given the same smaller allowance without anybody mentioning it to them.

Where multiple CPU queues belong to one class-map, changing the policer rate of a class-map affects all CPU queues that belong to that class-map. Similarly, disabling the policer in a class-map disables all queues that belong to that class-map.

One warning before trusting either table. Table 1 lists 7 queues under sys-data; the chapter's own reading of a switch lists 6. So when you need membership, read it from the switch in front of you, which is what the next section's second command does. That advice is this course's, from the disagreement.

An ARP flood, and an SSH session

HOST-88 starts flooding ARP at SW-1. A minute later, ADMIN-PC's SSH session to the switch starts losing packets. Nothing has changed on ADMIN-PC's port.

For example, Address Resolution Protocol (ARP) shares 4000 hardware policers with an array of host protocols like Telnet, Internet Control Message Protocol (ICMP), SSH, FTP, and SNMP in the system-cpp-police-forus class. As a result, ARP and ICMP host protocols are dropped, along with any other host protocols that share the same class.

Computed from the state: offered traffic against each class rate, with the flood on. This course's layout, not a switch's output.

class               offered pps  rate    over?  at risk of drop
forus               20020        4000    yes    ARP, IPv6 ND, SNMP, Telnet, SSH
routing-control     190          5400    no     –
topology-control    0            13000   no     –
dhcp-snooping       0            400     no     –

Only one class is over, and five protocols are at risk. The offered rates are this course's own; the class rate of 4000 is the chapter's sentence.

Which reading tells you this on a real switch? Start with the policy:

Output from elsewhere: show policy-map control-plane after a rate change on protocol-snooping. The values in it are that chapter’s, not this scenario’s.

Device# show policy-map control-plane

Control Plane

  Service-policy input: system-cpp-policy

    <output truncated>


    Class-map: system-cpp-police-dot1x-auth (match-any)
      0 packets, 0 bytes
      5 minute offered rate 0000 bps, drop rate 0000 bps
      Match: none
      police:
          rate 1000 pps, burst 244 packets
        conformed 0 bytes; actions:
          transmit
        exceeded 0 bytes; actions:
          drop

    Class-map: system-cpp-police-protocol-snooping (match-any)
      0 packets, 0 bytes
      5 minute offered rate 0000 bps, drop rate 0000 bps
      Match: none
      police:
          rate 2000 pps, burst 488 packets
        conformed 0 bytes; actions:
          transmit
        exceeded 0 bytes; actions:
          drop

    <output truncated>

    Class-map: class-default (match-any)
      0 packets, 0 bytes
      5 minute offered rate 0000 bps, drop rate 0000 bps
      Match: any

Notice the last two lines of each class: exceeded, and drop. That is what happens to traffic over the rate.

Proves: each class, the rate its policer is set to, what conformed and what exceeded, and that exceeded traffic is dropped. Does not prove: which CPU queues are in a class, or which protocol the dropped packets belonged to.

So which queue is dropping, and what else is in its class? The hardware reading:

Output from elsewhere: the queue section of the hardware reading, after cpp system-default. The values in it are that chapter’s, not this scenario’s.

Device# show platform hardware fed switch 1 qos queue stats internal cpu policer

CPU Queue Statistics
============================================================================================
                                              (default) (set)     Queue        Queue
QId PlcIdx  Queue Name                Enabled   Rate     Rate      Drop(Bytes)  Drop(Frames)
--------------------------------------------------------------------------------------------
0    11     DOT1X Auth                  Yes     1000      1000     0            0
1    1      L2 Control                  Yes     2000      2000     0            0
2    14     Forus traffic               Yes     1000      1000     0            0
3    0      ICMP GEN                    Yes     600       600      0            0
4    2      Routing Control             Yes     5400      5400     0            0
5    14     Forus Address resolution    Yes     4000      4000     0            0
6    0      ICMP Redirect               Yes     600       600      0            0
7    16     Inter FED Traffic           Yes     2000      2000     0            0
8    4      L2 LVX Cont Pack            Yes     1000      1000     0            0
9    16     EWLC Control                Yes     2000      2000     0            0
10   16     EWLC Data                   Yes     2000      2000     0            0
11   13     L2 LVX Data Pack            Yes     1000      1000     0            0
12   0      BROADCAST                   Yes     600       600      0            0
13   10     Openflow                    Yes     100       200      0            0
14   13     Sw forwarding               Yes     1000      1000     0            0
15   8      Topology Control            Yes     13000     13000    0            0
16   12     Proto Snooping              Yes     2000      2000     0            0
17   6      DHCP Snooping               Yes     500       400      0            0
18   9      Transit Traffic             Yes     500       400      0            0
19   10     RPF Failed                  Yes     100       200      0            0
20   15     MCAST END STATION           Yes     2000      2000     0            0
21   13     LOGGING                     Yes     1000      1000     0            0
22   7      Punt Webauth                Yes     1000      1000     0            0
23   18     High Rate App               Yes     13000     13000    0            0
24   10     Exception                   Yes     100       200      0            0
25   3      System Critical             Yes     1000      1000     0            0
26   10     NFL SAMPLED DATA            Yes     100       200      0            0
27   2      Low Latency                 Yes     5400      5400     0            0
28   10     EGR Exception               Yes     100       200      0            0
29   5      Stackwise Virtual OOB       Yes     8000      8000     0            0
30   9      MCAST Data                  Yes     500       400      0            0
31   10     Gold Pkt                    Yes     100       200      0            0

* NOTE: CPU queue policer rates are configured to the closest hardware supported value

Output from elsewhere, and the class-to-queue map at the end of the same reading. The values in it are that chapter’s, not this scenario’s.

                        CPP Classes to queue map
======================================================================================
PlcIdx CPP Class                                :  Queues
--------------------------------------------------------------------------------------
0      system-cpp-police-data                   :  ICMP GEN/BROADCAST/ICMP Redirect/
10     system-cpp-police-sys-data               :  Openflow/Exception/EGR Exception/NFL SAMPLED DATA/Gold Pkt/RPF Failed/
13     system-cpp-police-sw-forward             :  Sw forwarding/LOGGING/L2 LVX Data Pack/
9      system-cpp-police-multicast              :  Transit Traffic/MCAST Data/
15     system-cpp-police-multicast-end-station  :  MCAST END STATION /
7      system-cpp-police-punt-webauth           :  Punt Webauth/
1      system-cpp-police-l2-control             :  L2 Control/
2      system-cpp-police-routing-control        :  Routing Control/Low Latency/
3      system-cpp-police-system-critical        :  System Critical/
4      system-cpp-police-l2lvx-control          :  L2 LVX Cont Pack/
8      system-cpp-police-topology-control       :  Topology Control/
11     system-cpp-police-dot1x-auth             :  DOT1X Auth/
12     system-cpp-police-protocol-snooping      :  Proto Snooping/
6      system-cpp-police-dhcp-snooping          :  DHCP Snooping/
14     system-cpp-police-forus                  :  Forus Address resolution/Forus traffic/
5      system-cpp-police-stackwise-virt-control :  Stackwise Virtual OOB/
16     system-cpp-default                       :  Inter FED Traffic/ EWLC Data/
18     system-cpp-police-high-rate-app          :  High Rate App/
19     system-cpp-police-ewlc-control           :  EWLC Control/
20     system-cpp-police-ios-routing            :  L2 Control/ Topology Control/ Routing Control/ Low Latency/
21     system-cpp-police-ios-feature            :  ICMP GEN/ BROADCAST/ ICMP Redirect/ L2 LVX Cont Pack/ Proto Snooping/ Punt Webauth/ MCAST Data/ Transit Traffic/ DOT1X Auth/ Sw forwarding/ LOGGING/ L2 LVX Data Pack/ Forus traffic/ Forus Address resolution/ MCAST END STATION / Openflow/ Exception/ EGR Exception/ NFL SAMPLED DATA/ RPF Failed/

Proves: each queue's default and set rate, its drops, and which queues each class polices. Does not prove: which protocol inside a queue was dropped (ARP and IPv6 neighbor discovery share queue 5), or which port the traffic came from.