Skip to content

Interface MTU type adjustments and description updates#1469

Open
earies wants to merge 4 commits into
openconfig:masterfrom
earies:interface-mtu
Open

Interface MTU type adjustments and description updates#1469
earies wants to merge 4 commits into
openconfig:masterfrom
earies:interface-mtu

Conversation

@earies

@earies earies commented Apr 5, 2026

Copy link
Copy Markdown
Contributor
  • (M) release/models/interfaces/openconfig-interfaces.yang
    • Change interface MTU type from uint16 to max-frame-size (uint32)
    • Increment to version 4.0.0
  • (M) release/models/interfaces/openconfig-if-ip.yang
    • Update IPv4/IPv6 MTU descriptions
    • Increment to version 3.9.1
  • (A) release/models/interfaces/openconfig-if-types.yang
    • Initial version 0.1.0
    • Introduction of max-frame-size typedef

Change Scope

Per discussion in the OC community call on 2026-04-02, this PR moves forward on
#1449.

  • Introduce max-frame-size typedef (uint32) in new
    openconfig-if-types.yang with L2 frame size semantics excluding FCS per IEEE
    802.3
  • Change interface mtu leaf type from uint16 to max-frame-size
    (openconfig-interfaces 3.8.1 -> 4.0.0)
  • Update IPv6 mtu references from obsoleted RFC 2460 to RFC 8200, add RFC 2675
    (openconfig-if-ip 3.9.0 -> 3.9.1)

While this change is backwards incompatible per type changes, it is anticipated
that implementations and consumers can adjust to the larger space.

Platform Implementations

N/A

Tree View

 module: openconfig-interfaces
   +--rw interfaces
      +--rw interface* [name]
         +--rw name                   -> ../config/name
         +--rw config
         |  +--rw name?                          string
         |  +--rw type                           identityref
-        |  +--rw mtu?                           uint16
+        |  +--rw mtu?                           oc-ift:max-frame-size
         |  +--rw loopback-mode?                 oc-opt-types:loopback-mode-type
         |  +--rw description?                   string
         |  +--rw enabled?                       boolean
         |  +--rw oc-vlan:tpid?                  identityref
         |  +--rw oc-if-sdn:forwarding-viable?   boolean
         |  +--rw oc-p4rt:id?                    uint32
         |  +--rw oc-hashing:hashing-policy?     -> /oc-sys:system/hashing/hashing-policies/hashing-policy/name
         +--ro state
         |  +--ro name?                              string
         |  +--ro type                               identityref
