When an OSPF router receives an updated LSA, it doesn’t 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’s likely that you will receive 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 the topology change is caused by a flapping link 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 keep increasing if you keep receiving updated LSAs.
This scheduling of SPF is controlled by SPF throttling. There are three values that it uses:
- spf-start: the initial wait interval before SPF starts after receiving an updated LSA.
- spf-hold: the wait interval between subsequent SPF runs. This value doubles for each time SPF runs.
- spf-max-wait: the maximum time between two SPF runs, used to cap the spf-hold value. It also defines how long the network has to be stable before the wait interval is reset to the spf-start and spf-hold values.
Let me explain how this works. Let’s assume we use the following values:
- spf-start: 5 seconds
- spf-hold: 10 seconds
- spf-max-wait: 60 seconds
Our router receives an LSA and schedules SPF according to the spf-start value, which is 5 seconds:
During this time, the router receives another LSA. This LSA is stored in the LSDB but we have to wait until the wait interval (5 seconds) expires. Once these 5 seconds have expired, SPF will run:
The router sets the wait interval to the spf-hold value which is 10 seconds:
During this time, we receive another LSA. Once the 10 seconds have expired, SPF will run:
The router now doubles the spf-hold value so now it’s 2x 10 = 20 seconds. During this time, we don’t receive any other LSAs. Once 20 seconds have elapsed, SPF runs again:
Since we didn’t receive any LSAs during the last wait interval, the router resets the wait interval to spf-start. A few seconds later, we receive another LSA:
During this time, we receive yet another LSA. After 5 seconds, SPF runs:
The wait interval doubles the value of the previous spf-hold so now we have to wait 2x 20 = 40 seconds until SPF runs. During this time, however, we don’t receive any other LSAs: