Skip to content

Add DSCP leaf to GRE encapsulation config#1510

Open
dongping-zhu wants to merge 1 commit into
openconfig:masterfrom
dongping-zhu:gre-encap-dscp
Open

Add DSCP leaf to GRE encapsulation config#1510
dongping-zhu wants to merge 1 commit into
openconfig:masterfrom
dongping-zhu:gre-encap-dscp

Conversation

@dongping-zhu

Copy link
Copy Markdown

Change Scope

  • Add a DSCP leaf to the GRE encapsulation config grouping in openconfig-aft-common.yang.
  • This change is backwards compatible, it adds a new leaf with no impact on existing leaves.

Platform Implementations

  • Implementation Arista: Nexthop Groups MPLS over GRE nexthop group supports TOS configuration. TOS maps directly to/from DSCP.
  • Implementation B: link to documentation and/or implementation output.

Tree View

 module: openconfig-network-instance
         +--rw static
         |  +--rw next-hops
         |     +--rw next-hop* [index]
         |        +--rw index            -> ../config/index
         |        +--rw encap-headers
         |           +--rw encap-header* [index]
         |              +--rw index     -> ../config/index
         |              +--rw gre
         |              |  +--rw config
         |              |  |  +--rw src-ip?   oc-inet:ip-address
         |              |  |  +--rw dst-ip?   oc-inet:ip-address
         |              |  |  +--rw ttl?      uint8
+        |              |  |  +--rw dscp?     oc-inet:dscp
         |              |  +--ro state
         |              |     +--ro src-ip?   oc-inet:ip-address
         |              |     +--ro dst-ip?   oc-inet:ip-address
         |              |     +--ro ttl?      uint8
+        |              |     +--ro dscp?     oc-inet:dscp
         |              +--rw mpls
         +--rw afts
         |  +--ro next-hops
         |     +--ro next-hop* [index]
         |        +--ro index            -> ../state/index
         |        +--ro gre
         |        |  +--ro state
         |        |     +--ro src-ip?   oc-inet:ip-address
         |        |     +--ro dst-ip?   oc-inet:ip-address
         |        |     +--ro ttl?      uint8
+        |        |     +--ro dscp?     oc-inet:dscp
         |        +--ro encap-headers
         |        |  +--ro encap-header* [index]
         |        |     +--ro index     -> ../state/index
         |        |     +--ro state
         |        |     |  +--ro index?   uint8
         |        |     |  +--ro type?    oc-aftt:encapsulation-header-type
         |        |     +--ro gre
         |        |     |  +--ro state
         |        |     |     +--ro src-ip?   oc-inet:ip-address
         |        |     |     +--ro dst-ip?   oc-inet:ip-address
         |        |     |     +--ro ttl?      uint8
+        |        |     |     +--ro dscp?     oc-inet:dscp
         +--rw protocols

@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 updates the openconfig-aft-common.yang submodule to version 3.5.0 and adds a dscp leaf to the GRE encapsulation configuration. The review feedback points out a version mismatch issue, noting that the parent module openconfig-aft.yang must also be updated to version 3.5.0 to prevent compilation and linter failures. Additionally, a technical correction was suggested for the dscp leaf description to clarify that the DSCP value applies to the outer IP header of the GRE-encapsulated packet rather than the GRE header itself.

Comment thread release/models/aft/openconfig-aft-common.yang
Comment thread release/models/aft/openconfig-aft-common.yang
@navaneethyv

Copy link
Copy Markdown
Contributor

OC operator review June 30:

@dongping-zhu please take care of the review comments from gemini

@dongping-zhu

Copy link
Copy Markdown
Author

OC operator review June 30:

@dongping-zhu please take care of the review comments from gemini

Hi @navaneethyv, thanks for checking, the review comments from Gemini have been addressed in the amended commit 4095e59.

@nsr-gh

nsr-gh commented Jul 2, 2026

Copy link
Copy Markdown

@dongping-zhu

Can you clarify the expected semantics of the dscp state leaf in the following cases?

  1. No explicit DSCP is configured.
  2. The implementation supports copying the inner packet ToS/DSCP into the outer GRE IP header, resulting in a packet-dependent DSCP value.

In these cases, should state/dscp be absent, report a configured value only, or is an additional encap behavior/config leaf needed to distinguish explicit DSCP marking from copy-from-inner behavior?

For example, Junos supports copying the inner ToS bits to the outer GRE header

@navaneethyv

Copy link
Copy Markdown
Contributor

Jul 7th OC operator review : supporting implementation section doesn't have vendor B, could you please add another vendor implementation [ should be atleast 2] so that this can move forward?

@dongping-zhu

Copy link
Copy Markdown
Author

@dongping-zhu

Can you clarify the expected semantics of the dscp state leaf in the following cases?

  1. No explicit DSCP is configured.
  2. The implementation supports copying the inner packet ToS/DSCP into the outer GRE IP header, resulting in a packet-dependent DSCP value.

In these cases, should state/dscp be absent, report a configured value only, or is an additional encap behavior/config leaf needed to distinguish explicit DSCP marking from copy-from-inner behavior?

For example, Junos supports copying the inner ToS bits to the outer GRE header

Hi @nsr-gh, thanks for the comments. Adding clarification here for the following scenarios:

  1. No Explicit DSCP Configured: When no explicit DSCP value is provided in the config, the state/dscp leaf will be absent.
  2. Copy-from-Inner behavior (ToS/DSCP): The current dscp leaf is designed for the static value and does not account for the dynamic 'copy-from-inner' behavior. If an explicit dscp value is configured, it is applied to the outer IP header of the GRE encapsulation. If it is omitted (absent), an outer DSCP value is not enforced, leaving the fallback behavior vendor-dependent.

From a long-term standardization perspective, adding a separate configuration leaf would be the best way to cleanly support copy-from-inner behavior.

@romeyod

romeyod commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@earies @rgwilton can you help with providing vendor implementation here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready to discuss

Development

Successfully merging this pull request may close these issues.

4 participants