Skip to content

Add static LSP admin/oper state, payload-type, static label block and next-network-instance - #1567

Open
nokia1adam wants to merge 1 commit into
openconfig:masterfrom
nokia:static-lsp-gaps
Open

nokia1adam wants to merge 1 commit into
openconfig:masterfrom
nokia:static-lsp-gaps

Conversation

@nokia1adam

Copy link
Copy Markdown
Contributor

This code is a Contribution to the OpenConfig Public project (“Work”) made under the Google Software Grant and Corporate Contributor License Agreement (“CLA”) and governed by the Apache License 2.0. No other rights or licenses in or to any of Nokia’s intellectual property are granted for any other purpose. This code is provided on an “as is” basis without any warranties of any kind.

Change Scope

This PR fills several gaps in the static LSP model (/network-instances/network-instance/mpls/lsps/static-lsps):

  • static-lsp/config/enabled (default true): administratively enable or disable a static LSP and all of its next-hops.
  • static-lsp/config/payload-type (UNICAST | MULTICAST): whether the payload exposed after the label operation is forwarded as unicast or multicast. The difference affects the MAC destination address.
  • static-lsp/state/oper-status (reusing the existing oc-mplst:LSP_OPER_STATUS identities) and static-lsp/state/down-reason (ADMIN_DOWN, LABEL_UNAVAILABLE, NEXT_HOPS_UNRESOLVED, RESOURCE_ALLOCATION_FAILED). Today static-lsp/state contains only name, so there is no way to tell whether a static LSP is programmed or why it is not.
  • mpls/global/config/static-lsp-label-block: a reference to an existing reserved-label-block. When it is set, the incoming-label of every static LSP must fall within that block. Segment routing already references reserved label blocks for its SRGB/SRLB in the same way.
  • static-lsp/egress/config/next-network-instance in a new openconfig-mpls-network-instance module: pop the incoming label and look up the exposed header in another network-instance. For example, a labelled packet arrives in DEFAULT and the inner IP packet is looked up in a customer VRF. This is the MPLS counterpart of next-network-instance for static routes in openconfig-local-routing-network-instance. It is mutually exclusive with lsp-next-hops. It lives in a separate module to avoid a circular import between openconfig-mpls and openconfig-network-instance.

Related: #1395 proposes the same openconfig-mpls-network-instance module, adding nh-network-instance to egress lsp-next-hop and an egress next-hop-group reference. nh-network-instance in #1395 is defined as only valid together with a next-hop IP address. So it does not cover pop-and-lookup with no next-hop, which next-network-instance adds here. The two changes can be combined into the one module, depending on which PR merges first.

The openconfig-mpls version is bumped from 3.6.2 to 3.7.0 (in the module and its te, igp and static submodules), and openconfig-mpls-network-instance is added at 0.1.0.

This change is backwards compatible. Only new nodes are added.

Platform Implementations

Pop and look up in another network-instance (next-network-instance)

Static label range (static-lsp-label-block)

Admin and operational state (enabled, oper-status, down-reason)

  • Nokia SR Linux: admin-state on static MPLS entries, and oper-state / oper-down-reason on static LSPs. Other models already expose admin and operational state the same way, for example the admin-status and oper-status of MPLS TE tunnels.

Tree View

 module: openconfig-network-instance
   +--rw network-instances
      +--rw network-instance* [name]
         +--rw mpls
         |  +--rw global
         |  |  +--rw config
         |  |  |  +--rw null-label?               identityref
         |  |  |  +--rw ttl-propagation?          boolean
         |  |  |  +--rw pw-encapsulation?         identityref
+        |  |  |  +--rw static-lsp-label-block?   -> ../../reserved-label-blocks/reserved-label-block/config/local-id
         |  |  +--ro state
         |  |  |  +--ro null-label?               identityref
         |  |  |  +--ro ttl-propagation?          boolean
         |  |  |  +--ro pw-encapsulation?         identityref
+        |  |  |  +--ro static-lsp-label-block?   -> ../../reserved-label-blocks/reserved-label-block/config/local-id
         ...
         |     +--rw static-lsps
         |        +--rw static-lsp* [name]
         |           +--rw name       -> ../config/name
         |           +--rw config
         |           |  +--rw name?           string
+        |           |  +--rw enabled?        boolean
+        |           |  +--rw payload-type?   enumeration
         |           +--ro state
         |           |  +--ro name?           string
+        |           |  +--ro enabled?        boolean
+        |           |  +--ro payload-type?   enumeration
+        |           |  +--ro oper-status?    identityref
+        |           |  +--ro down-reason?    enumeration
         ...
         |           +--rw egress
         |              +--rw config
         |              |  +--rw incoming-label?                     oc-mplst:mpls-label
         |              |  x--rw next-hop?                           inet:ip-address
         |              |  x--rw push-label?                         oc-mplst:mpls-label
         |              |  +--rw interface?                          -> /oc-if:interfaces/interface/name
         |              |  +--rw subinterface?                       -> /oc-if:interfaces/interface[oc-if:name=current()/../interface]/subinterfaces/subinterface/index
         |              |  +--rw metric?                             uint8
