rfc-9129

YANG Data Model for the OSPF Protocol

D. Yeung, Y. Qu, Z. Zhang, I. Chen, A. Lindem
date2022-10 streamIETF areartg wglsr statusPROPOSED STANDARD pages116 canonicalhttps://www.rfc-editor.org/rfc/rfc9129 doi10.17487/RFC9129 errataview
This document defines a YANG data model that can be used to configure and manage OSPF. The model is based on YANG 1.1 as defined in RFC 7950 and conforms to the Network Management Datastore Architecture (NMDA) as described in RFC 8342.

Extracted elements (27)

design-rationale §2.3

A single 'ietf-ospf' YANG module serves both OSPFv2 and OSPFv3. The mandatory 'version' field selects the protocol version, and the data model varies accordingly to accommodate differences between the two versions, avoiding separate modules.

yang, routing

design-rationale §2.2

Multiple OSPF instances are represented as multiple control-plane protocol instances under '/routing/control-plane-protocols', reusing the ietf-routing framework (RFC 8349) rather than defining a separate multiplexing mechanism inside the OSPF module.

yang, routing

design-rationale §2.1

OSPF operational state is included in the same YANG tree as OSPF configuration, consistent with the Network Management Datastore Architecture (NMDA, RFC 8342). Consequently, only the 'routing' container in the 'ietf-routing' model is augmented; the deprecated 'routing-state' container is not augmented.

yang, netconf, routing

design-rationale §2

Very little information in the data model is designated as 'mandatory', providing freedom for vendors to adapt the model to their respective product implementations while still offering a common user interface for both OSPFv2 and OSPFv3.

yang, routing

interoperability-note §2.3

The ietf-ospf YANG module provides a unified data model interface common to both OSPFv2 and OSPFv3. Vendor-specific extensions and additional protocol features are expected to be added through augmentation of this base model, as noted in the module description.

yang, routing

normative-requirement §2.3 REQUIRED

The 'version' field indicating the OSPF protocol version (ospfv2 or ospfv3) is mandatory in the data model. Based on the configured version, the data model varies to accommodate the differences between OSPFv2 and OSPFv3.

yang, routing

protocol-element §2.6

Area type is expressed via identityref with base 'area-type': normal-area, stub-area (derived from stub-nssa-area), and nssa-area (derived from stub-nssa-area, per RFC 3101). The 'summary' leaf controls inter-area summary LSA generation and 'default-cost' sets the default metric for stub/NSSA areas.

yang, routing

protocol-element §2.6

Authentication is modeled as a choice within interfaces, virtual links, and sham links: OSPFv2 options include an authentication trailer (RFC 5709 or RFC 7474) with either a key-chain reference or explicit key-id/key/algorithm; OSPFv3 options include IPsec SA reference (RFC 4552) or an authentication trailer (RFC 7166) with key-chain or explicit SA-id/key/algorithm.

yang, routing, security, crypto

protocol-element §3

OSPFv2 LSA option bits are modeled as identities under 'ospfv2-lsa-option': MT-bit (multi-topology), DC-bit (demand circuits), P-bit (NSSA type-7 translation), MC-bit (MOSPF), E-bit (AS-External flooding), O-bit (opaque capable per RFC 5250), and DN-bit (L3VPN loop prevention per RFC 4576).

yang, routing

protocol-element §3

OSPFv3 LSA option bits are modeled as identities under 'ospfv3-lsa-option': AF-bit (address families per RFC 5838), DC-bit (demand circuits), R-bit (active router), N-bit (NSSA attachment), E-bit (AS-External flooding), and V6-bit (IPv6 routing inclusion).

yang, routing

protocol-element §3

Router capability advertisement is modeled via the 'router-capabilities-tlv' grouping, exposing informational-capabilities (identityrefs from the 'informational-capability' base: graceful-restart, graceful-restart-helper, stub-router, traffic-engineering, p2p-over-lan, experimental-te), plus raw 32-bit informational and functional capability flag lists for unknown capabilities per RFC 7770.

yang, routing

protocol-element §2.6

The 'area' container provides per-area configuration (area-id, area-type, summary, default-cost, ranges, topologies, virtual-links, sham-links) and operational state (statistics including SPF-run count, ABR/ASBR counts, NSSA translator event count, and the area-scope LSDB).

yang, routing

protocol-element §2.5

The graceful restart feature models restart configuration (enabled, helper-enabled, restart-interval, helper-strict-lsa-checking) and exposes restart status via the restart-status-type enumeration (not-restarting, planned-restart, unplanned-restart) and exit reason (none, in-progress, completed, timed-out, topology-changed), covering RFC 3623 (OSPFv2) and RFC 5187 (OSPFv3).

yang, routing

protocol-element §2.2

The 'ietf-ospf' module augments '/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol' from the ietf-routing module. The top-level 'ospf' container holds one OSPF instance, with sub-containers for areas, interfaces, topologies, LSDB, RIB, SPF log, and LSA log.

