Why does OSPFv3 run per link instead of per IPv6 subnet, and why do its Hellos come from link-local addresses?
answer
- what IPv6 means by a link
- several prefixes, one wire
- no mask left to compare
- every interface has an fe80 address
- virtual links are the exception
basics
~20 sIPv6 can put several prefixes on one link, and neighbours need not share any. OSPFv3 therefore forms adjacencies per link, drops the Hello's mask, and sends from each interface's link-local address, which other routers then use as the next hop.
solid answer
~40 sIn IPv6 a *link* is the layer-2 medium, and it can carry several prefixes; two nodes can talk over it without sharing any. OSPFv2 is tied to the IPv4 subnet: its Hello carries a `Network Mask` that must match, and a packet's source must fall inside the receiving interface's subnet except on point-to-point links. RFC 5340 runs OSPF per link instead. Hellos carry no mask, the source need not be in a shared subnet, and neighbours are identified by Router ID on every link type. Packets are sent from the interface's **link-local** address, which every IPv6 interface has and which routers never forward; the address learned that way, or from the neighbour's Link-LSA, becomes the next hop. The one exception is a virtual link, which crosses an area and must use a global address.
go deeper
Remember that OSPFv3 works per link, not per subnet, and that routers speak OSPFv3 from their fe80 link-local addresses.
Explain which OSPFv2 checks disappear (the Hello mask, the same-subnet source check), what replaces them (Area ID, Instance ID, Router ID), and how the link-local source becomes the next hop.
Show the operational payoff: adjacencies survive renumbering, links can run OSPF without global prefixes, and know the virtual-link exception that needs a global address.
Discuss addressing plans built on this: links with no global prefix at all, how operators then reach and troubleshoot router interfaces, and what monitoring loses.
## What IPv6 means by a link RFC 5340 starts from IPv6's own vocabulary. A **link** is "a communication facility or medium over which nodes can communicate at the link layer": an Ethernet segment, a point-to-point circuit. **Interfaces** attach to links. In IPv6 several **subnets** (prefixes) can be assigned to one link, and two nodes on the same link can exchange packets even when they share no prefix at all. A segment might carry `2001:db8:a::/64` and `2001:db8:b::/64` at once, during a renumbering or by design. OSPFv2 was built around a different unit, the IPv4 subnet, and that assumption is visible in its checks. ## How OSPFv2 is tied to the subnet - **Hello Network Mask**: RFC 2328 requires the `Network Mask` in a received Hello to match the receiving interface's mask, except on point-to-point links and virtual links. A mismatch drops the Hello. - **Source address check**: a packet received on a non-virtual interface must come from an address on the same network as that interface, verified by masking both addresses. Point-to-point links are exempt. - **Neighbour identity**: on broadcast, NBMA and point-to-multipoint links an OSPFv2 neighbour is identified by its IPv4 interface address, and the DR and BDR are named by address in Hellos. All three assume that "the routers on this wire" and "the hosts in this subnet" are the same set. ## What OSPFv3 does instead RFC 5340 replaces "subnet" with "link" throughout and changes the packets to match: 1. The Hello carries **no address information**, and no network mask. Instead it carries an `Interface ID`, a number the router assigns to identify its own interface on the link. 2. The receive checks compare the **Area ID** and **Instance ID** with the receiving interface; the IPv6 source address is explicitly not required to lie in the same subnet. 3. Neighbours are identified by **Router ID** on every link type, and Hellos name the DR and BDR by Router ID. 4. An **Instance ID** in the header lets several OSPF instances share one link; a packet whose Instance ID does not match the interface's is discarded. OSPFv2 had achieved this only in what RFC 5340 calls a haphazard way, through its authentication fields. | Check on a received packet | OSPFv2 (RFC 2328) | OSPFv3 (RFC 5340) | |---|---|---| | Hello mask | must match, except point-to-point and virtual links | no mask in the Hello | | Source address | must be in the receiving interface's subnet, except point-to-point | not restricted to a shared subnet | | Neighbour key | IP address on broadcast, NBMA and point-to-multipoint | Router ID on every link type | | Separating instances | no header field for it | `Instance ID` must match | ## Why link-local addresses RFC 5340 assumes every router has a link-local unicast address (from `fe80::/10`) on each attached link, and on every OSPF interface except virtual links it sends OSPF packets from that address. Several properties make it the right choice: - **It always exists.** An IPv6 interface has a link-local address whether or not any global prefix is configured, so OSPF can run on a link that carries no global prefix of its own. - **It is independent of the link's prefixes.** Adding, removing or renumbering a global prefix changes what OSPF advertises, not which address the neighbours talk to. - **It stays on the link.** IPv6 routers do not forward packets with link-local source addresses, which suits a protocol whose packets mostly travel one hop. - **It is the next hop.** A router learns its neighbours' link-local addresses and uses them as next-hop addresses when forwarding. The address comes from the neighbour's Link-LSA, or on many link types simply from the source of its Hellos. Link-local addresses are allowed in the Link-LSA only; RFC 5340 forbids them in the LSAs that are flooded further, such as Intra-Area-Prefix-LSAs and AS-External-LSAs. ## The exception: virtual links A **virtual link** joins a disconnected area border router to the backbone across a transit area, so its packets cross several routers. A link-local source cannot be forwarded, so RFC 5340 requires a **global** IPv6 address as the source on virtual links. Each end learns the other's global address from the far router's Intra-Area-Prefix-LSA, where it is flagged with the `LA-bit`. ## Mistakes that show up in interviews - Expecting OSPFv3 neighbours to need a common global prefix. They need a common link and matching OSPF parameters. - Saying the Hello's mask was widened to a prefix length. It was removed. - Saying OSPFv3 never uses global addresses for its own packets. Virtual links must. - Saying neighbours are tracked by IPv6 address. They are tracked by Router ID; the source address is stored as the neighbour's address for next-hop use.
- Two OSPFv3 routers on one Ethernet segment have global addresses in different /64s. Can they become neighbours?Yes. RFC 5340 checks the Area ID and Instance ID against the receiving interface and explicitly does not require the source to be in the same subnet, and the Hello has no mask to compare. Provided the parameters a Hello must agree on also match, the adjacency forms over their link-local addresses. The equivalent OSPFv2 pair on a broadcast link would fail the subnet check.
- Why must an OSPFv3 virtual link use a global source address?A virtual link carries OSPF packets across a transit area, through several routers. IPv6 routers do not forward packets with link-local source addresses, so a link-local source would never arrive. RFC 5340 therefore requires a global-scope source on virtual links, and each end finds the other's global address in its Intra-Area-Prefix-LSA, marked with the LA-bit.
saying these in an interview costs you the question
- OSPFv3 neighbours must share a global IPv6 prefix, as OSPFv2 neighbours share a subnet.
- OSPFv3 Hellos are sourced from the interface's global unicast address.
- The OSPFv3 Hello carries the link's prefix length in place of OSPFv2's mask.
- OSPFv3 identifies neighbours on a broadcast link by their IPv6 addresses.
- OSPFv3 virtual links use link-local addresses like every other OSPFv3 interface.