How OSPF neighbors form and share information
OSPF routers discover each other by sending Hello packets to the multicast address 224.0.0.5. Before two routers will exchange routing information, they have to form a neighbor relationship. This requires matching Hello and Dead intervals, the same Area ID, the same subnet, compatible authentication settings, and matching MTU on some platforms. If any of these do not match, OSPF stays stuck at Init or Two-Way and never progresses to Full.
Once neighbors are fully adjacent, they flood Link State Advertisements (LSAs) across the area. Each LSA describes a piece of the topology: which networks a router is connected to, what the cost is, and who the neighbors are. Every router collects all the LSAs and builds an identical Link State Database (LSDB). From that database, each router runs the Dijkstra shortest path first (SPF) algorithm to calculate the lowest-cost path to every destination.
Cost is the metric OSPF uses to choose paths. By default, Cisco calculates cost as 10^8 (100,000,000) divided by the interface bandwidth in bits per second. A 100 Mbps link has a cost of 1. A 10 Mbps link has a cost of 10. This default breaks on links faster than 100 Mbps because they all get cost 1. Fix this by setting the reference bandwidth to match your fastest link: auto-cost reference-bandwidth 1000 for a 1 Gbps network.
Areas, DR/BDR election, and route types
OSPF organizes routers into areas to limit the scope of LSA flooding. All OSPF networks must include Area 0, the backbone area. Other areas connect to Area 0 through Area Border Routers (ABRs). This hierarchy keeps the LSDB small and SPF calculations fast in large networks.
On broadcast networks like Ethernet, OSPF elects a Designated Router (DR) and Backup Designated Router (BDR) to reduce the volume of LSA traffic. Instead of every router forming a full adjacency with every other router, all routers form adjacencies only with the DR and BDR. The DR and BDR communicate with non-designated routers at 224.0.0.6. Election: highest OSPF priority wins (default 1, range 0-255, priority 0 means never a DR). Tie goes to highest Router ID.
Route types in OSPF output: O is an intra-area route (same area). O IA is an inter-area route (learned through an ABR from another area). O E1 or O E2 are external routes redistributed into OSPF. On the CCNA, knowing O versus O IA is usually enough.
How to choose the correct answer
OSPF neighbor not forming: check Hello/Dead interval match, same area, same subnet, no authentication mismatch, matching MTU.
Route not appearing: verify OSPF is active on the correct interface (check passive-interface settings), check area configuration, confirm neighbor adjacency is Full.
Path selection: OSPF chooses the path with the lowest cumulative cost. If a faster path exists but OSPF ignores it, check that reference-bandwidth is consistent across all routers.
DR election: highest priority wins. Priority 0 means the router will never be DR or BDR. Ties go to highest Router ID (often the highest loopback IP).
O in routing table = intra-area OSPF. O IA = inter-area. O E2 = external, cost does not accumulate. O E1 = external, cost accumulates.