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 neighbours
OSPF configured router form adjacencies with their neighbours before share information with that neighbour. It sends Hello packets out all OSPF-enabled interfaces to resolve connected OSPF neighbours on those interfaces. If a neighbour is found, it attempts to establish neighbour adjacency with that neighbour.
Exchange routing information Using LSAs
When adjacencies are established between neighbours, 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 neighbours and adjacent neighbours receive the LSAs and flood it immediately to other directly connected neighbours 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. All routers in the area must 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 the actual operation of the routing. The OSPF progresses through different states while attempt to reach convergence. The figure below illustrates the different states 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 neighbours 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.