What is OSPF?
Language-wise it stands for Open Shortest Path First, and family-wise it belongs to the Link-State Interior Gateway Dynamic Routing Protocols. OSPF is an open standard internal routing protocol that is supported across all the different vendors manufacturing networking platforms.
In this article, we will review the basics and specs of this protocol, and see its own unique features.
OSPF Neighbor States
As a start, the OSPF routing protocol uses a multicast hello message that is destined to the OSPF multicast address of 224.0.0.5, seeking any possible other OSPF routers in the area.
This message keeps repeating every 10 seconds by default, and it is sent out of the interfaces that were configured for OSPF, which depends on how you configured it plus the vendor-specific configuration template.
Upon receiving a multicast hello message from another router that we already sent a hello message to earlier, that reply should arrive within the dead timer of 40 seconds maximum (by default).
An OSPF neighbor process moves through the following states:
Init
At the moment of confirmation that a bidirectional multicast hello has initiated.
2-Way
Communication from the two parties has successfully occurred.
ExStart
The OSPF router-id gets exchanged and database information begins to be shared.
Exchange
Link states are communicated and exchanged bidirectionally.
Loading
Final synchronization of LSAs.
Full
Settlement and official neighboring announcement.
OSPF Routing Protocol
Before starting routing, OSPF understands its neighboring environment by drawing a shortest-path tree (SPT) to those neighbors that it established a neighboring state with earlier, based on Dijkstra's Algorithm.
Having the tree allows the OSPF router to know how to reach each neighbor in the best way, and that depends on the OSPF metric calculated per neighbor, named the "Cost".
OSPF at Rest
With no triggers or events, OSPF routers stay calm, with no need to exchange any routes or LSAs, leaving the databases named LSDBs steady and identical between routers, containing the same types and amounts of LSAs.
Only the OSPF hello message is forever bidirectionally exchanged to maintain the neighbor state.
OSPF in Network Engineer Interviews
OSPF is one of the most common network engineer interview topics, and almost every network engineer faces some OSPF questions in an interview. Questions typically range from OSPF LSAs and OSPF areas to multi-area hierarchical OSPF design for stability, along with OSPF security and OSPF fast convergence. Reviewing the basics above, the neighbor states, and how the SPF tree is built is a solid way to prepare for these questions.
