Configuring a Rule for Sending Packets to the CPU
Context
To reduce the number of packets sent to the CPU and prevent interference between the packets of different types, the switch limits the rate of packets sent to the CPU in different mode, including the rate limiting for protocol packets and rate limiting for all packets on an interface. Rate limiting for protocol packets has a higher priority than rate limiting for all packets on an interface. When both the rate limiting methods are configured, the device uses the minimum value to limit the packet rate.
The default CAR value is recommended.
For BFD packets, this command does not take effect on CE-L36LQ-FD, CE-L36CQ-FD, CE-L36CQ-FG, CE-L36CQ-FD1, CE-L36CQ-SD, CE-L48XS-FG, CE-L08CF-FG1, CE-L48XS-FD1, CE-L24LQ-FD, CE-L16CQ-FD, CE-L12CQ-FD cards.
Procedure
- Run system-view
The system view is displayed.
- Configure a rule for sending packets to the CPU.Configure a rate limit for protocol packets and an interface-based rate limit in the attack defense policy view.
- Run cpu-defend policy policy-name
The attack defense policy view is displayed.
Configure a rate limit for protocol packets.
The action to be performed on protocol packets sent to the CPU can be car or deny. When you configure the action to be performed on packets of the same protocol, the latest configuration takes effect.
Run car packet-type packet-type pps pps-value
The CAR value for packets sent to the CPU is set and the threshold is set.
Run deny packet-type packet-type
The action taken for the packets sent to the CPU is set to deny.
By default, the rate of packets sent to the CPU is limited using the rate limit in the default policy. You can run the display cpu-defend configuration command to check the CAR values of packets.
Rate limiting cannot be configured for protocol packets in a VS. To limit the rate of protocol packets in a VS, run the cpu-defend-policy command in the management VS to limit the rate of protocol packets on a specified card.
Set an interface-based rate limit.
Run car all-packets pps packets
The number of packets sent from CPU interfaces to the CPU within a certain period is limited.
By default, a maximum of 5120 packets can be sent to the CPU of an LPU per second.
The car all-packets pps command is required only when the current CAR configuration cannot reduce CPU loads.
- Run cpu-defend policy policy-name
- Run commit
The configuration is committed.