A YANG Data Model for MPLS Base
Extracted elements (22)
A separate native MPLS RIB instance is created (beyond IPv4/IPv6 RIBs) to store routes that are enabled for MPLS forwarding but not associated with any AF-specific RIB, such as RSVP-programmed transit LSP routes, Layer 2 cross-connects, and SR Adjacency Segments. This is achieved by extending the 'address-family' identity with a new 'mpls' identity.
The 'backup-index' leaf in 'nhlfe-multiple-contents' allows referencing an alternate next-hop entry for Fast Reroute protection, referencing RFC 4090 (RSVP-TE FRR) and RFC 5714 (IP FRR Framework). This design cleanly separates primary and backup path configuration within the same NHLFE list structure.
The MPLS base YANG model augments the generic RIB model from RFC 8349 rather than defining a standalone model. This allows IP prefix routes (IPv4/IPv6) to carry additional MPLS forwarding data without duplicating the routing infrastructure, and enables other MPLS YANG modules (LDP, RSVP-TE, static) to augment the base module incrementally.
The 'ietf-mpls' YANG module is designed as an augmentation target for other MPLS YANG modules such as MPLS static LSP, LDP, and RSVP-TE. It imports 'ietf-routing' (RFC 8349), 'ietf-routing-types' (RFC 8294), 'ietf-yang-types' (RFC 6991), and 'ietf-interfaces' (RFC 8343).
The YANG module fully conforms to the Network Management Datastore Architecture (NMDA) as defined in RFC 8342, ensuring compatibility with NETCONF and RESTCONF implementations that support NMDA.
The 'inuse-labels-count' operational state leaf is only applicable when the 'block-allocation-mode' is derived from 'label-block-alloc-mode-manager', enforced by a YANG 'when' expression. It is config false (read-only).
The 'mpls-local-label' leaf under a route is only present when the 'mpls-enabled' leaf on that route is set to 'true', enforced by a YANG 'when' condition. NHLFE label stack augmentations on next-hops are also conditioned on the parent route's mpls-enabled being true.
The 'rib-mpls-properties' grouping (including destination-prefix and route-context) is only valid for routes in the native MPLS RIB, enforced by a 'when' condition checking that the address-family is derived from 'mpls:mpls'. Similarly, the active-route RPC input augmentation applies only to the native MPLS RIB.
The 'start-label' leaf must be less than or equal to 'end-label', enforced by a YANG must constraint with error-message. Conversely, 'end-label' must be greater than or equal to 'start-label'. This ensures label block ranges are valid.
The 'globals' grouping contains a single 'ttl-propagate' boolean leaf (default true) that controls whether IP TTL is propagated into/from the MPLS label stack when imposing or popping labels.
The 'ietf-mpls' YANG module defines the 'mpls' identity extending 'rt:address-family' to represent the native MPLS RIB instance, and the 'label-block-alloc-mode' base identity with two derived identities: 'label-block-alloc-mode-manager' (label manager controls allocation) and 'label-block-alloc-mode-application' (application controls allocation).
The 'interfaces-mpls' grouping defines a list of MPLS-enabled interfaces keyed by 'name' (an interface-ref). Each entry includes 'mpls-enabled' (boolean, default false) and 'maximum-labeled-packet' (uint32, in octets) referencing RFC 3032 Section 3.2.
The 'label-blocks' grouping defines a list of MPLS label blocks, each with 'index' (string key), 'start-label', 'end-label' (both rt-types:mpls-label with must constraints enforcing start <= end), 'block-allocation-mode' (identityref), and read-only 'inuse-labels-count' (gauge32, only present when allocation mode is manager-controlled).
The 'loadshare' leaf in 'nhlfe-multiple-contents' is a uint16 (default 1) used to compute unequal load balancing ratios across multiple outgoing next hops. A share is the ratio of this value to the total across all next hops, per RFC 3031 Sections 3.11 and 3.12.
The module augments '/rt:routing/rt:ribs/rt:rib/rt:routes/rt:route' with 'mpls-enabled' (boolean, default false) and 'mpls-local-label' (present only when mpls-enabled is true). For native MPLS RIB routes, 'destination-prefix' (leafref to mpls-local-label) and 'route-context' (string) are also added.
The 'mpls-operations-type' enumeration defines five MPLS forwarding operation types: impose-and-forward, pop-and-forward, pop-impose-and-forward, swap-and-forward, and pop-and-lookup. These represent the full set of label stack operations an LSR may perform.
The 'nhlfe-role' enumeration defines three roles for a Next Hop Label Forwarding Entry: 'primary' (carries traffic), 'backup' (standby), and 'primary-and-backup' (simultaneously serves both roles). This supports Fast Reroute and IP FRR scenarios as referenced in RFC 4090 and RFC 5714.
The 'nhlfe-single-contents' grouping describes a single NHLFE using the 'rt-types:mpls-label-stack' grouping. The 'nhlfe-multiple-contents' grouping extends this with 'index', 'backup-index', 'loadshare' (uint16, default 1), and 'role' leaves to support multipath and protection scenarios.
This document registers URI 'urn:ietf:params:xml:ns:yang:ietf-mpls' in the 'ns' subregistry of the 'IETF XML Registry' (RFC 3688), and registers the YANG module 'ietf-mpls' (prefix: mpls) in the 'YANG Module Names' registry (RFC 6020).
Read access to next-hop information paths (augmented with MPLS labels) and RPC active-route paths must be controlled, as disclosure of per-prefix next-hop and label information could facilitate further network attacks. NETCONF requires SSH (RFC 6242) and RESTCONF requires TLS 1.3 (RFC 8446) as mandatory secure transports.
Writable data nodes under '/rt:routing/mpls:mpls/mpls:label-blocks' (such as start-label and end-label) are sensitive: unauthorized write operations can disrupt existing MPLS traffic. Access MUST be protected via NACM (RFC 8341) over NETCONF/SSH or RESTCONF/TLS.
The MPLS label stack in next-hop entries is encoded as a list of entries, each with 'id' (uint8 key), 'label' (rt-types:mpls-label), 'ttl' (uint8), and 'traffic-class' (uint8). This structure appears in both simple-next-hop and next-hop-list augmentations and mirrors the MPLS label stack encoding from RFC 3032.