Configuring CoPP
Figure 1 outlines the CoPP configuration process in the following steps:
Configure traffic classification: Define a group of matching rules to classify traffic, which is the basis for differentiated services.
Configure queue mapping: Configure a forwarding class and local priority for sending different types of packets to a specified CPU queue.
Configure scheduling: Select a queue and process the packets from the queue with the WRR scheduling algorithm and configure a queue scheduler weight.
Configure queue shaping: Set minimum bandwidth and maximum bandwidth for each CPU queue.
Figure 1. CoPP Configuration Process
Procedure
Step 1 Configure CoPP firewall filter rule for traffic classification.
set firewall filter copp sequence <number> from destination-mac-address <mac-address>
NOTEs:
The matching fields of firewall filter rule could be destination-mac-address, source-mac-address, destination-address-ipv4 for IPv4 matching rule, destination-address-ipv6 for IPv6 matching rule, source-address-ipv4 for IPv4 matching rule, source-address-ipv6 for IPv6 matching rule, protocol, destination-port, source-port, ether-type and vlan.
and is the logical operator between the matching fields with the same sequence number, that is, packets must match all of the matching fields with the same sequence number to be included in one class.
Maximum of 32 CoPP matching rules specified with sequence number can be configured separately for IPv4 and IPv6 in the whole switch system.
It is not allowed to commit the configuration if configured from node of matching field without configuring then node of the same sequence number. However, it is allowed to configure then node without configuring from node, the configuration of then node is not used.
Step 2 Configure queue mapping of CoPP policy.
set firewall filter copp sequence <number> then forwarding-class <forwarding-class name>
Step 3 Configure mapping between forwarding class and local priority.
set class-of-service forwarding-class <forwarding-class-name> local-priority <int>
Step 4 Configure queue scheduler weight.
set class-of-service scheduler <scheduler-name> weight <value>
NOTE:
It is NOT recommended to use the weight value for CPU queue scheduling due to hardware restrictions.
Step 5 Configure WRR scheduling algorithm for queue scheduling.
set class-of-service scheduler <scheduler-name> mode WRR
Step 6 Configure max bandwidth and min bandwidth for queue shaping.
set class-of-service scheduler <scheduler-name> max-bandwidth-pps <value>
set class-of-service scheduler <scheduler-name> min-bandwidth-pps <value>
NOTE:
The total value of min-bandwidth-pps of all activated queues should be less than the CPU-affordable PPS depending on different platforms, which should be the maximum PPS threshold to the CPU.
Step 7 Configure the DSCP remark for COPP.
set firewall filter copp sequence <number> then dscp <dscp-value>
Step 8 Configure CoPP scheduler profile.
set class-of-service scheduler-profile copp-profile forwarding-class <forwarding-class-name> scheduler <scheduler-name>
Step 9 Commit the configuration.
commit