OSPF Path Calculation Process

OSPF (Open Shortest Path First) calculates the best path to each destination using the Dijkstra’s Algorithm (also known as the Shortest Path First (SPF) algorithm). The process involves multiple steps to ensure accurate and loop-free routing.


Step 1: Establish Neighbor Relationships


Step 2: Build the Link-State Database (LSDB)


Step 3: Run the SPF Algorithm

Dijkstra’s Algorithm Key Steps:

  1. Mark the router itself as the starting point (Root).
  2. Assign an initial cost of 0 to itself and infinity to all other nodes.
  3. Examine all directly connected nodes, calculate the cost (using interface bandwidth), and record the lowest cost path.
  4. Mark the node with the lowest cost as “visited” and add it to the Shortest Path Tree (SPT).
  5. Repeat the process until all nodes are visited.

Step 4: Best Path Selection

Cost=Reference BandwidthInterface Bandwidth\text{Cost} = \frac{\text{Reference Bandwidth}}{\text{Interface Bandwidth}}Cost=Interface BandwidthReference Bandwidth​

Default Reference Bandwidth: 100 Mbps (adjustable via auto-cost reference-bandwidth for higher-speed links).

BandwidthCost
10 Mbps10
100 Mbps1
1 Gbps1
10 Gbps1 (unless reference bandwidth is adjusted)

Step 5: Install Routes in the Routing Table


Step 6: Ongoing Maintenance


Example Network Topology

[R1] ----- 10 Mbps ----- [R2]
| |
|----- 100 Mbps ----- [R3]

Key Notes

✅ OSPF is loop-free due to the SPF algorithm.
✅ LSDB synchronization ensures all routers have a consistent view of the network.
✅ OSPF recalculations can be minimized by effective area design and summarization.

renjithbs Avatar

Posted by

Leave a comment