Internet-Draft YANG Module File Name Convention June 2026
Andersson Expires 5 December 2026 [Page]
Workgroup:
NETMOD Working Group
Internet-Draft:
draft-ietf-netmod-yang-module-filename-13
Updates:
6020, 7950, 9907 (if approved)
Published:
Intended Status:
Standards Track
Expires:
Author:
P. Andersson
Ionio Systems

YANG module file name convention

Abstract

This document defines the YANG module file name convention. The convention extends the YANG module file name using revision‑date, with the YANG semantic version extension. The YANG semantic version extension allows for an informative version to be associated with a particular YANG module revision.

This document updates RFCs 6020, 7950, and 9907.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 5 December 2026.

Table of Contents

1. Introduction

This document defines the YANG module file name convention. It extends the current convention defined in [RFC6020], [RFC7950], and [RFC9907], which uses revision-date, with the YANG semantic version extension defined in [I-D.ietf-netmod-yang-semver].

1.1. Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

1.2. Motivation

Using YANG semantic version instead of revision date conveys additional information to the user. A revision date only tells the user that it has been updated, while, for instance, a YANG Semver version can tell the user about the module's compatibility level at a glance. Having this information available in the module file name, makes it possible to quickly identify the module revision without searching in the file contents and checking the revisions. Having the YANG semantic version visible in the file name will make it easier to handle large sets of YANG modules.

2. YANG Module File Names

This section updates Section 5.2 of [RFC7950], Section 5.2 of [RFC6020], and Section 3.2 of [RFC9907].

If a revision has an associated YANG semantic version (ysv:version) then a YANG file SHOULD be created that uses the YANG semantic version in the file name. Additionally, YANG files with or without the revision-date MAY be created. The name of the files SHOULD be of the form:


    module-or-submodule-name ['@' (ysv:version) / (revision-date)]
        ( '.yang' / '.yin' )

E.g., acme‑router‑module@2.0.3.yang, acme‑router‑module@2024‑05‑15.yang, or acme‑router‑module.yang.

Due to limitations of tooling, requirements of interoperability with legacy systems, and deployed system limitations, it might be difficult or impractical to use the file name convention defined in this document. In such cases it is acceptable to not use the YANG module file name convention.

The ysv:version in the file name MUST match the ysv:version in the most recent revision of the YANG module.

Even though the ysv:version and the file name must match, the authorative source for the ysv:version is the contents in the YANG module, not the file name.

Note that several files might be created as a consequence of using ysv:version or revision-date. For instance a YANG module without ysv:version can be defined in either "module.yang", "module@2020-02-20.yang", or both. A YANG module with ysv:version can be represented by "module@1.0.0.yang", "module@2026-06-02.yang", "module.yang". The contents of the YANG modules for the same revision MUST be identical byte-for-byte.

In short, the YANG semantic version file name scheme is RECOMMENDED, as its use will convey compatibility status at a glance without the need to read the module. If a system or tooling can't handle the YANG module file name convention, it is acceptable to not support or use the convention defined in this document.

2.1. Code Components

This section updates Section 3.2 of [RFC9907].

If a revision has a ysv:version, the "<CODE BEGINS>" tag MUST be followed by a file name specified in this section. The name string form that include the ysv:version SHOULD be used. The ysv:version in the file name MUST match the ysv:version used in the most recent revision date.

The following example is for the "2026-06-02" revision of the "ietf-foo" module, with ysv:version "1.0.0":

<CODE BEGINS> file "ietf-foo@1.0.0.yang"

        module ietf-foo {
          namespace "urn:ietf:params:xml:ns:yang:ietf-foo";
          prefix "foo";
          organization "...";
          contact "...";
          description "...";
          revision 2026-06-02 {
            ysv:version 1.0.0;
            description "Latest revision";
            reference "RFC FFFF: Foo Protocol";
          }
          // ... more statements
        }

<CODE ENDS>

2.2. Coexistence with YANG Semver

All valid identifiers for YANG semantic version are valid in the file name as well. See more details for YANG Semver identifiers in Section 4.3 of [I-D.ietf-netmod-yang-semver].

The following example is a valid YANG module file name


    example-module@2.3.1_non_compatible+build2237refM443ss.yang

