SPF (Shortest Path First)
Cheat sheet · https://pcornel.dk/topic.php?topic=1093
Answer
SPF (Shortest Path First, Dijkstra's algorithm) is how OSPF calculates routes: each router puts itself at the root and computes the lowest-cost path to every destination in its LSDB. SPF reruns when topology LSAs change.
Remember
Do not infer service health from one command. For SPF, distinguish configured intent, protocol/security state, installed forwarding state and the original workload result.
First checks
show ip ospf statistics— SPF runs and timingshow ip route ospf— SPF result
Commands
show ip ospf statistics- Shows how often OSPF ran SPF in each area, how long it took and what triggered it.
show ip ospf interface brief
Verify in this order
LSDB change → SPF throttle → SPF run → RIB update
Where it usually breaks
underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path
SPF · technical reference
| Item | Meaning |
|---|---|
| Input | Area topology in LSDB |
| Metric | OSPF cost |
| Output | OSPF candidate paths/routes |
| Later stages | RIB selection then CEF forwarding |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=1093