Table of Contents
Example model & SONiC version:
The control plane policing (CoPP) feature increases security on the switch by protecting the CPU from unnecessary or DoS traffic and giving priority to the important control plane and management traffic.
For example, control packets such as sFlow, ICMP, LLDP, ARP, and routing protocols (BGP, OSPF, etc) are handled by the local processor. These control packets are matched as exact or prefix matches with address fields. A control classifier engine in the switching ASIC decides whether to trap to the CPU upon its configuration. The CoPP configuration limits the rate at which these packets can be handled, and the rest are dropped.
The default CoPP configuration is fine-tuned for system operation. Users should take extreme caution before making changes or modifications, as the system can become dysfunctional. Recovery will require reversing the changes from a backup or resetting to the factory default configuration. |
/etc/sonic/copp_cfg.json holds all CoPP-related tables.
It has two sections:
1. “COPP_GROUP” to manage queue groups with actions, priorities, queues, etc. Each group have several options to indicate how the protocol packets are handled under certain conditions.
"COPP_GROUP": {
"default": {
"queue": "0",
"meter_type":"packets",
"mode":"sr_tcm",
"cir":"600",
"cbs":"600",
"red_action":"drop"
...
"queue4_group2": {
"trap_action":"copy",
"trap_priority":"4",
"queue": "4",
"meter_type":"packets",
"mode":"sr_tcm",
"cir":"600",
"cbs":"600",
"red_action":"drop"
},
...
2. “COPP_TRAP” manages traps for different types of traffic.
"COPP_TRAP": {
"bgp": {
"trap_ids": "bgp,bgpv6",
"trap_group": "queue4_group1"
},
"lacp": {
"trap_ids": "lacp",
"trap_group": "queue4_group1",
"always_enabled": "true"
},
...
"sflow": {
"trap_group": "queue2_group1",
"trap_ids": "sample_packet"
}
}
The trap group default trap IPv4/IPv6 packets with TTL=0 in their IP headers to the CPU. |
A CoPP trap consists of trap ID and trap group. The latter has options – action and meter indicating how to handle the protocol packets under matched conditions. The meter can be packets or bytes; the action can be copy, trap, or drop. The trap ID is predefined as protocol packets, e.g. BGP, LACP, STP, and so on. A trap group offers configurable criteria to trigger the trap upon matching, and we will describe them below.
{
"COPP_GROUP": {
"<group-name>": {
"queue": <CPU queue#>,
"trap_action": <trap, copy, or drop>,
"trap_priority": <priority>,
"meter_type": <packets, bytes>,
"mode": <sr_tcm, tr_tcm, storm>,
"color": <aware, blind>,
"cbs": <commit burst size>,
"cir": <commit information rate>,
"pbs": <peak burst size>,
"pir": <peak information rate>,
"green_action": <action for packets marked as green>,
"yellow_action": <action for packets marked as yellow>,
"red_action": <action for packets marked as red>,
"genetlink_name": <psample for sflow>,
"genetlink_mcgrp_name": <packets for sflow>
}
},
"COPP_TRAP": {
"<trap-name>": {
"trap_ids": <list of trap ID>,
"trap_group": <group name>
}
}
}
Parameter Description
Supported trap IDs
Some models may not support specific trap IDs or have limitations. |
To check and change the sampling rate for ARP packets, we need to check the corresponding COPP_TRAP section:
"arp": {
"trap_ids": "arp_req,arp_resp,neigh_discovery",
"trap_group": "queue4_group2",
"always_enabled": "true"
},
These traps belong to the queue4_group2 group, and in the COPP_GROUP section we can see:
"queue4_group2": {
"trap_action":"copy",
"trap_priority":"4",
"queue": "4",
"meter_type":"packets",
"mode":"sr_tcm",
"cir":"600",
"cbs":"600",
"red_action":"drop"
},
We have a limit of 600 packets per second, and all packets above this value will get dropped.
An example of BFD packet trapping to CPU:
"queue5": {
"trap_action":"trap",
"trap_priority":"5",
"queue": "5",
"meter_type":"packets",
"mode":"sr_tcm",
"cir":"60000",
"cbs":"60000",
"red_action":"drop"
},
"bfd": {
"trap_ids": "bfd,bfdv6",
"trap_group": "queue5",
},
User is expected to resolve any conflicts, say for a trap id or group, that arises due to values configured by the user.
Applying changes requires a system reboot.
Taoyuan, Taiwan, 20th of January 2025. Netberg, the leading provider of open networking solutions, announces support of Ubuntu 24.04 Noble Numbat on its Broadcom-enabled portfolio.
Taoyuan city, Taiwan, 24th of June 2024. Netberg announced the new Aurora 721 100G and Aurora 421 10G switches, which feature programmable pipelines powered by Broadcom StrataXGS® Trident3 Ethernet switch chips.
Taoyuan city, Taiwan, January 24th, 2024. Netberg announced the release of two new models powered by the Broadcom StrataXGS® Trident3 series , the Netberg Aurora 221 1G switch and Aurora 621 25G switch.
Effective January 12, 2024: The following products are now End of Life (EOL) - Aurora 720 and Aurora 620.
Taoyuan city, Taiwan, December 20th, 2023. Netberg updates its Netberg SONiC distribution to release 2022.11 on Aurora 610, Aurora 710, and Aurora 750 P4-Programmable Intel Tofino IFP systems.
Taipei, Taiwan, 14th of November 2022. Netberg announced the new Aurora 810 400G model programmable switch with Intel Tofino 2 Intelligent Fabric Processors (IFPs) at its heart. The new platform has 32x 400G QSFP-DD Ethernet ports and a 12.8Tbps switching capacity.