-        |  +--ro mtu?                               uint16
+        |  +--ro mtu?                               oc-ift:max-frame-size
         |  +--ro loopback-mode?                     oc-opt-types:loopback-mode-type
         |  +--ro description?                       string
         |  +--ro enabled?                           boolean
         |  +--ro ifindex?                           uint32
         |  +--ro admin-status                       enumeration
         |  +--ro oper-status                        enumeration
         |  +--ro last-change?                       oc-types:timeticks64
         |  +--ro logical?                           boolean
         |  +--ro management?                        boolean
         |  +--ro cpu?                               boolean
         |  +--ro counters
         |  |  +--ro in-octets?               oc-yang:counter64
         |  |  +--ro in-pkts?                 oc-yang:counter64
         |  |  +--ro in-unicast-pkts?         oc-yang:counter64
         |  |  +--ro in-broadcast-pkts?       oc-yang:counter64
         |  |  +--ro in-multicast-pkts?       oc-yang:counter64
         |  |  +--ro in-errors?               oc-yang:counter64
         |  |  +--ro in-discards?             oc-yang:counter64
         |  |  +--ro out-octets?              oc-yang:counter64
         |  |  +--ro out-pkts?                oc-yang:counter64
         |  |  +--ro out-unicast-pkts?        oc-yang:counter64
         |  |  +--ro out-broadcast-pkts?      oc-yang:counter64
         |  |  +--ro out-multicast-pkts?      oc-yang:counter64
         |  |  +--ro out-discards?            oc-yang:counter64
         |  |  +--ro out-errors?              oc-yang:counter64
         |  |  +--ro last-clear?              oc-types:timeticks64
         |  |  +--ro in-unknown-protos?       oc-yang:counter64
         |  |  +--ro in-fcs-errors?           oc-yang:counter64
         |  |  x--ro carrier-transitions?     oc-yang:counter64
         |  |  +--ro interface-transitions?   oc-yang:counter64
         |  |  +--ro link-transitions?        oc-yang:counter64
         |  |  +--ro resets?                  oc-yang:counter64
         |  +--ro oc-vlan:tpid?                      identityref
         |  +--ro oc-atei:out-rate?                  oc-types:ieeefloat32
         |  +--ro oc-atei:in-rate?                   oc-types:ieeefloat32
         |  +--ro oc-if-sdn:forwarding-viable?       boolean
         |  +--ro oc-port:hardware-port?             -> /oc-platform:components/component/name
         |  +--ro oc-transceiver:transceiver?        -> /oc-platform:components/component[oc-platform:name=current()/../oc-port:hardware-port]/oc-platform:subcomponents/subcomponent/name
         |  +--ro oc-transceiver:physical-channel*   -> /oc-platform:components/component[oc-platform:name=current()/../oc-transceiver:transceiver]/transceiver/physical-channels/channel/index
         |  +--ro oc-p4rt:id?                        uint32
         |  +--ro oc-hashing:hashing-policy?         -> /oc-sys:system/hashing/hashing-policies/hashing-policy/name
         +--rw hold-time
         |  +--rw config
         |  |  +--rw up?     uint32
         |  |  +--rw down?   uint32
         |  +--ro state
         |     +--ro up?     uint32
         |     +--ro down?   uint32
         +--rw penalty-based-aied
         |  +--rw config
@@ -13933,108 +13933,108 @@
         |     |        +--ro key-type?    identityref
         |     |        +--ro key-value?   string
         |     +--rw servers
         |        +--rw server* [address]
         |           +--rw address    -> ../config/address
         |           +--rw config
         |           |  +--rw address?            oc-inet:host
         |           |  +--rw port?               oc-inet:port-number
         |           |  +--rw version?            uint8
         |           |  +--rw association-type?   enumeration
         |           |  +--rw iburst?             boolean
         |           |  +--rw prefer?             boolean
         |           |  +--rw network-instance?   oc-ni:network-instance-ref
         |           |  +--rw source-address?     oc-inet:ip-address
         |           |  +--rw key-id?             -> ../../../../ntp-keys/ntp-key/key-id
         |           +--ro state
         |              +--ro address?            oc-inet:host
         |              +--ro port?               oc-inet:port-number
         |              +--ro version?            uint8
         |              +--ro association-type?   enumeration
         |              +--ro iburst?             boolean
         |              +--ro prefer?             boolean
         |              +--ro network-instance?   oc-ni:network-instance-ref
         |              +--ro source-address?     oc-inet:ip-address
         |              +--ro key-id?             -> ../../../../ntp-keys/ntp-key/key-id
         |              +--ro stratum?            uint8
         |              +--ro root-delay?         int64
         |              +--ro root-dispersion?    int64
         |              +--ro offset?             int64
         |              +--ro poll-interval?      uint32
         +--rw assigned-ap-managers
         |  +--rw ap-manager* [id]
         |     +--rw id        -> ../config/id
         |     +--rw config
         |     |  +--rw id?                        string
         |     |  +--rw fqdn?                      oc-inet:domain-name
         |     |  +--rw ap-manager-ipv4-address?   oc-inet:ipv4-address
         |     |  +--rw ap-manager-ipv6-address*   oc-inet:ipv6-address
         |     +--ro state
         |        +--ro id?                        string
         |        +--ro fqdn?                      oc-inet:domain-name
         |        +--ro ap-manager-ipv4-address?   oc-inet:ipv4-address
         |        +--ro ap-manager-ipv6-address*   oc-inet:ipv6-address
         |        +--ro joined?                    boolean
         +--rw oc-ap-if:interfaces
            +--rw oc-ap-if:interface* [name]
               +--rw oc-ap-if:name             -> ../config/name
               +--rw oc-ap-if:config
               |  +--rw oc-ap-if:name?            string
               |  +--rw oc-ap-if:type             identityref
