Skip to main content
Rudresh_Veerappaji
Staff
Staff
Mar 27, 2025 6:51 PM UTC

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.
This is configurable using the npu system setting 'set default-qos-type'. It is important to understand the difference between the two options, identify which is the default setting in a FortiOS version, and when the setting needs to be changed after an upgrade. There may be intermittent packet drops under certain conditions after upgrades, depending on which option was configured: how to identify this and remediate it proactively is explained in this article as well.
Traffic shaping profiles and policy configurations are explained in the Traffic Shaping Policies section of the FortiGate Administration Guide, while this article focuses on the implications of NPQoS type setting for NP7 platforms.

 

config system npu
    set default-qos-type { policing | shaping }
end

 

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):

FortiGate-2601F-NP7 # diagnose npu np7 system-config | grep default_qos_type
default_qos_type : policing (0)

 

default_qos_type shaping (QTM engine in use):

FortiGate-2601F-NP7 # diagnose npu np7 system-config | grep default_qos_type
default_qos_type : shaping (1)

 

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):

 

  1. Traffic shaping with 'shaping' as default QOS type: If 'default-qos-type' is shaping, the NP7 driver will use the QTM engine (Queuing based Traffic Management engine) as the shaping engine. QTM caps shaping at 10 Gbps on each interface. With the QTM engine, a round robin algorithm is used to schedule traffic in available queues for shaping. Under certain conditions, the QTM engine may cause the NP7 driver to intermittently drop packets even when configured shaping limits are not exceeded (more on this in a later section covering upgrades). As a result, in the newer FortiOS versions, the default qos-type is set to policing. 

 

  1. Traffic shaping with 'policing' as default QOS type: If 'default-qos-type' is set to policing, the NP7 driver will use the TPE engine (Traffic Policing Engine) as the shaping engine. Traffic shaping is done with policing by using the NP7 accounting stats. This is the recommended mode for v7.2+, v7.4+, and v7.6+. The TPE module max shaper limit is 8Gbps. The 8 Gbps ceiling is per shaper (traffic shaper or per-ip-shaper). Each traffic shaper and each per-IP shaper can enforce up to 8 Gbps on its own. Several shaping policies can each reference one of these shapers, and each policy is capped at 8 Gbps independently.

 

The default value of 'default-qos-type' is different depending on the FortiOS version. Here is a summary:

 

Major FortiOS version

The default value of 'default-qos-type'

Can it be changed in the CLI 

References

v6.4.x

shaping

Yes

-

v7.0.x

shaping

Yes

Traffic shaping - FortiOS 7.0.17 documentation

v7.2.x

policing

No

Traffic shaping - FortiOS 7.2.11 documentation

v7.4.x

policing

Yes

Traffic shaping - FortiOS 7.4.7 documentation

v7.6.x

policing

Yes

Traffic shaping - FortiOS 7.6.2 documentation

 

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:

 

config system npu
    set qtm-buf-mode 4ch
end

 

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:

 

FortiGate-2601F-NP7 # config system npu

FortiGate-2601F-NP7 (npu) # set default-qos-type ?
policing    QoS type 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

    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT