What is OSPF?

Published Aug 13, 2026

← All glossary terms Jump to O

Open Shortest Path First (OSPF) is an interior gateway protocol that uses a link-state algorithm to compute the shortest path to every destination inside a routing domain. Each router floods link-state information to its neighbors, builds an identical topology map, and independently runs a shortest-path-first calculation to select loop-free routes.

Key takeaways

  • OSPF is a link-state IGP that computes shortest paths with an SPF algorithm.
  • OSPFv2 routes IPv4; OSPFv3 routes IPv6 and dual-stack networks.
  • Areas – backbone area 0 plus standard, stub, and NSSA – bound flooding scope.
  • Neighbors progress through hello, database sync, and Full adjacency states.
  • VOS supports OSPFv2 and OSPFv3 with authentication, BFD, and redistribution.

On this page: Why it mattersHow it worksTypesOSPF & VersaFAQ

Why is OSPF important?

OSPF is one of the two dominant interior gateway protocols (the other is IS-IS) for routing inside an autonomous system – a campus, a data center fabric, or the LAN side of an SD-WAN branch. Because every router in an area holds an identical topology map, OSPF converges quickly after a link failure, without distance-vector-style recomputation.

It also matters because it is an open, vendor-neutral standard (RFC 2328), so OSPF interoperates cleanly between devices from different vendors on the same segment. Its area hierarchy bounds how far topology changes flood – the default choice for routing inside a network, as opposed to between networks, where BGP takes over.

What is OSPF?

OSPF routers exchange Link State Advertisements (LSAs) describing their own links, then flood those LSAs to every router in the area, building a Link State Database (LSDB) identical on every router. Each router then runs a shortest-path-first calculation against that database to build its own loop-free route table – no router trusts another’s routes, only its raw, verifiable link-state facts.

Before that, routers must become neighbors: they send hello packets to multicast 224.0.0.5, moving the relationship through Down, Init, and 2-Way states. On broadcast segments, routers elect a Designated Router (DR) and Backup DR and become fully adjacent only with those two, cutting flooding from all-to-all to hub-and-spoke. Point-to-point links skip election and go straight to full adjacency.

Types of OSPF

Two versions cover today’s address families. OSPFv2 (RFC 2328) routes IPv4. OSPFv3 (RFC 5340) routes IPv6 and, in later implementations, IPv4 too – a separate instance from OSPFv2 for dual-stack networks.

Areas are OSPF’s scaling mechanism. Area 0, the backbone, is mandatory, and every other area must connect to it. Standard areas carry full inter-area and external route information. Stub areas block external routes and rely on a default route instead. NSSA areas are a middle ground: stub-like for inter-area traffic, but still able to import and transit a limited set of external routes.

Network type is a per-interface choice: broadcast elects a DR/BDR; point-to-point forms one full adjacency with no election – the recommended type for a two-router segment.

OSPF & Versa

VOS runs OSPFv2 and OSPFv3 as instances inside a virtual router, each with its own Router ID, areas (Standard, NSSA, or Stub), and per-area network type, priority, and authentication. Non-backbone areas without a direct backbone connection reach area 0 through virtual links. Separately, OSPFv2 area 0 supports a sham link – a logical intra-area link carried over the backbone network, so routes exchanged across the backbone are classified as intra-area and preferred over a backdoor path. Authentication is MD5, simple password, or key-chain lists, and BFD detects a session failure in milliseconds.

VOS recommends configuring a two-router segment as point-to-point to avoid needless DR/BDR election. Where OSPF and BGP both run in an SD-WAN overlay, VOS sets the OSPF Down bit and a domain VPN tag on redistributed routes so a PE router does not re-import routes it already originated. Internal OSPF routes carry a lower administrative distance than external ones (30 versus 110). See the SD-WAN design guide for the redistribution discussion, and Troubleshooting OSPF Neighbor Adjacency for diagnosing a stalled adjacency.

Frequently asked questions

What is the difference between OSPFv2 and OSPFv3?

OSPFv2 routes IPv4 and is defined in RFC 2328. OSPFv3 extends the same link-state and SPF design to route IPv6 – and, in current implementations, IPv4 too – as a separate protocol instance with its own LSDB, configured alongside or instead of OSPFv2.

What is an OSPF area, and why does OSPF use them?

An area is a set of routers and links sharing an identical link-state database. Areas bound how far a topology change floods, keeping the SPF calculation and database manageable in large networks. Every area must connect to the backbone, area 0.

What is the difference between a stub area and an NSSA?

A stub area blocks externally redistributed routes and relies on a default route instead, shrinking its link-state database. An NSSA behaves the same way for inter-area traffic but can still import a limited set of external routes and pass them toward the backbone.

Why does OSPF elect a designated router on broadcast networks?

On a multi-access segment, every router becoming fully adjacent with every other router would flood redundant link-state updates across the segment. Electing a DR and BDR lets the rest form full adjacency with just those two, cutting flooding to a hub-and-spoke pattern.

Why do OSPF neighbors get stuck instead of reaching the Full state?

Common causes include OSPF disabled or passive on an interface, a Layer 2 or multicast-reachability problem, mismatched area IDs, network types, subnet masks, hello/dead timers, authentication, or an MTU mismatch – each one stalls the adjacency at a specific, identifiable state.

More on OSPF

If you want to learn more, these are sources we trust.

RFC 2328: OSPF Version 2 RFC 5340: OSPF for IPv6
The original IETF standard for OSPFv2: the link-state algorithm, LSA types, and area structure that IPv4 OSPF still follows today. The IETF standard extending OSPF’s area and SPF design to route IPv6, with updated addressing and packet formats.

If you’re reading about OSPF, these are worth looking at next.

Border Gateway Protocol Multiprotocol Label Switching Virtual Router Redundancy Protocol
A path-vector protocol exchanging reachability between autonomous systems; Versa redistributes routes between it and OSPF at SD-WAN edges. A label-switching technology forwarding traffic through a provider core network; often the transport an OSPF-routed LAN sits behind. A protocol sharing a virtual IP across routers for LAN gateway redundancy, often on the same segment as OSPF.