OSPF Explained: A Complete Guide with Concepts
Open Shortest Path First (OSPF) is a standards-based link-state interior gateway protocol (IGP) widely used in enterprise and campus networks. Unlike distance-vector protocols that rely on hop counts and periodic full-table updates, OSPF builds a complete topological map—the Link-State Database (LSDB)—and runs Dijkstra’s Shortest Path First (SPF) algorithm to compute loop-free best paths based on link cost.
code/configuration R1(config)# router ospf 1 R1(config-router)# router-id 1.1.1.1 R1(config-router)# network 10.0.12.0 0.0.0.255 area 0 R1(config-router)# network 192.168.1.0 0.0.0.255 area 0 R1(config-router)# passive-interface GigabitEthernet0/1 R1(config-router)# exit
Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 1 FULL/BDR 00:00:34 10.0.12.1 GigabitEthernet0/0 3.3.3.3 1 FULL/DR 00:00:37 10.0.23.3 GigabitEthernet0/1
Core OSPF Mechanics
OSPF establishes adjacencies, synchronises topology data, and selects routes through four main processes:Neighbor Discovery (Hello Packets): Routers send Hello packets to multicast address 224.0.0.5 (all OSPF routers) on active interfaces. Adjacency forms when Hello/Dead intervals, Area ID, subnet mask (on broadcast/point-to-point links), and authentication match.Database Synchronisation (LSA Exchange): Adjacent routers exchange Link-State Advertisements (LSAs) so every router within an area shares an identical LSDB.SPF Calculation: Each router treats itself as the root of an SPF tree and installs the lowest-cost path into the routing table. Interface cost defaults to $\text{Reference Bandwidth} / \text{Interface Bandwidth}$.DR and BDR Election: On broadcast multi-access networks such as Ethernet, OSPF elects a Designated Router (DR) and Backup Designated Router (BDR) to reduce LSA flooding overhead and adjacency count.