OSPF SPF Scheduling and Throttling

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:

LSA received, SPF scheduled after spf-start of 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:

Second LSA during spf-start, SPF runs at 5 seconds

The router sets the wait interval to the spf-hold value which is 10 seconds:

Wait interval set to spf-hold of 10 seconds

During this time, we receive another LSA. Once the 10 seconds have expired, SPF will run:

LSA during spf-hold, SPF runs at 15 seconds

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, there is nothing new to calculate so SPF doesn’t run:

spf-hold doubles to 20 seconds, no LSA so no SPF at 35 seconds

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:

Wait interval reset to spf-start, LSA at 40 seconds

During this time, we receive yet another LSA. After 5 seconds, SPF runs:

Another LSA during spf-start, SPF runs at 45 seconds

The wait interval doubles the value of the previous spf-hold so now it’s 2x 20 = 40 seconds. During this time, however, we don’t receive any other LSAs so SPF doesn’t run:

Sign up for FREE to Get Started

Here's what you'll get:

  • Full Access to 447 lessons.
  • Learn CCNA, CCNP and CCIE R&S. Explained as simple as possible.
  • Unlock Access to this lesson + 424 more by becoming a member.
  • New Lessons Added Regularly. You'll Be the First to Know.
  • Content created by Rene Molenaar (CCIE #41726)

Takes 1 minute - No credit card needed

Tags:


Forum Replies

  1. Avatar for ravi.pande12 ravi.pande12 says:

    Hello Rene,
    I have a question. I see that after the 2xspfhold and then second spf start there is a gap of 5 seconds(35 to 40). Could you please explain as to why is that so?

  2. Avatar for ReneMolenaar ReneMolenaar says:

    Hi Ravi,

    There is no particular reason, the time from 35 to 40 seconds ( 5 seconds in total) is a period of inactivity, I made up that time.

    Rene

  3. Avatar for narad narad says:

    i could not understand the SPF hold and spf-max-wait timer ..??

    Can u please help me with it ??

  4. Avatar for lagapidis lagapidis says:

    Hello Narad

    The OSPF SPF scheduling and throttling feature is used to keep an OSPF topology stable in the event that there is a continuous inflow of LSAs, causing continuous recalculation of the SPF algorithm.

    The spf-hold value is the initial amount of time to wait between one SPF calculation and the next. Every time a new LSA is received before sfp-hold has elapsed, this value doubles, so it waits longer before running the SPF calculation again. You can see this clearly in the diagrams in the lesson.

    Now imagine that you keep getting LSAs all the time.

    ... Continue reading in our forum
  5. Avatar for lin841031 lin841031 says:

    Hi, I have one question in this instance.
    Even if we don’t receive any LSAs in (2x spf-hold) it still have to run SPF?

5 more replies! Ask a question or join the discussion by visiting our Community Forum