The high-level operation of OSPF is explained below:
- OSPF routers send Hello packets out of all OSPF-enabled interfaces. Two routers sharing a common data link become neighbors. If they agree on certain parameters in Hello packets.
- Some neighbors move on and form adjacencies, which can be thought of as virtual point-to-point links over which routing information is exchanged.
- Each OSPF router sends LSAs (link-state advertisements) over all its adjacencies. The LSAs describe the router’s neighbors, links, and the state of the links. OSPF defines multiple LSA types to communicate different types of link-state information.
- When an OSPF router receives an LSA from a neighbor, it adds the LSA to its link-state database. The router also sends a copy of the LSA over all of its adjacencies. The flooding of LSAs throughout an OSPF area enables all routers to have identical link-state databases.
- When the link-state databases are built, every router runs the Dijkstra’s SPF (Shortest Path First) algorithm to calculate the shortest loop-free path to every known subnet. The collection of all paths calculated by the router, with itself as the root, is known as the SPF tree.
- Each router populates its routing table from its SPF tree.