There might exist two modules derived from version 2.0.0 with the same X.Y.Z digits (2.0.1) but different version labels:


    2.0.1-draft-superman-super-stuff-03

    2.0.1-draft-batman-cool-addition-07   (a competing draft)

3. Operational Considerations

The delimiter symbol for YANG Semver is "@", the at sign (ASCII code decimal 64). The same symbol is also used for revision-date. The patterns for YANG Semver and revision-date will never match the same string, and it is easy to visually identify each of the conventions.

The YANG module file name convention does not impact modules already in use.

Tooling might need updates to handle the YANG module file name convention defined in this document. In most cases this should be a small effort. When migrating to the YANG module file name convention, different methods can be used to support existing files and new files. An example is the use of symlinks with the file name defined in this document to existing files can be used when migrating existing YANG modules to the YANG module file name convention.

4. IANA Considerations

For complete guidance on how to handle YANG modules in RFCs and IANA registries, with regards to [I-D.ietf-netmod-yang-module-versioning], [I-D.ietf-netmod-yang-semver], and YANG module file names, see [I-D.ietf-netmod-iana-yang-guidance].

The "YANG Module Names" registry under "YANG Parameters" registry group need to support YANG modules with both the existing file name convention and the file name convention defined in this document.

The IANA action is to update the registry to support the YANG module file name convention. If a YANG module (or submodule) has an associated YANG semantic version (ysv:version) a file name including it is listed. Additionally, a file name with revision-date is listed for the YANG module (or submodule). Files with the same revision are identical byte-for-byte.

5. Security Considerations

There are no security considerations for this document.

6. References

6.1. Normative References

[I-D.ietf-netmod-yang-module-versioning]
Wilton, R., Rahman, R., Lengyel, B., Clarke, J., and J. Sterne, "Updated YANG Module Revision Handling", Work in Progress, Internet-Draft, draft-ietf-netmod-yang-module-versioning-16, , <https://datatracker.ietf.org/doc/html/draft-ietf-netmod-yang-module-versioning-16>.
[I-D.ietf-netmod-yang-semver]
Clarke, J., Wilton, R., Rahman, R., Lengyel, B., Sterne, J., and B. Claise, "YANG Semantic Versioning", Work in Progress, Internet-Draft, draft-ietf-netmod-yang-semver-26, , <https://datatracker.ietf.org/doc/html/draft-ietf-netmod-yang-semver-26>.
[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/info/rfc2119>.
[RFC6020]
Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10.17487/RFC6020, , <https://www.rfc-editor.org/info/rfc6020>.
[RFC7950]
Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10.17487/RFC7950, , <https://www.rfc-editor.org/info/rfc7950>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/info/rfc8174>.
[RFC9907]
Bierman, A., Boucadair, M., Ed., and Q. Wu, "Guidelines for Authors and Reviewers of Documents Containing YANG Data Models", BCP 216, RFC 9907, DOI 10.17487/RFC9907, , <https://www.rfc-editor.org/info/rfc9907>.

6.2. Informative References

[I-D.ietf-netmod-iana-yang-guidance]
Wilton, R., "Guidance for Managing YANG Modules in RFCs and IANA Registries", Work in Progress, Internet-Draft, draft-ietf-netmod-iana-yang-guidance-02, , <https://datatracker.ietf.org/doc/html/draft-ietf-netmod-iana-yang-guidance-02>.

Appendix A. Known Incompatibilities

RFC Ed: This note is to be removed before publishing as an RFC.

There are currently no known publicly available tools that support the YANG semantic version file name schema. There are known proprietary tooling that already uses the file name schema presented in this document.

At the IETF 119 Hackathon, there was a project that investigated the feasibility to modify popular YANG tooling to support the proposed schema. There was a successful attempt to modify pyang to support the file name schema and also "recommended-min" previously included in [I-D.ietf-netmod-yang-module-versioning]. Furthermore, there were efforts in researching yanger and libyang to support the schema, but the hackathon ended before these projects could be concluded.

Acknowledgements

The author would like to thank Joe Clarke, Reshad Rahman, Mahesh Jethanandani, David Dong, Aihua Guo, Barry Leiba, Joel M. Halpern, Meir Goldman, Carsten Bormann, and Kent Watsen for their excellent technical reviews, support, and guidance.

Author's Address

Per Andersson
Ionio Systems