When an OSPF router is initially connected to a network it completes the following generic link-state routing process and gets the state of convergence through changing different states.
Create adjacencies with neighbors
OSPF configured router form adjacencies with their neighbors prior to share information with that neighbor. It sends Hello packets out all OSPF-enabled interfaces to resolve connected OSPF neighbors on those interfaces. If a neighbor is found, it attempts to establish a neighbor adjacency with that neighbor.
Exchange routing information Using LSAs
When adjacencies are established between neighbors, then they exchange link-state advertisements (LSAs) with each other’s containing the state and cost of each directly connected link. Routers flood their LSAs to adjacent neighbors and adjacent neighbors receive the LSAs and flood it immediately to other directly connected neighbors until all routers in the area have all LSAs.
Build the topology table
After receiving the LSAs, OSPF-enabled routers build the topology table based on the received LSAs. It holds all the information about the topology of the network. It is important that all routers in the area have the same information in the topology table.
Execute the SPF algorithm
Routers then execute the SPF algorithm. The SPF algorithm creates the SPF tree.
Calculate the best routes
After creating the SPF tree the router inserts the best path into the routing table. Routing decisions are made based on the entries in the routing table.
This is the real state of the router which is required for actual operation of the routing. The OSPF progresses through different states while attempt to reach convergence. The figure below illustrates the different state of the OSPF progress:
- When the router is down.
- The router sends Hello Packet
- If the router is exciting to init state.
- The router has just received the hello packet from the neighbors containing the sending router ID.
- Transition to Two-Way State
- Elect a DR or BDR on Ethernet links
- Transition to ExStart State
- Negotiate master / Slave relationship, also DBD packet sequence number
- The master initiates the DBD packet exchange
- In this state Routers Exchange DBD Packets.
- In case of additional requirement of information router transit to loading state, otherwise, the transition to the full state.
- To gain more information router uses LSRs and LSUs.
- The route is processed using the SPF algorithm
- Transition to full state
- This is the actual state which is required also know as a converged state.