From 747594b49b1fc9168b433e6db5b3c5eaea739b16 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 13 Nov 2025 16:49:41 -0800 Subject: [PATCH 1/5] Add nh-network-instance --- .../models/mpls/openconfig-mpls-static.yang | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/release/models/mpls/openconfig-mpls-static.yang b/release/models/mpls/openconfig-mpls-static.yang index 44c633eb9..28b3dbdeb 100644 --- a/release/models/mpls/openconfig-mpls-static.yang +++ b/release/models/mpls/openconfig-mpls-static.yang @@ -24,7 +24,13 @@ submodule openconfig-mpls-static { "Defines static LSP configuration"; - oc-ext:openconfig-version "3.6.1"; + oc-ext:openconfig-version "3.7.0"; + + revision "2025-11-13" { + description + "Add nh-network-instance."; + reference "3.7.0"; + } revision "2025-06-24" { description @@ -193,7 +199,7 @@ submodule openconfig-mpls-static { leaf ip-address { type inet:ip-address; description - "Next hop IP address for the LSP"; + "Next hop IP address for the LSP";e } leaf push-label { @@ -203,6 +209,25 @@ submodule openconfig-mpls-static { LSP"; } + leaf nh-network-instance { + description + "Network-instance in which IP address of next-hop should + be looked up, to find egress interface. This attribute + is only valid if next-hop is given as IP address. + This attribute may be combined with recurse attribute of any + value, in which case recurse setting applies to + nh-network-instance. + + For example, let 'nh-network-instance' = 'DEFAULT'. If a + packet arrives on the 'BLUE' network-instance and the + destination address matches this route, look up the IP + configured as next-hop in the 'DEFAULT' network-instance."; + + type leafref { + path "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:config/oc-ni:name"; + } + } + // interface-ref uses oc-if:interface-ref-common; } From 50610ff0810ce4f17b12da7cb7e9e93db3b221aa Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 13 Nov 2025 17:55:40 -0800 Subject: [PATCH 2/5] add mpls static network instance --- release/models/mpls/.spec.yml | 2 + .../openconfig-mpls-network-instance.yang | 132 ++++++++++++++++++ .../models/mpls/openconfig-mpls-static.yang | 25 +--- 3 files changed, 136 insertions(+), 23 deletions(-) create mode 100644 release/models/mpls/openconfig-mpls-network-instance.yang diff --git a/release/models/mpls/.spec.yml b/release/models/mpls/.spec.yml index f50077259..b06e01f78 100644 --- a/release/models/mpls/.spec.yml +++ b/release/models/mpls/.spec.yml @@ -2,6 +2,8 @@ docs: - yang/mpls/openconfig-mpls-types.yang - yang/mpls/openconfig-mpls.yang + - yang/mpls/openconfig-mpls-network-instance.yang build: - yang/mpls/openconfig-mpls.yang + - yang/mpls/openconfig-mpls-network-instance.yang run-ci: true diff --git a/release/models/mpls/openconfig-mpls-network-instance.yang b/release/models/mpls/openconfig-mpls-network-instance.yang new file mode 100644 index 000000000..974c5a492 --- /dev/null +++ b/release/models/mpls/openconfig-mpls-network-instance.yang @@ -0,0 +1,132 @@ +module openconfig-mpls-network-instance { + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/mpls-netinst"; + + prefix "oc-mpls-ni"; + + import openconfig-network-instance { prefix "oc-ni"; } + import openconfig-extensions { prefix "oc-ext"; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module adds leaves that relate to network-instances + to the mpls subtree."; + + oc-ext:openconfig-version "0.1.0"; + + revision "2025-11-13" { + description + "Add reference to static next-hop-group and augment the local routing + module."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping static-lsp-nexthop-networkinstance { + description + "This grouping define leaves that need references to the network-instance + subtree within the local routing module. It is used to augment the + /network-instances/network-instance/protocols/protocol/static-routes/ + + static-route/next-hops/next-hop/{config,state} containers."; + + leaf nh-network-instance { + description + "Network-instance in which IP address of next-hop should + be looked up, to find egress interface. This attribute + is only valid if next-hop is given as IP address. + This attribute may be combined with recurse attribute of any + value, in which case recurse setting applies to + nh-network-instance. + + For example, let 'nh-network-instance' = 'DEFAULT'. If a + packet arrives on the 'BLUE' network-instance and the + destination address matches this route, look up the IP + configured as next-hop in the 'DEFAULT' network-instance. + This leaf is mutually exclusive with next-network-instance + leaf"; + + type leafref { + path "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:config/oc-ni:name"; + } + } + } + + grouping static-lsp-next-hop-group-networkinstance { + description + "Grouping of nodes for a reference to a static next-hop-group."; + + container next-hop-group { + description + "Configuration and state parameters relating to the + next-hop-group. In the future, this container will replace the container + /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/lsp-next-hops. + If a statically configured next-hop-group is used for a static MPLS LSP + then the 'mpls/lsps/static-lsps/static-lsp/egress/next-hops' container + must not be used."; + + container config { + description + "Configuration parameters relating to the next-hop-group."; + + uses lsp-next-hop-group-config; + } + + container state { + config false; + description + "Operational parameters relating to the next-hop-group."; + + uses lsp-next-hop-group-config; + } + } + } + + grouping lsp-next-hop-group-config { + description + "Grouping of configuration parameters for a reference to a + static next-hop-group."; + + leaf name { + description + "A user defined name to reference a static next-hop-group."; + // we are at /network-instances/network-instance/mpls/lsps/static-lsps/static-lsp/egress/next-hop-group/config/name + type leafref { + path "../../../../../../../../../oc-ni:static/oc-ni:next-hop-groups/oc-ni:next-hop-group/oc-ni:config/oc-ni:name"; + } + } + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:mpls/oc-ni:lsps/oc-ni:static-lsps/oc-ni:static-lsp/oc-ni:egress/oc-ni:config" { + description + "Add network-instance leaves to egress static lsp container."; + + uses static-lsp-next-hop-group-networkinstance; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:mpls/oc-ni:lsps/oc-ni:static-lsps/oc-ni:static-lsp/oc-ni:egress/oc-ni:lsp-next-hops/oc-ni:lsp-next-hop/oc-ni:config" { + description + "Add network-instance leaves to egress static lsp next-hop container."; + + uses static-lsp-nexthop-networkinstance; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:mpls/oc-ni:lsps/oc-ni:static-lsps/oc-ni:static-lsp/oc-ni:egress/oc-ni:lsp-next-hops/oc-ni:lsp-next-hop/oc-ni:state" { + description + "Add network-instance leaves to egress static routing next-hop container."; + + uses static-lsp-nexthop-networkinstance; + } + +} diff --git a/release/models/mpls/openconfig-mpls-static.yang b/release/models/mpls/openconfig-mpls-static.yang index 28b3dbdeb..d6fb40a47 100644 --- a/release/models/mpls/openconfig-mpls-static.yang +++ b/release/models/mpls/openconfig-mpls-static.yang @@ -12,7 +12,6 @@ submodule openconfig-mpls-static { import openconfig-extensions { prefix oc-ext; } import openconfig-interfaces { prefix oc-if; } - // meta organization "OpenConfig working group"; @@ -199,33 +198,13 @@ submodule openconfig-mpls-static { leaf ip-address { type inet:ip-address; description - "Next hop IP address for the LSP";e + "Next hop IP address for the LSP"; } leaf push-label { type oc-mplst:mpls-label; description - "Label value to push at the current hop for the - LSP"; - } - - leaf nh-network-instance { - description - "Network-instance in which IP address of next-hop should - be looked up, to find egress interface. This attribute - is only valid if next-hop is given as IP address. - This attribute may be combined with recurse attribute of any - value, in which case recurse setting applies to - nh-network-instance. - - For example, let 'nh-network-instance' = 'DEFAULT'. If a - packet arrives on the 'BLUE' network-instance and the - destination address matches this route, look up the IP - configured as next-hop in the 'DEFAULT' network-instance."; - - type leafref { - path "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:config/oc-ni:name"; - } + "Label value to push at the current hop for the LSP"; } // interface-ref From 70c47edf0fd83f0703b9b7b80a386f46afdd5618 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 13 Nov 2025 18:00:45 -0800 Subject: [PATCH 3/5] remove unnecessary changes --- release/models/mpls/openconfig-mpls-static.yang | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/release/models/mpls/openconfig-mpls-static.yang b/release/models/mpls/openconfig-mpls-static.yang index d6fb40a47..44c633eb9 100644 --- a/release/models/mpls/openconfig-mpls-static.yang +++ b/release/models/mpls/openconfig-mpls-static.yang @@ -12,6 +12,7 @@ submodule openconfig-mpls-static { import openconfig-extensions { prefix oc-ext; } import openconfig-interfaces { prefix oc-if; } + // meta organization "OpenConfig working group"; @@ -23,13 +24,7 @@ submodule openconfig-mpls-static { "Defines static LSP configuration"; - oc-ext:openconfig-version "3.7.0"; - - revision "2025-11-13" { - description - "Add nh-network-instance."; - reference "3.7.0"; - } + oc-ext:openconfig-version "3.6.1"; revision "2025-06-24" { description @@ -204,7 +199,8 @@ submodule openconfig-mpls-static { leaf push-label { type oc-mplst:mpls-label; description - "Label value to push at the current hop for the LSP"; + "Label value to push at the current hop for the + LSP"; } // interface-ref From 52c9f8117f222e0e00c69e848f9cb39bee804e80 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 13 Nov 2025 18:01:21 -0800 Subject: [PATCH 4/5] update doc string --- release/models/mpls/openconfig-mpls-network-instance.yang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/models/mpls/openconfig-mpls-network-instance.yang b/release/models/mpls/openconfig-mpls-network-instance.yang index 974c5a492..e00de6ce0 100644 --- a/release/models/mpls/openconfig-mpls-network-instance.yang +++ b/release/models/mpls/openconfig-mpls-network-instance.yang @@ -24,8 +24,8 @@ module openconfig-mpls-network-instance { revision "2025-11-13" { description - "Add reference to static next-hop-group and augment the local routing - module."; + "Add reference to static next-hop-group and augment the mpls + static lsp module."; reference "0.1.0"; } From e1b771e0b5093894bafee67a81d3222f2c41c5a0 Mon Sep 17 00:00:00 2001 From: dplore Date: Thu, 13 Nov 2025 18:09:10 -0800 Subject: [PATCH 5/5] fix augment --- release/models/mpls/openconfig-mpls-network-instance.yang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/models/mpls/openconfig-mpls-network-instance.yang b/release/models/mpls/openconfig-mpls-network-instance.yang index e00de6ce0..9a6fe0ea3 100644 --- a/release/models/mpls/openconfig-mpls-network-instance.yang +++ b/release/models/mpls/openconfig-mpls-network-instance.yang @@ -108,7 +108,7 @@ module openconfig-mpls-network-instance { } } - augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:mpls/oc-ni:lsps/oc-ni:static-lsps/oc-ni:static-lsp/oc-ni:egress/oc-ni:config" { + augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:mpls/oc-ni:lsps/oc-ni:static-lsps/oc-ni:static-lsp/oc-ni:egress" { description "Add network-instance leaves to egress static lsp container.";