-              |  +--rw oc-ap-if:mtu?             uint16
+              |  +--rw oc-ap-if:mtu?             oc-ift:max-frame-size
               |  +--rw oc-ap-if:loopback-mode?   oc-opt-types:loopback-mode-type
               |  +--rw oc-ap-if:description?     string
               |  +--rw oc-ap-if:enabled?         boolean
               +--ro oc-ap-if:state
               |  +--ro oc-ap-if:name?            string
               |  +--ro oc-ap-if:type             identityref
-              |  +--ro oc-ap-if:mtu?             uint16
+              |  +--ro oc-ap-if:mtu?             oc-ift:max-frame-size
               |  +--ro oc-ap-if:loopback-mode?   oc-opt-types:loopback-mode-type
               |  +--ro oc-ap-if:description?     string
               |  +--ro oc-ap-if:enabled?         boolean
               |  +--ro oc-ap-if:ifindex?         uint32
               |  +--ro oc-ap-if:admin-status     enumeration
               |  +--ro oc-ap-if:oper-status      enumeration
               |  +--ro oc-ap-if:last-change?     oc-types:timeticks64
               |  +--ro oc-ap-if:logical?         boolean
               |  +--ro oc-ap-if:management?      boolean
               |  +--ro oc-ap-if:cpu?             boolean
               |  +--ro oc-ap-if:counters
               |     +--ro oc-ap-if:in-octets?               oc-yang:counter64
               |     +--ro oc-ap-if:in-pkts?                 oc-yang:counter64
               |     +--ro oc-ap-if:in-unicast-pkts?         oc-yang:counter64
               |     +--ro oc-ap-if:in-broadcast-pkts?       oc-yang:counter64
               |     +--ro oc-ap-if:in-multicast-pkts?       oc-yang:counter64
               |     +--ro oc-ap-if:in-errors?               oc-yang:counter64
               |     +--ro oc-ap-if:in-discards?             oc-yang:counter64
               |     +--ro oc-ap-if:out-octets?              oc-yang:counter64
               |     +--ro oc-ap-if:out-pkts?                oc-yang:counter64
               |     +--ro oc-ap-if:out-unicast-pkts?        oc-yang:counter64
               |     +--ro oc-ap-if:out-broadcast-pkts?      oc-yang:counter64
               |     +--ro oc-ap-if:out-multicast-pkts?      oc-yang:counter64
               |     +--ro oc-ap-if:out-discards?            oc-yang:counter64
               |     +--ro oc-ap-if:out-errors?              oc-yang:counter64
               |     +--ro oc-ap-if:last-clear?              oc-types:timeticks64
               |     +--ro oc-ap-if:in-unknown-protos?       oc-yang:counter64
               |     +--ro oc-ap-if:in-fcs-errors?           oc-yang:counter64
               |     x--ro oc-ap-if:carrier-transitions?     oc-yang:counter64
               |     +--ro oc-ap-if:interface-transitions?   oc-yang:counter64
               |     +--ro oc-ap-if:link-transitions?        oc-yang:counter64
               |     +--ro oc-ap-if:resets?                  oc-yang:counter64
               +--rw oc-ap-if:ethernet
               |  +--rw oc-ap-if:config
               |  |  +--rw oc-ap-if:mac-address?                oc-yang:mac-address
               |  |  +--rw oc-ap-if:enable-flow-control?        boolean
               |  |  +--rw oc-ap-if:auto-negotiate?             boolean
               |  |  +--rw oc-ap-if:standalone-link-training?   boolean
               |  |  +--rw oc-ap-if:duplex-mode?                enumeration
               |  |  +--rw oc-ap-if:port-speed?                 identityref
               |  |  +--rw oc-ap-if:fec-mode?                   identityref
               |  +--ro oc-ap-if:state
               |  |  +--ro oc-ap-if:mac-address?                oc-yang:mac-address
               |  |  +--ro oc-ap-if:enable-flow-control?        boolean
               |  |  +--ro oc-ap-if:auto-negotiate?             boolean
               |  |  +--ro oc-ap-if:standalone-link-training?   boolean
               |  |  +--ro oc-ap-if:duplex-mode?                enumeration
               |  |  +--ro oc-ap-if:port-speed?                 identityref
               |  |  +--ro oc-ap-if:fec-mode?                   identityref
               |  |  +--ro oc-ap-if:hw-mac-address?             oc-yang:mac-address

