Skip to content
1 min read OSPF

How OSPF SPF Algorithm and LSDB Work

OSPF builds the LSDB, then runs Dijkstra (SPF) to calculate best paths. Here is what triggers partial vs full SPF and how to tune the throttle timers.

How OSPF SPF Algorithm and LSDB Work

When SPF Runs

Triggers:

Partial SPF: Only affected routes recalculated
Full SPF: Entire tree rebuilt

SPF Timers

router ospf 1
 timers throttle spf 5000 10000 10000

Format: start hold max (milliseconds)

Monitoring SPF

R1# show ip ospf | include SPF
  SPF algorithm last executed 00:15:23.456 ago
  SPF algorithm executed 8 times

Many SPF runs = unstable network

Summary

LSDB — Link-state database (network map)
SPF — Dijkstra's algorithm (calculates best paths)
Triggers — Topology changes
SPF timers — Control calculation frequency

Next: Route Summarization (Article 28)

Internal Links: