Skip to main content

2. Design of the YANG Module for OSPF MPLS Segment Routing

The OSPF MPLS Segment Routing YANG module is an augmentation of the OSPF YANG model [RFC9129].

Module Structure Overview

This YANG module defines the data model for configuring and managing OSPF Segment Routing extensions, including:

Core Configuration Elements

Segment Routing Global Block (SRGB):

  • Global configuration for OSPFv2/OSPFv3 instances
  • Defines the global Segment Identifier (SID) range
  • Includes starting label value and range size
  • Example: SRGB [16000-23999] represents 8000 available global SIDs

Segment Routing Local Block (SRLB):

  • Defines the local Segment Identifier range
  • Used for node-specific local SID allocation
  • Not propagated within the AS

Maximum SID Depth (MSD):

  • Indicates the maximum SID stack depth a node can process
  • Advertised to other nodes via OSPF LSAs
  • Used for path computation and traffic engineering

Segment Routing Algorithm Support

The module supports configuration of:

  • Prefix Segment Identifier (Prefix-SID): SID associated with a prefix
  • Adjacency Segment Identifier (Adjacency-SID): SID associated with a link
  • Algorithm Types: Shortest Path First (SPF), Strict SPF, etc.

OSPFv2 and OSPFv3 Support

The module supports both:

  • OSPFv2 [RFC2328] [RFC8665]: IPv4 networks
  • OSPFv3 [RFC5340] [RFC8666]: IPv6 networks

Both protocol versions share the same Segment Routing configuration model structure.

Configuration Hierarchy

routing-instance
└── routing-protocol (OSPF)
└── ospf
├── segment-routing
│ ├── enabled (true/false)
│ ├── srgb
│ │ ├── lower-bound
│ │ └── upper-bound
│ ├── srlb
│ │ ├── lower-bound
│ │ └── upper-bound
│ └── msd
└── areas
└── area
└── interfaces
└── interface
└── segment-routing
└── adjacency-sid

State Data

The module also provides operational state data, including:

  • Currently active SRGB/SRLB ranges
  • Allocated Prefix SIDs
  • Adjacency SID states
  • MSD capabilities

Integration with OSPF Base Model

This module extends the OSPF base YANG model [RFC9129] through "augment" statements:

  • Adds Segment Routing-specific configuration nodes
  • Extends interface configuration to support Adjacency SIDs
  • Adds Segment Routing-related LSA state information

Compatibility Considerations

The module design ensures:

  • Backward compatibility with OSPF implementations that do not support Segment Routing
  • Segment Routing functionality is optionally configurable
  • Coexistence with traditional OSPF traffic engineering