yang, routing

protocol-element §2.5

The IETF SPF delay algorithm state is modeled under 'spf-control/ietf-spf-delay' with configurable parameters (initial-delay, short-delay, long-delay, hold-down, time-to-learn) and read-only operational state (current-state, remaining-time-to-learn, remaining-hold-down, last-event-received, next-spf-time, last-spf-time), conforming to RFC 8405.

yang, routing

protocol-element §2.7

The 'interface' container covers per-interface configuration (interface-type, passive, demand-circuit, priority, multi-areas, static-neighbors, BFD, fast-reroute, hello/dead/retransmit/transmit-delay intervals, LLS, TTL security, authentication, cost, mtu-ignore, prefix-suppression, instance-id, topologies) and operational state (state, DR/BDR identity, statistics, neighbor list, link-local LSDB).

yang, routing

protocol-element §2.5

The local RIB operational state under the OSPF instance exposes OSPF-computed routes with prefix (inet:ip-prefix), next-hop list (outgoing-interface and next-hop address), metric, route-type (intra-area, inter-area, external-1, external-2, nssa-1, nssa-2), and route-tag.

yang, routing

protocol-element §3

The module defines a full LSA type identity hierarchy for OSPFv2 (Router-LSA type 1, Network-LSA type 2, summary types 3–4, AS-External type 5, NSSA type 7, Opaque types 9–11) and OSPFv3 (Router 0x2001, Network 0x2002, Inter-Area-Prefix 0x2003, Inter-Area-Router 0x2004, AS-External 0x4005, NSSA 0x2007, Link 0x0008, Intra-Area-Prefix 0x2009, Router-Information 0x800C/0xA00C/0xC00C).

yang, routing

protocol-element §2.4

The module defines an extensive set of optional YANG features covering: multi-topology, multi-area-adj, explicit-router-id, demand-circuit, mtu-ignore, lls, prefix-suppression, ttl-security, nsr, graceful-restart, auto-cost, max-ecmp, max-lsa, te-rid, ldp-igp-sync, ospfv2-authentication-trailer, ospfv3-authentication-ipsec, ospfv3-authentication-trailer, fast-reroute, node-flag, node-tag, lfa, remote-lfa, stub-router, pe-ce-protocol, ietf-spf-delay, bfd, and hybrid-interface.

yang, routing

protocol-element §2.8

The module defines nine YANG notifications covering common OSPF MIB traps: if-state-change, if-config-error, nbr-state-change, nbr-restart-helper-status-change, if-rx-bad-packet, lsdb-approaching-overflow, lsdb-overflow, nssa-translator-status-change, and restart-status-change. Each notification identifies the affected interface type (regular, virtual-link, or sham-link).

yang, routing

protocol-element §2.5

The router-level 'ospf' container includes configuration (address-family, enabled, explicit-router-id, preference, nsr, graceful-restart, auto-cost, spf-control, database-control, stub-router, mpls/te-rid, fast-reroute, node-tags) and read-only operational state (router-id, local-rib, statistics, AS-scope LSDB, spf-log, lsa-log).

yang, routing

protocol-element §2.9

Two RPC operations are defined: 'clear-database' resets the contents of an OSPF LSDB, forces neighbor adjacencies to DOWN, and reoriginates self-originated LSAs; 'clear-neighbor' resets a specific OSPF neighbor or all neighbors on an interface.

yang, routing, netconf

registry §5

IANA registered the 'ietf-ospf' YANG module in the 'YANG Module Names' registry with namespace 'urn:ietf:params:xml:ns:yang:ietf-ospf', prefix 'ospf', and reference RFC 9129.

yang, registry, routing

security-consideration §4

The ietf-ospf YANG module defines writable configuration nodes that, if modified by an unauthorized party, could disrupt OSPF routing. Implementations must enforce NETCONF/RESTCONF access control (e.g., NACM per RFC 8341) to restrict write access to OSPF configuration to authorized administrators only.

yang, security, routing, netconf

state-machine §3

The OSPF interface state machine is modeled via the 'if-state-type' enumeration with states: down (1), loopback (2), waiting (3), point-to-point (4), dr (5), bdr (6), dr-other (7). State transitions are triggered by link events and DR election results, per RFC 2328.

yang, routing

state-machine §3

The OSPF neighbor state machine is modeled via the 'nbr-state-type' enumeration with states: down (1), attempt (2), init (3), 2-way (4), exstart (5), exchange (6), loading (7), full (8). Transitions are driven by Hello receipt, Database Description exchange, and LSA flooding completion per RFC 2328.

yang, routing

wire-format §3

A reusable TLV grouping defines type (uint16), length (uint16, in octets), and value (yang:hex-string) fields. An 'unknown-tlvs' container using this grouping captures unrecognized TLVs and sub-TLVs in LSA bodies.

yang, routing