skip to content

What is OSPFv3, and what changed from OSPFv2 when OSPF was redesigned to route IPv6?

level: juniorimportance: should knowfreq 26%

answer

  1. same link-state engine underneath
  2. addresses leave the packet headers
  3. per link, not per subnet
  4. two new LSAs carry prefixes
  5. authentication moves out of OSPF

basics

~20 s

OSPFv3 (RFC 5340) is OSPF for IPv6. It keeps OSPFv2's flooding, areas, neighbour states and SPF, but strips addresses from its headers and topology LSAs, runs per link, adds Link and Intra-Area-Prefix LSAs, and drops built-in authentication.

solid answer

~40 s

OSPFv3 is version 3 of OSPF, defined for IPv6 by RFC 5340, which obsoleted RFC 2740. The engine is OSPFv2's: the same five packet types, the same neighbour states and DR/BDR election, areas, reliable flooding and Dijkstra over a link-state database, still carried directly over IP as protocol `89`. What changed is where addresses live. The OSPF header shrinks from 24 to 16 bytes, losing `AuType` and `Authentication` and gaining an `Instance ID`; Hellos no longer carry a network mask; router-LSAs and network-LSAs describe only topology, while IPv6 prefixes move into the new **Intra-Area-Prefix-LSA** and the link-scoped **Link-LSA**. The protocol runs per link rather than per subnet, sends from link-local addresses, and leaves authentication to IPsec or an authentication trailer. Router ID, Area ID and Link State ID stay 32-bit numbers.

go deeper

for a junior

Recall that OSPFv3 is OSPF for IPv6, defined in RFC 5340, and that it keeps OSPFv2's areas, neighbours, flooding and SPF while moving addresses out of the headers.

for a middle

Be ready to list the concrete changes: per-link operation, link-local sources, no mask in Hellos, the 16-byte header with an Instance ID, and the Link and Intra-Area-Prefix LSAs.

for a senior

Explain why the changes follow from one decision, removing addressing semantics from packets and topology LSAs, and what that means for running OSPFv2 and OSPFv3 side by side.

for a principal

Weigh running separate OSPFv2 and OSPFv3 domains against one OSPFv3 carrying IPv4 as an address family, including tooling, failure blast radius and the 32-bit Router ID plan.

