OSPF process flow

In order to understand how OSPF works, it is first important to have a firm grasp of the overall OSPF process flow, which is shown below.

  1. Discover OSPF Neighbor
  2. Synchronize LSDB
  3. Run the SPF algorithm to register the best route in the routing table
  4. Maintaining Neighbor

Discover OSPF Neighbor

In the case of RIP, the RIP route is suddenly sent by multicast. RIP routes are sent with a bit of laxity, thinking that if there is a RIP router on the same network, it will receive them. In comparison, OSPF discovers neighbors first. Neighbors are other OSPF routers on the same network; OSPF Hello packets are used to find other OSPF routers, recognize them as neighbors, and then exchange OSPF with them.

Synchronize LSDB

Then, LSAs are exchanged with the neighbor to synchronize the LSDB. At that time, DD packets, LSR packets, LSU packets, and LSAck packets are used to synchronize the LSDB between OSPF routers on the same network since they are basically neighbors. LSDB synchronization is done between OSPF routers on the same network, and eventually all OSPF routers in the same area will maintain the identical LSDB.

In Ethernet networks, LSDB is not synchronized between all neighbors; LSDB is synchronized between DR, and finally LSDB is synchronized between OSPF routers on the same network.

Run the SPF algorithm to register the best route in the routing table

Once the LSDB synchronization is complete, each OSPF router will run the SPF algorithm to determine the best route for each. In this case, OSPF cost is used as a metric. The optimal route is registered in the routing table so that IP packets can be routed.

Maintaining Neighbor

After that, Hello packets are exchanged periodically to verify that the neighbor is working properly.

 Figure OSPF process flow
Figure OSPF process flow

If there is a change in the network diagram, such as a failure or the addition of a new network, the Trigard update will notify the change. LSU packets are used for this purpose.

How the OSPF works