Skip to content

Add GRE and MPLS encap-headers to network-instance/static #1308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

dplore
Copy link
Member

@dplore dplore commented May 15, 2025

Change Scope

  • Add GRE and MPLS encap-headers to network-instance/static
  • This change is backwards compatible

Platform Implementations

While device implementations today widely support encapsulation of MPLS, GRE and MPLS into GRE packets this PR provides a method to configure a static next-hop-group for the purpose of encapsulation. Using static next-hops for MPLS in GRE encapsulation is a new feature being pursued from multiple device implementations to unify a single vendor neutral way to configure this encapsulation.

Tree view

         +--rw static
         |  +--rw next-hop-groups
         |  |  +--rw next-hop-group* [name]
         |  |     +--rw name         -> ../config/name
         |  |     +--rw config
         |  |     |  +--rw name?   string
         |  |     +--ro state
         |  |     |  +--ro name?   string
         |  |     +--rw next-hops
         |  |        +--rw next-hop* [index]
         |  |           +--rw index     -> ../config/index
         |  |           +--rw config
         |  |           |  +--rw index?   -> ../../../../../../next-hops/next-hop/index
         |  |           +--ro state
         |  |              +--ro index?   -> ../../../../../../next-hops/next-hop/index
         |  +--rw next-hops
         |     +--rw next-hop* [index]
         |        +--rw index            -> ../config/index
         |        +--rw config
         |        |  +--rw index?                   string
         |        |  +--rw next-network-instance?   -> /network-instances/network-instance/config/name
         |        |  +--rw next-hop?                union
         |        |  +--rw nh-network-instance?     -> /network-instances/network-instance/config/name
         |        |  +--rw recurse?                 boolean
         |        |  +--rw metric?                  uint32
         |        |  +--rw preference?              uint32
         |        +--ro state
         |        |  +--ro index?                   string
         |        |  +--ro next-network-instance?   -> /network-instances/network-instance/config/name
         |        |  +--ro next-hop?                union
         |        |  +--ro nh-network-instance?     -> /network-instances/network-instance/config/name
         |        |  +--ro recurse?                 boolean
         |        |  +--ro metric?                  uint32
         |        |  +--ro preference?              uint32
         |        +--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
+        |              +--rw gre
+        |              |  +--rw config
+        |              |  |  +--rw src-ip?   oc-inet:ip-address
+        |              |  |  +--rw dst-ip?   oc-inet:ip-address
+        |              |  |  +--rw ip-ttl?   oc-inet:ip-address
+        |              |  +--ro state
+        |              |     +--ro src-ip?   oc-inet:ip-address
+        |              |     +--ro dst-ip?   oc-inet:ip-address
+        |              |  |  +--rw ip-ttl?   oc-inet:ip-address
+        |              +--rw mpls
+        |                 +--rw config
+        |                 |  +--rw traffic-class?   oc-mplst:mpls-tc
+        |                 |  +--rw mpls-label?      oc-mplst:mpls-label
+        |                 +--ro state
+        |                 |  +--rw traffic-class?   oc-mplst:mpls-tc
+        |                 |  +--rw mpls-label?      oc-mplst:mpls-label

Example configuration for static next-hops with 1 MPLS label inside GRE encapsulation

{
  "next-hops": {
    "next-hop": [
      {
        "config": {
          "index": "Dest A-NH1",
          "metric": 10,
          "next-hop": "1.2.3.4"
        },
        "encap-headers": {
          "encap-header": [
            {
              "config": {
                "index": 1
                "type": "GRE",
              },
              "index": 1,
              "gre": {
                "config": {
                  "dst-ip": "1.1.1.1",
                  "src-ip": "2.2.2.2",
                  "dscp": 8,
                  "ttl": 32
                }
              }
            },
            {
              "config": {
                "index": 2
                "type": "MPLS",
              },
              "index": 2,
              "mpls": {
                "config": {
                  "label": 100,
                  "traffic-class": 1
                }
              }
            }
          ]
        },
        "index": "Dest A-NH1"
      }
    ]
  }
}

@OpenConfigBot
Copy link

OpenConfigBot commented May 15, 2025

No major YANG version changes in commit 05f35d9

@dplore dplore moved this to Ready to discuss in OC Operator Review May 16, 2025
@dplore dplore requested review from danameme and robshakir May 28, 2025 05:48
@dplore
Copy link
Member Author

dplore commented Jun 10, 2025

Updated the PR description to show the tree.

@dplore
Copy link
Member Author

dplore commented Jun 10, 2025

@robshakir ready for your review

@ElodinLaarz
Copy link
Contributor

Discussed in the meet (June 17th, 2025).

There are some changes to fix the example JSON config.
We still need to get some feedback from the vendors to see if the behavior mentioned in this comment thread is widely expected. (To be discussed at the community meet.)

Otherwise, seems good.

@dplore dplore moved this from Ready to discuss to Waiting for author in OC Operator Review Jun 17, 2025
@dplore dplore requested a review from robshakir June 27, 2025 00:08
@dplore dplore moved this from Waiting for author to last-call in OC Operator Review Jun 27, 2025
@dplore
Copy link
Member Author

dplore commented Jun 27, 2025

This will be reviewed on July 1, 2025 OC Operators meeting. Last call set for July 8, 2025

@ElodinLaarz
Copy link
Contributor

Discussed at the July 1st OC Operators Meeting -- still have to address the minor change of JSON and get the workflow checks to be passing, but other than that sounds good.

@ElodinLaarz
Copy link
Contributor

Once the checks are passing and a reviewer approves, this should be good. (we already reviewed at a previous meeting) - OC Operators Meeting July 8th.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: last-call
Development

Successfully merging this pull request may close these issues.

6 participants