Repository navigation
Add static LSP admin/oper state, payload-type, static label block and next-network-instance - #1567
nokia1adam wants to merge 1 commit into
Conversation
… 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.
Summary of ChangesHello, 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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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 { | |||
There was a problem hiding this comment.
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:
- Cisco IOS-XR: Cisco IOS-XR MPLS Static Configuration Guide
- Nokia SR Linux: Nokia SR Linux MPLS Guide
- Juniper JunOS: Juniper JunOS MPLS User Guide
- Arista EOS: Arista EOS MPLS Commands
- NVIDIA Cumulus: NVIDIA Cumulus Linux MPLS Guide
- SONiC: SONiC MPLS and FRR Documentation
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
- Gemini should compare the yang changes with the documentation of implementations of network operating systems and generate a comparison table with links. (link)
| leaf next-network-instance { | ||
| type oc-ni:network-instance-ref; |
There was a problem hiding this comment.
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";
}
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(defaulttrue): 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 existingoc-mplst:LSP_OPER_STATUSidentities) andstatic-lsp/state/down-reason(ADMIN_DOWN,LABEL_UNAVAILABLE,NEXT_HOPS_UNRESOLVED,RESOURCE_ALLOCATION_FAILED). Todaystatic-lsp/statecontains onlyname, 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 existingreserved-label-block. When it is set, theincoming-labelof 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-instancein a newopenconfig-mpls-network-instancemodule: pop the incoming label and look up the exposed header in another network-instance. For example, a labelled packet arrives inDEFAULTand the inner IP packet is looked up in a customer VRF. This is the MPLS counterpart ofnext-network-instancefor static routes inopenconfig-local-routing-network-instance. It is mutually exclusive withlsp-next-hops. It lives in a separate module to avoid a circular import betweenopenconfig-mplsandopenconfig-network-instance.Related: #1395 proposes the same
openconfig-mpls-network-instancemodule, addingnh-network-instanceto egresslsp-next-hopand an egressnext-hop-groupreference.nh-network-instancein #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, whichnext-network-instanceadds here. The two changes can be combined into the one module, depending on which PR merges first.The
openconfig-mplsversion is bumped from 3.6.2 to 3.7.0 (in the module and its te, igp and static submodules), andopenconfig-mpls-network-instanceis 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)local-label <label> allocate per-vrf forward path 1 pop-and-lookupundermpls static vrf <vrf>("When the router receives packets with VRF label 30500, it removes the label and then performs IP-based lookup to forward the packets").mpls static vrf-label <label> vrf <vrf>configures a static VRF label route.network-instance mpls lsps static-lsp egress network-instance).Static label range (
static-lsp-label-block)mpls label range <min> <max> static <min-static> <max-static>("You can configure static bindings only from the current static range").mpls label range static <base> <size>.network-instance mpls static-label-block, which points tosystem mpls label-ranges static).Admin and operational state (
enabled,oper-status,down-reason)admin-stateon static MPLS entries, andoper-state/oper-down-reasonon static LSPs. Other models already expose admin and operational state the same way, for example theadmin-statusandoper-statusof 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]