Technical Tip: FortiGate QoS traffic shaping considerations for NP7 platforms - QTM vs TPE engines
Description | This article describes a few important traffic shaping considerations for NP7 platforms, available options and recommendations. | ||||||||||||||||||||||||
Scope | FortiGate NP7 platforms v6.4, v7.0, v7.2, v7.4, v7.6. A list of NP7 processor-based FortiGate platforms can be found in FortiGate NP7 architectures | ||||||||||||||||||||||||
Solution | Suppose traffic shaping is configured on NP7 processor-based FortiGates. In that case, the corresponding traffic shaping policies are applied to the offloaded traffic with one of two mechanisms in the NP7 driver - QTM engine-based or TPE engine-based.   If the default-qos-type configuration is changed, the FortiGate immediately restarts. So ensure to implement this command with caution and preferably during a maintenance window. If FortiGate is in HA mode, both units will be restarted at the same time.  Under certain conditions, the NP7 default-qos-type might be different than the option configured under config system npu -> 'default-qos-type'. Verify that the current npu qos-type reflects the option configured using the following diagnose command:  default_qos_type policing (TPE engine in use):  default_qos_type shaping (QTM engine in use):  The 'default-qos-type' configuration is used to set the shaping engine option (either QTM or TPE engine) for the NP7 driver, where shaping uses the NP7 QTM engine for shaping and policing uses the NP7 TPE engine (note that this option has seen changes in recent firmware, see the note at the bottom of the article for additional information): Â
Â
 The default value of 'default-qos-type' is different depending on the FortiOS version. Here is a summary: Â
 Note: The default qos-mode setting is force-changed to 'policing' after upgrading to v7.2.11+, v7.4.8+, and v7.6.3+. If an upgrade is made to earlier versions, the default might remain as it was on the version before the upgrade (i.e, shaping). Run the CLI command 'diagnose npu np7 system-config' to confirm the setting that is currently active on the FortiGate.  Verify the traffic shaper setting after an upgrade: If a FortiOS upgrade is made to a version that has a different default setting for 'default-qos-type' than the version it is upgraded from, it is important to verify what is the active setting is after upgrade and confirm that is the intended setting. So run the commands 'show system npu' and 'diagnose npu np7 system-config' on the old version before the upgrade, and on the new version after the upgrade - to verify the default-qos-type setting that's active after upgrade, and change the configuration if needed.  Random packet drops after an upgrade: If there are random packet drops observed after an upgrade (even when traffic rate is within the shaping/policing limits), verify if shaping is the default-qos-type as mentioned in the previous section, and if yes, consider changing it to policing to use the TPE engine as the traffic shaper. If it can't be immediately changed (since a restart happens immediately after entering the cli command to change the QOS-type), workaround below can be used in the meantime to stop the NP7 QTM from blocking the traffic:   Note that the default setting is set qtm-buf-mode 6ch  Note: Run the CLI diagnostic command 'diagnose npu np7 getreg 0 qtm.qtm_dbg' about 5 times with 10-second intervals, and observe if this specific counter 'sch0_enq_drop_cnt' is increasing. This indicates possible packet drops due to the QTM buffer being full or being in an incorrect state. If packets drop and traffic disruption continues even after applying the above workaround, contact Fortinet support with this diagnostic output and any other relevant details.  Note regarding default-qos-type changes: Starting from v7.4.8 GA (What's new for FortiOS 7.4.8), v7.6.3 GA, the option 'default-qos-type' under 'config system npu' no longer supports shaping, and the only selection for this option is policing:   The reason for this change is a known issue with fragmentation when the Queuing based Traffic Management QTM is utilized as result of selecting shaping for this option where packets above 6000 MTU, causing the QTM to hang and fragmentation to stop working. Detailed information can be found on the following release notes link: Changes to NP7 traffic shaping  That default-qos-type setting cannot be changed if the hyperscale firewall license is enabled.  Related documents: Traffic shaping policies flowchart and configuration guide Troubleshooting Tip: Traffic shaping troubleshooting commands |