## What OSPFv3 is **OSPFv3** is the version of the Open Shortest Path First protocol that routes **IPv6**. It is specified in **RFC 5340** ("OSPF for IPv6", Standards Track), which obsoleted the first OSPFv3 document, RFC 2740. OSPFv2, the IPv4 protocol, is RFC 2328. The two are separate protocols: an OSPFv2 router checks for version number 2 and an OSPFv3 router for version number 3, so they never form an adjacency with each other, and a dual-stack network traditionally runs both side by side. RFC 5340 says it plainly: most of the OSPFv2 algorithms are preserved, and the changes are there either because IPv6's semantics differ from IPv4's or simply to handle the larger address. ## What stays the same - **Packet types**: Hello, Database Description, Link State Request, Link State Update and Link State Acknowledgment, numbered 1 to 5 exactly as in OSPFv2. - **Transport**: OSPFv3 runs directly over IPv6 with Next Header value `89`, the same protocol number OSPFv2 uses over IPv4. It is not carried over UDP or TCP. - **Neighbours and adjacencies**: the same neighbour state machine, Hello and dead intervals, and the Designated Router / Backup Designated Router election on multi-access links. - **Areas**: a backbone area 0, area border routers, stub and NSSA areas, virtual links. - **Flooding and the database**: LSAs with age, sequence number and checksum, flooded reliably with acknowledgements; the rules that decide which instance of an LSA is newer are unchanged. - **Route computation**: Dijkstra over a graph of routers and transit links, then intra-area, inter-area and external routes, with the same equal-cost multipath logic. - **Multicast destinations**: AllSPFRouters and AllDRouters, which in IPv6 are `ff02::5` and `ff02::6` (OSPFv2 uses `224.0.0.5` and `224.0.0.6`). ## What changed | Aspect | OSPFv2 (RFC 2328) | OSPFv3 (RFC 5340) | |---|---|---| | Unit of operation | the IPv4 subnet | the **link**; several prefixes may share one link | | Hello contents | carries a Network Mask that must match | no address information; carries an `Interface ID` | | Packet header | 24 bytes, with `AuType` and `Authentication` | 16 bytes, with an `Instance ID`; no authentication fields | | Neighbour identity | by IP address on broadcast, NBMA and point-to-multipoint links | always by **Router ID** | | Router- and network-LSAs | carry topology and addresses | carry **topology only** | | Where prefixes travel | inside router-LSAs and network-LSAs | **Intra-Area-Prefix-LSA** (area scope) and **Link-LSA** (link scope) | | Flooding scope | implied by the LSA type | coded explicitly in the LS type: link, area or AS | | Authentication | built in: null, simple password, cryptographic | removed; IPsec (RFC 4552) or an authentication trailer (RFC 7166) | | Inter-area LSA names | type 3 and type 4 summary-LSAs | Inter-Area-Prefix-LSA and Inter-Area-Router-LSA | Some identifiers did **not** grow. The Router ID, the Area ID and the Link State ID are still 32-bit numbers, and RFC 5340 says they can no longer be assigned as IPv6 addresses. An OSPFv3 Router ID is therefore a 32-bit identifier, usually written in dotted-decimal form; RFC 5340 reserves `0.0.0.0` and says it should not be used. ## Why a redesign rather than wider fields Simply widening OSPFv2's address fields to 128 bits would have kept IPv4's assumptions alive. IPv6 lets one link carry several prefixes, and lets two nodes on a link talk without sharing any prefix, so a protocol that keys everything on "the subnet" fits badly. RFC 5340 instead removed addressing semantics from the packets and from the main LSAs, leaving what it calls a *network-protocol-independent core*. Addresses now appear only in LSA payloads. That one decision explains most of the table above: the Hello loses its mask, neighbours are named by Router ID, router-LSAs describe only the graph, and prefixes need LSAs of their own. It also explains two later extensions. Because the topology LSAs carry no addresses, RFC 5838 could teach OSPFv3 to carry other address families, including IPv4, without new LSA types. And because authentication moved out of the protocol, OSPFv3 leaned on IPv6's IPsec until RFC 7166 added a native trailer. ## Mistakes that show up in interviews 1. Describing OSPFv3 as "OSPFv2 with 128-bit fields". The Router ID is still 32 bits, and the real change is that addresses left the headers and the topology LSAs. 2. Saying OSPFv3 dropped areas or the DR election. Both are unchanged. 3. Assuming an IPv6 routing protocol must ride on UDP. OSPFv3 is IPv6 Next Header 89, just as OSPFv2 is IPv4 protocol 89. 4. Looking for a password field in the OSPFv3 header. There is none.

  • If an OSPFv3 Router ID is still a 32-bit number, where does a router with no IPv4 address get one?
    From configuration. RFC 5340 keeps the Router ID at 32 bits and says it can no longer be assigned as an IPv6 address, so an IPv6-only router has nothing to borrow it from. Borrowing an IPv4 interface address when one exists is an implementation's convenience, not a protocol rule. RFC 2328 requires the Router ID to be unique within the autonomous system, and RFC 5340 reserves `0.0.0.0`.
  • Can an OSPFv2 router and an OSPFv3 router on the same Ethernet segment become neighbours?
    No. Each checks the version number in the OSPF header, 2 or 3, and discards the other's packets; OSPFv2 also travels in IPv4 and OSPFv3 in IPv6. They keep separate databases and separate SPF runs. A dual-stack network either runs both protocols or, under RFC 5838, carries IPv4 in a separate OSPFv3 address-family instance.

saying these in an interview costs you the question

  • OSPFv3 is just OSPFv2 with every address field widened to 128 bits.
  • An OSPFv3 Router ID is one of the router's IPv6 addresses.
  • OSPFv3 dropped areas and the DR election because IPv6 does not need them.
  • OSPFv3 runs over UDP because it is carried inside IPv6.
  • The OSPFv3 header still has a password field, as in OSPFv2.