@earies earies requested a review from a team as a code owner April 5, 2026 22:54

@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 new YANG module, openconfig-if-types, which defines a max-frame-size typedef as a uint32. This new type is applied to the mtu leaf in openconfig-interfaces.yang, replacing the previous uint16 type to support larger MTU values for loopback and non-Ethernet interfaces, resulting in a major version bump to 4.0.0. Additionally, IPv6 MTU references in openconfig-if-ip.yang are updated to RFC 8200 and RFC 2675. Feedback was provided to include a meaningful description for the new openconfig-if-types module.

Comment thread release/models/interfaces/openconfig-if-types.yang Outdated
@earies

earies commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

cc: @ElodinLaarz @dplore @rgwilton @jsterne for comment/review

earies added 4 commits May 11, 2026 18:11
  * (M) release/models/interfaces/openconfig-interfaces.yang
    - Change interface MTU type from uint16 to max-frame-size (uint32)
    - Increment to version 4.0.0
  * (M) release/models/interfaces/openconfig-if-ip.yang
    - Update IPv4/IPv6 MTU descriptions
    - Increment to version 3.9.1
  * (A) release/models/interfaces/openconfig-if-types.yang
    - Initial version 0.1.0
    - Introduction of max-frame-size typedef
@earies

earies commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Bumping for review - cc: @ElodinLaarz @dplore @rgwilton @jsterne

@dplore dplore moved this to Ready to discuss in OC Operator Review May 15, 2026
@dplore

dplore commented May 15, 2026

Copy link
Copy Markdown
Member

What is the motivation to change this? Are there real operational use cases where uint16 is breaking? If there are, I think we have to introduce this as a non-breaking change.

It is probably not practical to prove that making this change will affect real deployments. Conceptually this can break constraints for clients and servers:

Client Constraints: Client applications that generate or validate configuration data strictly enforce YANG types. An older client might expect the value to fall within (0 \le x \le 65535). Upgrading the server schema can cause these clients to fail validation.

Server/Device Implementation: On the backend, generated APIs or struct bindings (e.g., in C or Python) are tied to specific data types. A native 16-bit field in a driver or hardware is fundamentally changed to a 32-bit field, which requires software re-compilation and can disrupt encoding/decoding rules (like NETCONF/RESTCONF serialization).

@earies

earies commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

What is the motivation to change this? Are there real operational use cases where uint16 is breaking? If there are, I think we have to introduce this as a non-breaking change.

It is probably not practical to prove that making this change will affect real deployments. Conceptually this can break constraints for clients and servers:

Client Constraints: Client applications that generate or validate configuration data strictly enforce YANG types. An older client might expect the value to fall within (0 \le x \le 65535). Upgrading the server schema can cause these clients to fail validation.

Server/Device Implementation: On the backend, generated APIs or struct bindings (e.g., in C or Python) are tied to specific data types. A native 16-bit field in a driver or hardware is fundamentally changed to a 32-bit field, which requires software re-compilation and can disrupt encoding/decoding rules (like NETCONF/RESTCONF serialization).

Motivation was discussed in our 2026-04-02 OC Community call w/ consensus to proceed w/ this PR from what is described in: #1449

Yes - type changes as such affect the cases you mention above, especially if client/servers (and other type aware downstream systems) are not in synchronization and any type change is backwards incompatible as such - blast radius can obviously differ.

As we stand currently at uint16 - implementations cannot convey anything larger and with the IPv6 MTU set to uint32, we have no consitent means of how to handle (or outright drop the node).

@dplore

dplore commented May 26, 2026

Copy link
Copy Markdown
Member

A safer approach would be to follow the standard guidance to deprecate the existing and introduce a new leaf. Perhaps the new leaf name could be mtu32?

@dplore

dplore commented May 26, 2026

Copy link
Copy Markdown
Member

/gcbrun

@OpenConfigBot

Copy link
Copy Markdown

Major YANG version changes in commit 9fd8c62:
openconfig-interfaces.yang: 3.8.1 -> 4.0.0

@earies

earies commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

A safer approach would be to follow the standard guidance to deprecate the existing and introduce a new leaf. Perhaps the new leaf name could be mtu32?

We could most certainly take this approach but would like to solicit folks opinions here as to consistent nomenclature and how to reduce confusion between all mtu leafs today. We will face this naming problem for all such scenarios where the original name sufficed but a deficiency was discovered at some later date.

List of mtu leafs and they respective types as of today:

$ pyang -p .. openconfig-i* -f flatten --flatten-type | grep mtu
/openconfig-interfaces:interfaces/interface/config/mtu,uint16
/openconfig-interfaces:interfaces/interface/openconfig-if-tunnel:tunnel/ipv4/config/mtu,uint16
/openconfig-interfaces:interfaces/interface/openconfig-if-tunnel:tunnel/ipv4/state/mtu,uint16
/openconfig-interfaces:interfaces/interface/openconfig-if-tunnel:tunnel/ipv6/config/mtu,uint32
/openconfig-interfaces:interfaces/interface/openconfig-if-tunnel:tunnel/ipv6/state/mtu,uint32
/openconfig-interfaces:interfaces/interface/openconfig-vlan:routed-vlan/openconfig-if-ip:ipv4/config/mtu,uint16
/openconfig-interfaces:interfaces/interface/openconfig-vlan:routed-vlan/openconfig-if-ip:ipv4/state/mtu,uint16
/openconfig-interfaces:interfaces/interface/openconfig-vlan:routed-vlan/openconfig-if-ip:ipv6/config/mtu,uint32
/openconfig-interfaces:interfaces/interface/openconfig-vlan:routed-vlan/openconfig-if-ip:ipv6/state/mtu,uint32
/openconfig-interfaces:interfaces/interface/state/mtu,uint16
/openconfig-interfaces:interfaces/interface/subinterfaces/subinterface/openconfig-if-ip:ipv4/config/mtu,uint16
/openconfig-interfaces:interfaces/interface/subinterfaces/subinterface/openconfig-if-ip:ipv4/state/mtu,uint16
/openconfig-interfaces:interfaces/interface/subinterfaces/subinterface/openconfig-if-ip:ipv6/config/mtu,uint32
/openconfig-interfaces:interfaces/interface/subinterfaces/subinterface/openconfig-if-ip:ipv6/state/mtu,uint32

@navaneethyv

Copy link
Copy Markdown

OC review June 2nd.

Thanks for looking into this. It would be better to follow this notion now onward so that our future changes are clear and concise and aligns to non breaking changes.

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

Labels

Projects

Status: Ready to discuss

Development

Successfully merging this pull request may close these issues.

4 participants