Description | This article describes how to correlate high CPU usage with the number of IP fragments crossing the network. |
Scope | FortiGate NP6, NP6xlite, NP6lite. |
Solution |
Fragmented packets cannot be accelerated on NP6 processors. A huge amount of fragments could thus have an impact on CPU usage. This article is supposed to help in:
A huge amount of fragmented packets per second can lead to an over-increment of softirq usage percentage.
Check real-time CPU usage by running the following command:
diagnose sys mpstat <delay> <loops>
This command shows information about CPU usage every <delay> seconds and for the specified number of loops <loops>. See Technical Tip: Deprecated of command '# diagnose sys top-summary'.
In this example, taken from a 3600E (88 cores), CPU 74 shows a high softirq percentage:
diag sys mpstat 5 10
CPU profiling: To understand what is causing the most number of soft interrupts, run a CPU profiling on the affected core(s):
diag sys profile cpumask <CPU_id> <----- Where CPU_id is the number of the affected core.
For further details, check here:
diag sys profile cpumask 74 diag sys profile start diag sys profile show order
Number of fragmented packets: To confirm the assumption (from 7.0.6 and on), it is possible to run 'diagnose snmp ip frags rate' to display the ratio of fragmented packets per second. If the ratio is high, there is likely a correlation between softirq usage and the number of fragments. See Technical Tip: How to calculate fragmented packets per second hitting a FortiGate for further details.
Output example:
diag snmp ip frags rate In this example, the ratio is very high, and could likely mean CPU overusage.
To identify the source(s) of fragmented traffic, a specific sniffer filter can be used, namely:
diagnose sniffer packet any '((ip[6:2] > 0) and (not ip[6] = 64))' <level> <packet count limit> <ts format>
Output example:
diag sniffer packet any '((ip[6:2] > 0) and (not ip[6] = 64) and host 10.86.255.4)' 4 1000 l 2024-01-26 17:26:22.365132 Underlay_1 in 10.86.255.4 -> 10.86.0.4: ESP(spi=0xc5971903,seq=0xedd15a3) (frag 5539:1480@0+)
Further details about advanced sniffing filters can be found in Troubleshooting Tip: Filter 'diagnose sniffer packet' to collect fragmented packets only. Once the fragmented traffic source(s) has been identified and tuned, CPU usage should come back to expected values.
Note: On NP7 platforms, fragments can be offloaded (see the documentation). |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.