Technical Tip: How to Implement OSPF SPF scheduling and throttling
Description
This article describes the implementation of shortest path first scheduling and throttling in FortiOS.
Scope
FortiGate.
Solution
Overview:
- When an OSPF router receives an updated LSA, it does not run SPF right away but schedules it.
- It does so in case there is a change in the topology.
- However, the local router is probably not the only one affected, so it is likely that it receives more than one updated LSA.
- The router waits for a short while so that it only has to run SPF once for all updated LSAs.
- If a flapping link causes the topology change, then the router would run SPF over and over again, increasing its load.
- To ensure this doesn’t happen, the delay before SPF runs will continue to increase if updated LSAs are still received.
Fortinet allows for the configuration of SPF delay time and SPF hold time as mentioned below.
- The SPF delay_integer specifies the delay after a routing update is received until the SPF calculation is performed.
- The SPF hold_integer specifies the time between SPF calculations.
- The default in seconds is 5 for the delay_integer and 10 for the hold_integer.
- If the OSPF routing environment permits, increasing the delay and frequency with which SPF calculations are performed is possible.
CLI syntax.
Configure values where the first number is the delay integer and the second is the hold integer
set spf-timers “delay_integer” “hold_integer” <enter>
<sfp-delay_timer> <----- Specifies the initial delay before the first SPF run after an LSA (Link State Advertisement) update, allowing for stabilisation and batched processing of multiple updates.
<sfp-hold_timer> <----- Determines the interval between subsequent SPF runs, which doubles each time SPF is triggered again, implementing an exponential backoff to prevent excessive recalculations during frequent network changes.
configure router ospf
set spf-timers “delay_integer” “hold_integer” <enter>
end
- This mechanism helps optimise network stability and performance by balancing responsiveness with increased efficiency.
- Changing the SPF timers
config router ospf
set router-id 1.1.1.1
set spf-timers 0 2 <<<<<
end
- The OSPF route will be deleted from the Routing table after 2 seconds.
2025-07-08 00:17:32 [root] OSPF: BFD[port1:10.191.20.69-1.1.1.1]: BFD Down; Inactivity Timer scheduled
2025-07-08 00:17:32 [root] OSPF: NFSM[port1:10.191.20.69-1.1.1.1]: Status change Full -> Down
2025-07-08 00:17:34 [GLOBAL] NSM: RIB update for 100.0.0.0/24
2025-07-08 00:17:34 [GLOBAL] NSM: RIB[default:100.0.0.0/24]: Delete from FIB