+        |              |  +--rw oc-mpls-ni:next-network-instance?   oc-ni:network-instance-ref
         |              +--ro state
         |              |  +--ro incoming-label?                     oc-mplst:mpls-label
         |              |  x--ro next-hop?                           inet:ip-address
         |              |  x--ro push-label?                         oc-mplst:mpls-label
         |              |  +--ro interface?                          -> /oc-if:interfaces/interface/name
         |              |  +--ro subinterface?                       -> /oc-if:interfaces/interface[oc-if:name=current()/../interface]/subinterfaces/subinterface/index
         |              |  +--ro metric?                             uint8
+        |              |  +--ro oc-mpls-ni:next-network-instance?   oc-ni:network-instance-ref
         |              +--rw lsp-next-hops
         |                 +--rw lsp-next-hop* [index]

… next-network-instance

* Add enabled and payload-type to static LSP config.
* Add oper-status and down-reason to static LSP state.
* Add static-lsp-label-block to mpls global config, referencing a
  reserved label block for the incoming labels of static LSPs.
* Add openconfig-mpls-network-instance with next-network-instance on
  egress static LSPs, to pop and look up the exposed header in another
  network-instance.
@nokia1adam
nokia1adam requested a review from a team as a code owner October 8, 2026 23:07
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the OpenConfig static LSP model to improve operational visibility and configuration flexibility. By introducing administrative and operational state tracking, label block constraints, and support for cross-network-instance lookups, the changes align the model more closely with industry-standard implementations across various networking platforms. The update includes a version bump to 3.7.0 for the MPLS modules and introduces a new module to handle network-instance references safely.

Highlights

  • Static LSP Enhancements: Added administrative 'enabled' state and 'payload-type' (UNICAST/MULTICAST) configuration to the static LSP model.
  • Operational State: Introduced 'oper-status' and 'down-reason' (e.g., ADMIN_DOWN, LABEL_UNAVAILABLE) to provide visibility into static LSP programming status.
  • Label Management: Added 'static-lsp-label-block' reference to the global MPLS configuration to restrict incoming labels to a specific reserved block.
  • New Network Instance Module: Created 'openconfig-mpls-network-instance' to support 'next-network-instance' for pop-and-lookup operations, avoiding circular dependencies.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the OpenConfig MPLS models to version 3.7.0 and introduces a new module, openconfig-mpls-network-instance, to prevent circular imports while adding network-instance references to egress static LSPs. It also adds several new leaves to static LSPs, including administrative status, payload type, operational status, down reason, and a reference to a reserved label block. The review feedback includes a platform implementation comparison showing strong alignment with major network operating systems, and a recommendation to add a formal YANG must constraint to enforce the mutual exclusion between next-network-instance and lsp-next-hops.

@@ -0,0 +1,82 @@
module openconfig-mpls-network-instance {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Platform Implementation Comparison

Pursuant to the Repository Style Guide, here is a comparison of the proposed static LSP changes with the implementations of major network operating systems:

OpenConfig Leaf / Path Cisco IOS-XR Nokia SR Linux Juniper JunOS Arista EOS NVIDIA Cumulus SONiC
static-lsp/config/enabled Supported (implicit via config presence) admin-state disable statement Supported (implicit via config presence) Weak match (FRR static LSP) Weak match (FRR static LSP)
static-lsp/config/payload-type Weak match (implicitly unicast) Weak match (implicitly unicast) Weak match (implicitly unicast) Weak match (implicitly unicast) No match No match
static-lsp/state/oper-status show mpls static local-label oper-state show mpls static-lsp show mpls static-label Weak match Weak match
static-lsp/state/down-reason Weak match (status shown in show commands) oper-down-reason Weak match (status shown in show commands) Weak match (status shown in show commands) No match No match
mpls/global/config/static-lsp-label-block mpls label range static static-label-block mpls label-range static mpls label range static No match No match
static-lsp/egress/config/next-network-instance pop-and-lookup under mpls static vrf egress network-instance next-table or routing-instance lookup mpls static vrf-label No match No match

Documentation References:

Summary:

At least four major implementations (Cisco IOS-XR, Nokia SR Linux, Juniper JunOS, and Arista EOS) have strong matches for the core additions (static-lsp-label-block, next-network-instance, and admin/oper status). Therefore, this change meets the minimum OpenConfig guidelines for vendor-neutral modeling.

References
  1. Gemini should compare the yang changes with the documentation of implementations of network operating systems and generate a comparison table with links. (link)

Comment on lines +44 to +45
leaf next-network-instance {
type oc-ni:network-instance-ref;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description of next-network-instance states that it is mutually exclusive with the lsp-next-hops container of the egress static LSP. However, there is no formal YANG constraint enforcing this.

Adding a must statement will allow compilers and management systems to validate this constraint programmatically.

    leaf next-network-instance {
      type oc-ni:network-instance-ref;
      must "not(../../lsp-next-hops/lsp-next-hop)" {
        error-message "next-network-instance and lsp-next-hops are mutually exclusive";
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant