Skip to content

Adding Ipv6 header encapsulation support to static GUE tunnel#1492

Open
nupkanoi wants to merge 9 commits into
openconfig:masterfrom
nupkanoi:oc_v6
Open

Adding Ipv6 header encapsulation support to static GUE tunnel#1492
nupkanoi wants to merge 9 commits into
openconfig:masterfrom
nupkanoi:oc_v6

Conversation

@nupkanoi
Copy link
Copy Markdown
Contributor

@nupkanoi nupkanoi commented May 12, 2026

Change Scope

Adding Ipv6 header encapsulation support to static GUE tunnel

Support for UDP-V4 already exist.

Tree View

          |              +--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 udp-v6
+         |              |  +--rw config
+         |              |  |  +--rw src-ip?         oc-inet:ipv6-address
+         |              |  |  +--rw dst-ip?         oc-inet:ipv6-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:ipv6-address
+         |              |     +--ro dst-ip?         oc-inet:ipv6-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 ttl?      uint8
          |              |  +--ro state
          |              |     +--ro src-ip?   oc-inet:ip-address

@nupkanoi nupkanoi requested a review from a team as a code owner May 12, 2026 23:54
Copy link
Copy Markdown
Contributor

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

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-network-instance-static YANG module to version 0.2.2, introducing a new udp-v6 container to support static encapsulation headers for UDP in IPv6. The review feedback suggests improving the clarity and consistency of the module's documentation by correcting a typo in the revision history and providing more specific descriptions for the newly added configuration and state containers.

Comment thread release/models/network-instance/openconfig-network-instance-static.yang Outdated
nupkanoi and others added 2 commits May 13, 2026 11:56
…atic.yang

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…atic.yang

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@dplore
Copy link
Copy Markdown
Member

dplore commented May 13, 2026

/gcbrun

@dplore dplore moved this to Ready to discuss in OC Operator Review May 13, 2026
…atic.yang

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented May 13, 2026

No major YANG version changes in commit 8cd39ba

@dplore
Copy link
Copy Markdown
Member

dplore commented May 18, 2026

/gcbrun

@dplore dplore mentioned this pull request May 18, 2026
@dplore
Copy link
Copy Markdown
Member

dplore commented May 18, 2026

/gcbrun

@dplore
Copy link
Copy Markdown
Member

dplore commented May 18, 2026

#1234 has links to implementation references

@ElodinLaarz
Copy link
Copy Markdown
Contributor

Reviewed in OC Operators Meeting May 19th, 2026:

Note* - ip-ttl name comes from an import of another module; so, the inconsistency with ipv6 comes from there. If anyone has a strong opinion, it could be changed, but seems okay as-is.

Otherwise, just the minor version bump as suggested in review.

Should be good to move to last-call in 2 weeks.

Comment thread release/models/network-instance/openconfig-network-instance-static.yang Outdated
Comment thread release/models/network-instance/openconfig-network-instance-static.yang Outdated
@ElodinLaarz ElodinLaarz moved this from Ready to discuss to last-call in OC Operator Review May 19, 2026
@dplore
Copy link
Copy Markdown
Member

dplore commented May 19, 2026

For reviewer convenience:

  +--rw network-instances
     +--rw network-instance* [name]

[...]

        +--rw static
        |  +--rw next-hops
        |     +--rw next-hop* [index]
        |        +--rw encap-headers
        |           +--rw encap-header* [index]

[...]

          |              +--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 udp-v6
+         |              |  +--rw config
+         |              |  |  +--rw src-ip?         oc-inet:ipv6-address
+         |              |  |  +--rw dst-ip?         oc-inet:ipv6-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:ipv6-address
+         |              |     +--ro dst-ip?         oc-inet:ipv6-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 ttl?      uint8
          |              |  +--ro state
          |              |     +--ro src-ip?   oc-inet:ip-address

[...]

nupkanoi and others added 2 commits May 21, 2026 12:15
…atic.yang

Co-authored-by: Caleb Geiger <48812321+ElodinLaarz@users.noreply.github.com>
…atic.yang

Co-authored-by: Caleb Geiger <48812321+ElodinLaarz@users.noreply.github.com>
@dplore
Copy link
Copy Markdown
Member

dplore commented May 21, 2026

/gcbrun

@dplore
Copy link
Copy Markdown
Member

dplore commented May 21, 2026

FYI Last call deadline is June 2, 2026

@tasaleh
Copy link
Copy Markdown

tasaleh commented May 27, 2026

​​As per RFC8200, IPv6 header defines Hop Limit field which is equivalent to the IPv4 Time To Live (TTL) field.
We suggest to rename the leaf ip-ttl​ to hop-limit​ under udp-v6/config/ and udp-v6/state.

@tasaleh
Copy link
Copy Markdown

tasaleh commented May 27, 2026

TTL, Hop Limit, and DSCP/Traffic Class can be viewed as tunnel header fields whose values are processed according to defined tunnel conceptual models, most notably Uniform and Pipe modes.

Overview

  • Uniform mode (Propagation): The corresponding field from the inner packet is propagated into the outer tunnel header during encapsulation. Where field-specific decapsulation behavior is defined, the tunnel header field may also influence the forwarded packet at tunnel egress.
  • Pipe mode: The outer tunnel header field is processed independently from the corresponding inner packet field. The outer field is set using an explicitly configured value, a default value, or another field-specific policy, and changes within the tunnel are not propagated back to the inner packet at tunnel egress.

These conceptual tunnel models are used across multiple specifications and header fields. Since the same tunnel processing concept applies to multiple header fields (IPv4 TTL, IPv6 Hop Limit, and DSCP/Traffic Class), it is preferable to model this as a generic reusable identity that can be set explicitly by configuration leaves rather than encoding it implicitly.

Proposed Configuration Leaves

We suggest explicit configurable leaves to set the tunnel processing models:

  • ttl-processing-mode
  • hop-limit-processing-mode
  • dscp-processing-mode

These leaves are of type tunnel-header-field-mode-type, defined as follows:

typedef tunnel-header-field-mode-type {
type identityref {
base TUNNEL_HEADER_FIELD_MODE;
}
}

Derived Identities

  • TUNNEL_HEADER_FIELD_MODE_UNIFORM
  • TUNNEL_HEADER_FIELD_MODE_PIPE

We also suggest setting a default value for the ip-ttl, hop-limit, and dscp leaves. This terminology is aligned with RFC 3270, RFC 2983, RFC 3443, and RFC 2473.

Generic Behavior Table

processing-mode Field-specific value configured? Outer tunnel header-field behavior
TUNNEL_HEADER_FIELD_MODE_UNIFORM Yes or no Propagate the corresponding value from the inner packet header to the outer tunnel header. The field-specific configured value is ignored for encapsulation.
TUNNEL_HEADER_FIELD_MODE_PIPE Yes Use the explicitly configured field-specific value in the outer tunnel header.
TUNNEL_HEADER_FIELD_MODE_PIPE No Use the field-specific default value or policy-defined value in the outer tunnel header.

References

RFC Context
RFC 3270 Defines the Uniform, Pipe, and Short Pipe tunnel models in the context of MPLS DiffServ/QoS treatment.
RFC 2983 Discusses DiffServ behavior across tunnels, including how DSCP/DS field values may be copied, preserved, or independently set across tunnel boundaries.
RFC 3443 Applies the Uniform and Pipe tunnel model concepts to TTL processing in MPLS networks.
RFC 2473 Defines generic IPv6 tunneling behavior, including outer IPv6 Hop Limit handling.
RFC 2474 Defines the DS field/DSCP semantics used by the DiffServ tunneling behavior described in RFC 2983 and RFC 3270.

Suggested YANG Implementation​​ for the above changes

identity TUNNEL_HEADER_FIELD_MODE {
  description
    "Base identity for tunnel header-field processing modes.

    Tunnel header-field processing modes describe how a packet header
    field is handled across a tunnel encapsulation or decapsulation
    boundary. Examples of such fields include IPv4 TTL, IPv6 Hop Limit,
    and DSCP/Traffic Class.

    The mode determines whether the selected field is propagated between
    the inner and outer headers, or whether the tunnel header uses an
    independently configured/default value.";
  reference
    "RFC 3270: Multi-Protocol Label Switching (MPLS) Support of
     Differentiated Services.

     RFC 2983: Differentiated Services and Tunnels.

     RFC 3443: Time To Live (TTL) Processing in Multi-Protocol
     Label Switching (MPLS) Networks.";
}

identity TUNNEL_HEADER_FIELD_MODE_UNIFORM {
  base TUNNEL_HEADER_FIELD_MODE;
  description
    "Uniform tunnel header-field processing mode.

    In uniform mode, the selected header field is propagated across
    the tunnel boundary. At tunnel ingress, the outer tunnel header
    field is derived from the corresponding inner packet header field.

    Where field-specific decapsulation behavior is defined, changes to
    the tunnel header field may be reflected back to the forwarded
    packet at tunnel egress.

    This mode is also commonly described as propagation.";
  reference
    "RFC 3270: Multi-Protocol Label Switching (MPLS) Support of
     Differentiated Services.

     RFC 2983: Differentiated Services and Tunnels.

     RFC 3443: Time To Live (TTL) Processing in Multi-Protocol
     Label Switching (MPLS) Networks.";
}

identity TUNNEL_HEADER_FIELD_MODE_PIPE {
  base TUNNEL_HEADER_FIELD_MODE;
  description
    "Pipe tunnel header-field processing mode.

    In pipe mode, the selected outer tunnel header field is independent
    of the corresponding inner packet header field. At tunnel ingress,
    the outer tunnel header field is set from an explicitly configured
    value, a default value, or other field-specific policy, rather than
    being copied from the inner packet.

    Where field-specific decapsulation behavior is defined, changes to
    the tunnel header field are not propagated back to the forwarded
    inner packet.";
  reference
    "RFC 3270: Multi-Protocol Label Switching (MPLS) Support of
     Differentiated Services.

     RFC 2983: Differentiated Services and Tunnels.

     RFC 3443: Time To Live (TTL) Processing in Multi-Protocol
     Label Switching (MPLS) Networks.";
}

typedef tunnel-header-field-mode-type {
  type identityref {
    base TUNNEL_HEADER_FIELD_MODE;
  }
  description
    "Type definition for tunnel header-field processing modes.

    This type is intended for use by configuration leaves that control
    whether a specific packet header field, such as IPv4 TTL, IPv6 Hop
    Limit, or DSCP/Traffic Class, is propagated across a tunnel boundary
    or independently set by the tunnel.";
  reference
    "RFC 3270: Multi-Protocol Label Switching (MPLS) Support of
     Differentiated Services.

     RFC 2983: Differentiated Services and Tunnels.

     RFC 3443: Time To Live (TTL) Processing in Multi-Protocol
     Label Switching (MPLS) Networks.";
}

leaf ttl-processing-mode {
  type tunnel-header-field-mode-type;
  description
    "Specifies the tunnel processing mode for IPv4 TTL.

    When set to TUNNEL_HEADER_FIELD_MODE_UNIFORM, the IPv4 TTL value
    from the inner packet is propagated to the outer IPv4 header during
    tunnel encapsulation.

    When set to TUNNEL_HEADER_FIELD_MODE_PIPE, the outer IPv4 TTL value
    is set independently of the inner packet TTL, using the configured
    or default ip-ttl value.";
  reference
    "RFC 3443: Time To Live (TTL) Processing in Multi-Protocol
     Label Switching (MPLS) Networks.";
}

leaf hop-limit-processing-mode {
  type tunnel-header-field-mode-type;

  description
    "Specifies the tunnel processing mode for IPv6 Hop Limit.

    When set to TUNNEL_HEADER_FIELD_MODE_UNIFORM, the IPv6 Hop Limit
    value from the inner packet is propagated to the outer IPv6 tunnel
    header during encapsulation.

    When set to TUNNEL_HEADER_FIELD_MODE_PIPE, the outer IPv6 Hop Limit
    value is set independently of the inner packet Hop Limit. The value
    is taken from explicit configuration, a default value, or another
    field-specific policy defined by the model.

    In pipe mode, changes to the outer IPv6 Hop Limit while the packet
    traverses the tunnel are not propagated back to the inner packet at
    tunnel egress.

    This leaf controls only the tunnel header-field processing model for
    Hop Limit. Normal IPv6 forwarding behavior, including Hop Limit
    decrement processing, is outside the scope of this leaf.";

  reference
    "RFC 8200: Internet Protocol, Version 6 (IPv6) Specification.

     RFC 2473: Generic Packet Tunneling in IPv6 Specification.";
}

leaf dscp-processing-mode {
  type tunnel-header-field-mode-type;

  description
    "Specifies the tunnel processing mode for DSCP or Traffic Class.

    When set to TUNNEL_HEADER_FIELD_MODE_UNIFORM, the DSCP value from
    the inner packet is propagated to the outer tunnel header during
    encapsulation. For IPv4, this refers to the DSCP bits in the IPv4
    Differentiated Services field. For IPv6, this refers to the DSCP
    bits in the IPv6 Traffic Class field.

    When set to TUNNEL_HEADER_FIELD_MODE_PIPE, the outer tunnel header
    DSCP value is set independently of the inner packet DSCP value. The
    value is taken from explicit configuration, a default value, or
    another field-specific policy defined by the model.

    In pipe mode, changes to the outer tunnel header DSCP value while
    the packet traverses the tunnel are not propagated back to the inner
    packet at tunnel egress.

    This leaf models the Uniform and Pipe tunnel processing behavior for
    DSCP/Traffic Class. It does not model Short Pipe behavior.";

  reference
    "RFC 2474: Definition of the Differentiated Services Field
     in the IPv4 and IPv6 Headers.

     RFC 2983: Differentiated Services and Tunnels.

     RFC 3270: Multi-Protocol Label Switching (MPLS) Support of
     Differentiated Services.";
}

leaf ip-ttl {
  type uint8;
  default "255";
  description
    "The configured/default IPv4 TTL value used in the outer IPv4
    header during packet encapsulation when ttl-processing-mode is set
    to TUNNEL_HEADER_FIELD_MODE_PIPE.

    If ttl-processing-mode is set to TUNNEL_HEADER_FIELD_MODE_PIPE and
    this leaf is not explicitly configured, the default value of 255 is
    used as the outer IPv4 TTL.

    If ttl-processing-mode is set to TUNNEL_HEADER_FIELD_MODE_UNIFORM,
    this leaf is ignored for packet encapsulation; the IPv4 TTL value
    from the inner packet is propagated to the outer IPv4 header.";

  reference
    "RFC 791: Internet Protocol.

     RFC 3443: Time To Live (TTL) Processing in Multi-Protocol
     Label Switching (MPLS) Networks.";
}

leaf hop-limit {
  type uint8;
  default "255";
  description
    "The configured/default IPv6 Hop Limit value used in the outer IPv6
    header during packet encapsulation when hop-limit-processing-mode is
    set to TUNNEL_HEADER_FIELD_MODE_PIPE.

    If hop-limit-processing-mode is set to
    TUNNEL_HEADER_FIELD_MODE_PIPE and this leaf is not explicitly
    configured, the default value of 255 is used as the outer IPv6 Hop
    Limit.

    If hop-limit-processing-mode is set to
    TUNNEL_HEADER_FIELD_MODE_UNIFORM, this leaf is ignored for packet
    encapsulation; the IPv6 Hop Limit value from the inner packet is
    propagated to the outer IPv6 header.

    This leaf controls only the Hop Limit value placed in the outer IPv6
    tunnel header during encapsulation. Normal IPv6 Hop Limit forwarding
    behavior, including Hop Limit decrement processing, is outside the
    scope of this leaf.";
  reference
    "RFC 8200: Internet Protocol, Version 6 (IPv6) Specification.

     RFC 2473: Generic Packet Tunneling in IPv6 Specification.";
}

