Skip to content

Add a global template for encap-header attributes - #1512

Open
tasaleh wants to merge 4 commits into
openconfig:masterfrom
tasaleh:static_nh_global_template
Open

Add a global template for encap-header attributes#1512
tasaleh wants to merge 4 commits into
openconfig:masterfrom
tasaleh:static_nh_global_template

Conversation

@tasaleh

@tasaleh tasaleh commented Jul 7, 2026

Copy link
Copy Markdown

Change Scope

  • Add a global template for encapsulation headers configured for static next-hops.
  • The template mainly contains UDP destination port info.

Tree View

  +--rw network-instances
        +--rw static
+       |  +--rw encap-header-template
+       |  |  +--rw config
+       |  |  |  +--rw ipv4-dst-udp-port?   oc-inet:port-number
+       |  |  |  +--rw ipv6-dst-udp-port?   oc-inet:port-number
+       |  |  |  +--rw mpls-dst-udp-port?   oc-inet:port-number
+       |  |  +--ro state
+       |  |     +--ro ipv4-dst-udp-port?   oc-inet:port-number
+       |  |     +--ro ipv6-dst-udp-port?   oc-inet:port-number
+       |  |     +--ro mpls-dst-udp-port?   oc-inet:port-number
        |  +--rw next-hops
        |     +--rw next-hop* [index]
        |        +--rw index            -> ../config/index
        |        +--rw config
        |        |  +--rw index?          string
        |        |  +--rw next-hop?       union
        |        |  +--rw recurse?        boolean
        |        |  +--rw metric?         uint32
        |        |  +--rw preference?     uint32
        |        |  +--rw wecmp-weight?   union
        |        +--ro state
        |        |  +--ro index?          string
        |        |  +--ro next-hop?       union
        |        |  +--ro recurse?        boolean
        |        |  +--ro metric?         uint32
        |        |  +--ro preference?     uint32
        |        |  +--ro wecmp-weight?   union
        |        +--rw encap-headers
        |           +--rw encap-header* [index]
        |              +--rw index     -> ../config/index
        |              +--rw config
        |              |  +--rw index?   uint8
        |              |  +--rw type?    oc-aftt:encapsulation-header-type
        |              +--ro state
        |              |  +--ro index?   uint8
        |              |  +--ro type?    oc-aftt:encapsulation-header-type
        |              +--rw udp-v4
        |              |  +--rw config
        |              |  |  +--rw src-ip?         oc-inet:ipv4-address
        |              |  |  +--rw dst-ip?         oc-inet:ipv4-address
        |              |  |  +--rw dscp?           oc-inet:dscp
        |              |  |  +--rw src-udp-port?   oc-inet:port-number
        |              |  |  +--rw dst-udp-port?   oc-inet:port-number
        |              |  |  +--rw ip-ttl?         uint8
        |              |  +--ro state
        |              |     +--ro src-ip?         oc-inet:ipv4-address
        |              |     +--ro dst-ip?         oc-inet:ipv4-address
        |              |     +--ro dscp?           oc-inet:dscp
        |              |     +--ro src-udp-port?   oc-inet:port-number
        |              |     +--ro dst-udp-port?   oc-inet:port-number
        |              |     +--ro ip-ttl?         uint8

@google-cla

google-cla Bot commented Jul 7, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@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 introduces a global encapsulation header template for static next-hops in the openconfig-network-instance-static YANG module, adding configuration and state parameters for IPv4, IPv6, and MPLS destination UDP ports. The review feedback suggests correcting the description of encap-header-template to reflect that it is a single template rather than a group of templates, and adding a reference to RFC 7510 for the MPLS destination UDP port leaf.

Comment thread release/models/network-instance/openconfig-network-instance-static.yang Outdated
tasaleh and others added 3 commits July 7, 2026 17:15
…atic.yang

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…h/public into static_nh_global_template

* 'static_nh_global_template' of https://github.com/tasaleh/public:
  Update release/models/network-instance/openconfig-network-instance-static.yang
@tasaleh
tasaleh marked this pull request as ready for review July 7, 2026 21:21
@tasaleh
tasaleh requested a review from a team as a code owner July 7, 2026 21:21

@robshakir robshakir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have generally said that we do not have ideas such as templates within OpenConfig models. They seem generally to be for the reason that a human needs to type less configuration. Is there a use case beyond this for this template?

@tasaleh

tasaleh commented Jul 8, 2026

Copy link
Copy Markdown
Author

We have generally said that we do not have ideas such as templates within OpenConfig models. They seem generally to be for the reason that a human needs to type less configuration. Is there a use case beyond this for this template?

The static next-hop UDP encap-headers allow for configured UDP destination ports per tunnel. In many existing implementations, a system-wide configuration is used where the destination port is set globally.

This template is a placeholder for any encap-header attributes that needs to be set globally and only contains the destination port for now.

Probably, we should not use "template" in the name. Instead we can use global-encap-header.

@navaneethyv

Copy link
Copy Markdown
Contributor

@tasaleh in general for this to move forward you'd need to add 2 supporting vendor implementations also, Can you please also speak about a use case as such for this ?

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.

3 participants