leaf dscp {
  type oc-inet:dscp;
  default "0";
  description
    "The configured/default DSCP value used in the outer IP header
    during packet encapsulation when dscp-processing-mode is set to
    TUNNEL_HEADER_FIELD_MODE_PIPE.

    For IPv4, this value is carried in the Differentiated Services
    field of the outer IPv4 header. For IPv6, this value is carried in
    the Traffic Class field of the outer IPv6 header.

    If dscp-processing-mode is set to TUNNEL_HEADER_FIELD_MODE_PIPE and
    this leaf is not explicitly configured, the default DSCP value of 0
    is used for the outer IP header.

    If dscp-processing-mode is set to
    TUNNEL_HEADER_FIELD_MODE_UNIFORM, this leaf is ignored for packet
    encapsulation; the DSCP value from the inner packet is propagated
    to the outer IP header.

    This leaf controls only the DSCP value placed in the outer IP
    tunnel header during encapsulation. Other QoS classification,
    marking, remarking, or scheduling behavior is outside the scope of
    this leaf.";
  reference
    "RFC 2474: Definition of the Differentiated Services Field
     in the IPv4 and IPv6 Headers.

     RFC 2983: Differentiated Services and Tunnels.";
}

@tasaleh
Copy link
Copy Markdown

tasaleh commented May 27, 2026

Currently, some attributes such as TTL/Hop-limit/DSCP/source and destination UDP ports are per-tunnel. In some use-cases, a global value is needed to set for all tunnels.
For example, in case of static GUE tunnel requirements, the DSCP is set to Uniform mode for all tunnels by default, while the TTL/Hop-limit is set to Pipe mode by default.
To optimize the configuration process, we suggest to implement a global template that contains the common attributes that could be applicable to all tunnels, while keeping the per-tunnel attributes.
If per-tunnel attributes are set for certain tunnels, they have precedence over the global values for those tunnels.

There is already a discussion about adding such a global template in this PR: #1270

@dplore
Copy link
Copy Markdown
Member

dplore commented May 28, 2026

Currently, some attributes such as TTL/Hop-limit/DSCP/source and destination UDP ports are per-tunnel. In some use-cases, a global value is needed to set for all tunnels. For example, in case of static GUE tunnel requirements, the DSCP is set to Uniform mode for all tunnels by default, while the TTL/Hop-limit is set to Pipe mode by default. To optimize the configuration process, we suggest to implement a global template that contains the common attributes that could be applicable to all tunnels, while keeping the per-tunnel attributes. If per-tunnel attributes are set for certain tunnels, they have precedence over the global values for those tunnels.

There is already a discussion about adding such a global template in this PR: #1270

Hi, adding global configuration parameters for policy-forwarding encapsulation configuration is beyond the scope of this PR. Feel free to open a new PR with your proposal which can be reviewed by the community.

@earies
Copy link
Copy Markdown
Contributor

earies commented May 28, 2026

​​As per RFC8200, IPv6 header defines Hop Limit field which is equivalent to the IPv4 Time To Live (TTL) field. We suggest to rename the leaf ip-ttl​ to hop-limit​ under udp-v6/config/ and udp-v6/state.

I suspect this is just due to grouping re-use and wouldn't justify this just for the sake of nomenclature

But the patterns here should have likely followed existing patterns that are seen in /acl (that have hop-limit shared between v4/v6)
e.g.

 +--rw ipv6
 |  +--rw config
 |  |  +--rw source-address?                   oc-inet:ipv6-prefix
...
 |  |  +--rw destination-address?              oc-inet:ipv6-prefix
...
 |  |  +--rw destination-flow-label?           oc-inet:ipv6-flow-label
 |  |  +--rw dscp?                             oc-inet:dscp
 |  |  +--rw dscp-set*                         oc-inet:dscp
 |  |  +--rw length?                           uint16
 |  |  +--rw protocol?                         oc-pkt-match-types:ip-protocol-type
 |  |  +--rw hop-limit?                        uint8

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