<?xml version='1.0' encoding='UTF-8'?>


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-netmod-rfc8407bis-28" number="9907" category="bcp" consensus="true" submissionType="IETF" obsoletes="8407" updates="8126" tocInclude="true" sortRefs="true" symRefs="true" version="3" xml:lang="en">

  <front>
    <title abbrev="Guidelines for YANG Documents">Guidelines for Authors and Reviewers of Documents Containing YANG Data Models</title>
    <seriesInfo name="RFC" value="9907"/>
    <seriesInfo name="BCP" value="216"/>
    <author fullname="Andy Bierman">
      <organization>YumaWorks</organization>
      <address>
        <postal>
          <country>United States of America</country>
        </postal>
        <email>andy@yumaworks.com</email>
      </address>
    </author>
    <author fullname="Mohamed Boucadair" role="editor">
      <organization>Orange</organization>
      <address>
        <postal>
          <country>France</country>
        </postal>
        <email>mohamed.boucadair@orange.com</email>
      </address>
    </author>
    <author fullname="Qin Wu">
      <organization>Huawei</organization>
      <address>
        <postal>
          <country>China</country>
        </postal>
        <email>bill.wu@huawei.com</email>
      </address>
    </author>
    <date year="2026" month="March"/>
    <area>OPS</area>
    <workgroup>netmod</workgroup>
    <keyword>NETCONF</keyword>
    <keyword>RESTCONF</keyword>
    <keyword>Automation</keyword>
    <abstract>
      <t>This document provides guidelines for authors and reviewers of
   specifications containing YANG data models, including IANA-maintained YANG modules.  Recommendations and
   procedures are defined, which are intended to increase
   interoperability and usability of Network Configuration Protocol
   (NETCONF) and RESTCONF protocol implementations that utilize YANG
   modules.</t>
      <t>This document obsoletes RFC 8407; it also updates RFC 8126 by
   providing additional guidelines for writing the IANA considerations
   for RFCs that specify IANA-maintained YANG modules.</t>
    </abstract>

  </front>
  <middle>

    <section anchor="introduction">
      <name>Introduction</name>
      <t>The standardization of network configuration interfaces for use with
   network configuration management protocols, such as the Network
   Configuration Protocol (NETCONF) <xref target="RFC6241"/> and RESTCONF <xref target="RFC8040"/>,
   requires a modular set of data models that can be reused and extended
   over time.</t>
      <t>This document defines a set of guidelines for documents
   containing YANG 1.1 <xref target="RFC7950"/> and YANG 1.0 <xref target="RFC6020"/> data models, including IANA-maintained YANG modules.
   YANG is used to define the data structures, protocol operations, and
   notification content used within a NETCONF and/or RESTCONF server.
   YANG is also used to define abstract data structures <xref target="RFC8791"/>.
   A NETCONF or RESTCONF server that supports a particular YANG module
   will support client NETCONF and/or RESTCONF operation requests, as
   indicated by the specific content defined in the YANG module.</t>
      <t>Many YANG constructs are defined as optional to use, such as the
   "description" statement.  However, in order to make YANG modules more
   readable and interoperable, it is desirable to define a set of descriptive usage guidelines that
   entails a higher level of compliance than the minimum level defined
   in the YANG specification <xref target="RFC7950"/>.</t>
      <t>In addition, YANG allows constructs such as infinite length
   identifiers and string values, or top-level mandatory nodes, that a
   compliant server is not required to support.  Only constructs that
      all servers are required to support can be used in IETF YANG modules.</t>
      
      <t>This document defines usage guidelines related to the NETCONF
   Operations layer and NETCONF Content layer, as defined in <xref target="RFC6241"/>,
   and the RESTCONF methods and RESTCONF resources, as defined in
   <xref target="RFC8040"/>.</t>
      <t>These guidelines are intended to be used by authors and reviewers to
   improve the readability and interoperability of published YANG data
   models. These guidelines can be used independent of the IETF Stream of publication or even by other organizations.</t>
      <t>YANG 1.0 modules have to conform to <xref target="RFC6020"/> while YANG 1.1 modules have to conform to <xref target="RFC7950"/>;
   this document adds usage guidelines in addition to these RFCs.</t>
      <t><xref target="sec-iana-mm"/> updates <xref target="RFC8126"/> by providing guidance for writing the
   IANA Considerations sections for RFCs that specify IANA-maintained YANG modules.</t>
      <t>Note that this document is not a YANG tutorial; the reader is
   expected to know the YANG data modeling language before implementing
      the guidance in this document.</t>
      <t>This RFC contains text intended for use as a template as
designated below by the markers "<tt>&lt;BEGIN TEMPLATE TEXT&gt;</tt>" and "<tt>&lt;END
TEMPLATE TEXT&gt;</tt>" or other clear designation. Such Template Text is
subject to the provisions of Section 9(b) of the Trust Legal
Provisions.</t>

      <section anchor="changes-since-rfc-8407">
        <name>Changes Since RFC 8407</name>


        <t>The following changes have been made to the guidelines published in
   <xref target="RFC8407"/>:</t>
        <ul spacing="normal">
          <li>

<t>Implemented the following errata reports: <xref target="Err5693"/>, <xref target="Err5800"/>, <xref target="Err6899"/>, and <xref target="Err7416"/>.</t>
          </li>
          <li>
            <t>Updated the terminology.</t>
          </li>
          <li>
            <t>Added a note about notation conventions.</t>
          </li>
          <li>
            <t>Updated the reference information of the IETF author guidelines.</t>
          </li>
          <li>
            <t>Updated the guidance so that the "file name" after the "<tt>&lt;CODE BEGINS&gt;</tt>" tag is mandatory.</t>
          </li>
          <li>
            <t>Added template markers for the security template.</t>
          </li>
          <li>
            <t>Updated the YANG security considerations template to better insist on the key secure transport features.</t>
          </li>
          <li>
	    
            <t>Added statements that the security template is not required for modules that follow <xref target="RFC8791"/> or define YANG extensions such as <xref target="RFC7952"/>.</t>
          </li>
          <li>
            <t>Added a statement about how to cite the RFCs that are listed in the security template.</t>
          </li>
          <li>
            <t>Added a template for IANA registrations.</t>
          </li>
          <li>
            <t>Added a note that folding of the examples should be done as per the conventions described in <xref target="RFC8792"/>.</t>
          </li>
          <li>
            <t>Added a recommendation about long trees.</t>
          </li>
          <li>
            <t>Fixed a reference bug in <xref target="sec-module-naming-conventions"/>.</t>
          </li>
          <li>
            <t>Added a recommendation for the use of meaningful prefix values.</t>
          </li>
          <li>
            <t>Added a note that folding of YANG modules as described in RFC 8792 can be used if and only if built-in YANG features (e.g., break line, "+") are not sufficient.</t>
          </li>
          <li>
            <t>Added tool validation checks to ensure that YANG modules fit into the line limits of an I-D.</t>
          </li>
          <li>
            <t>Added tool validation checks of JSON-encoded examples.</t>
          </li>
          <li>
            <t>Added a recommendation to ease extracting and validating examples.</t>
          </li>
          <li>
            <t>Updated many examples to be aligned with the consistent indentation recommendation (internal consistency).</t>
          </li>
          <li>
 <t>Updated the guidance for writing IANA Considerations sections to
     encourage registration requests to indicate whether or not a module is
     maintained by IANA.</t>
          </li>
          <li>
            <t>Added guidelines for IANA-maintained YANG modules.</t>
          </li>
          <li>
            <t>Added guidelines about the use of the terms "YANG module" and "YANG data model".</t>
          </li>
          <li>
            <t>Elaborated the guidance for the use of values reserved for documentation in examples.</t>
          </li>
          <li>
            <t>Recommended the use of "example:" for URI examples.</t>
          </li>
          <li>
            <t>Added a new section "Defining Standard Tags" (<xref target="sec-tags"/>) to echo the guidance in <xref target="RFC8819"/>.</t>
          </li>
          <li>
            <t>Recommended against the use of "case + when" construct in some cases.</t>
          </li>
          <li>
            <t>Added a discussion about the prefix pattern to use for example modules.</t>
          </li>
          <li>
            <t>Updated the NMDA guidance in the narrative text to highlight modules that are not compliant with NMDA.</t>
          </li>
          <li>
            <t>Added a new section about the classification of YANG modules.</t>
          </li>
          <li>
            <t>Fixed an inconsistency in Section <xref target="RFC8407" section="4.6.2" sectionFormat="bare"/> where the example mentions identities but uses them without their prefix as per Section <xref target="RFC8407" section="4.6.4" sectionFormat="bare"/>.</t>
          </li>
          <li>
            <t>Fixed an inconsistency in Section <xref target="RFC8407" section="4.6.4" sectionFormat="bare"/> that failed to use "derived-from-or-self()" mentioned back in <xref target="function-library"/>.</t>
          </li>
          <li>
            <t>Added a new section for modeling abstract data structures.</t>
          </li>
          <li>
            <t>Added a discussion about "must + error-message" constructs for state data.</t>
          </li>
          <li>
            <t>Added text about summary of changes in "revision" statements.</t>
          </li>
          <li>
            <t>Added a template for IANA-maintained YANG modules.</t>
          </li>
          <li>
            <t>Updated the wiki URLs to use the new structure.</t>
          </li>
          <li>
            <t>Added "anydata" to the list of statements with mandatory description(s) (<xref target="sec-data-def"/>).</t>
          </li>
          <li>
            <t>Fixed an error (invalid statements) in Section <xref target="RFC8407" section="4.24" sectionFormat="bare"/>.</t>
          </li>
          <li>
            <t>Softened generic I-D authorship guidance.</t>
          </li>
        </ul>
      </section>
    </section>
    <section anchor="terminology-notation-conventions">
      <name>Terminology and Notation Conventions</name>
      <t>Some of the templates defined in the document use "--" to easily identify
  specific instructions to the authors. Text prefixed with "--" must not be
  copied as such when using a template. Note that for YANG templates, "//"
  is used to convey such instructions.</t>
      <t>RFC IIII is used to refer to an RFC that defines an initial version of an IANA-maintained YANG module.</t>
      <t>The following terms are used throughout this document:</t>
      <dl spacing="normal" newline="false">
        <dt>IANA-maintained YANG module:</dt>
        <dd>
          <t>A YANG module that is maintained by IANA and has an IANA registry associated with it (e.g., "iana-tunnel-type" <xref target="RFC8675"/> or "iana-pseudowire-types" <xref target="RFC9291"/>).</t>
          <t>Once an IANA-maintained YANG module is initialized, new values are not directly added to the module. These values are instead added to the companion registry.</t>
        </dd>
	
        <dt>IETF module:</dt>
        <dd>
          <t>A YANG module that is published by the IETF and that is
      not maintained by IANA.</t>
        </dd>
        <dt>published:</dt>
        <dd>
          <t>A stable release of a module or submodule.  For
 example, the Request for Comments Series described in
 <xref section="2.1" sectionFormat="of" target="RFC2026"/> is considered a stable publication.</t>
        </dd>
        <dt>unpublished:</dt>
        <dd>
          <t>An unstable release of a module or submodule.  For
 example, the Internet-Draft described in <xref section="2.2" sectionFormat="of" target="RFC2026"/>
 is considered an unstable work in progress, subject to change at any time.</t>
        </dd>
        <dt>YANG fragment:</dt>
        <dd>
          <t>A set of YANG statements that is not intended to
 represent a complete YANG module or submodule.  These statements
 are not intended for actual use, except to provide an example of
 YANG statement usage.  The invalid syntax "..." is sometimes used
 to indicate that additional YANG statements would be present in a
 real YANG module.</t>
        </dd>
        <dt>YANG tree diagram:</dt>
        <dd>
          <t>A diagram representing the contents of a YANG
 module, as defined in <xref target="RFC8340"/>.  It is also called a "tree
 diagram".</t>
        </dd>
      </dl>
      <section anchor="netconf-terms">
        <name>NETCONF Terms</name>
        <t>The following terms are defined in <xref target="RFC6241"/> and are not redefined
   here:</t>

        <ul spacing="normal">
          <li>
            <t>capability</t>
          </li>
          <li>
            <t>client</t>
          </li>
          <li>
            <t>protocol operation (or simply "operation")</t>
          </li>
          <li>
            <t>server</t>
          </li>
        </ul>
      </section>
      <section anchor="yang-terms">
        <name>YANG Terms</name>
        <t>The following terms are defined in <xref target="RFC7950"/> and are not redefined
   here:</t>
        <ul spacing="normal">
          <li>
            <t>data node</t>
          </li>
          <li>
            <t>module</t>
          </li>
          <li>
            <t>namespace</t>
          </li>
          <li>
            <t>submodule</t>
          </li>
          <li>
            <t>version</t>
          </li>
          <li>
            <t>YANG</t>
          </li>
          <li>
            <t>YIN</t>
          </li>
        </ul>
        <t>Note that the term "module" may be used as a generic term for a YANG
   module or submodule.  When describing properties that are specific to
   submodules, the term "submodule" is used instead.</t>
      </section>
      <section anchor="network-management-datastore-architecture-nmda-terms">
        <name>Network Management Datastore Architecture (NMDA) Terms</name>
        <t>The following terms are defined in <xref target="RFC8342"/> and are not redefined
   here:</t>
        <ul spacing="normal">
          <li>
            <t>configuration</t>
          </li>
          <li>
            <t>conventional configuration datastore</t>
          </li>
          <li>
            <t>datastore</t>
          </li>
          <li>
            <t>operational state</t>
          </li>
          <li>
            <t>operational state datastore</t>
          </li>
        </ul>
      </section>
      <section anchor="requirements-notation">
	
        <name>Requirements Notation</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
      </section>
      <section anchor="yang-data-model-vs-yang-module">
        <name>YANG Data Model versus YANG Module</name>
        <t>Both <xref target="RFC6020"/> and <xref target="RFC7950"/> make a distinction between the following concepts:</t>
        <dl spacing="normal" newline="false">
          <dt>data model:</dt>
          <dd>
            <t>Describes how data is represented and accessed.</t>
            <t>YANG structures data models into modules for ease of use <xref target="RFC8309"/>.</t>
          </dd>
          <dt>module:</dt>
          <dd>
            <t>Defines hierarchies of schema nodes to make a self-contained and compilable block of YANG definitions and inclusions.</t>
            <t>A YANG module is typically a single ".yang" file, starting with a "module" statement.</t>
            <t>A YANG module may include any number of submodules that are stored in separate ".yang" files starting with a "submodule" statement. Regardless of the presence of submodules, the module and its submodules are externally viewed as a single YANG module.</t>
          </dd>
        </dl>

        <t>A YANG data model can consist of:</t>
	<ol>
	  <li>a single YANG module (e.g., <xref target="RFC9129"/>) or</li>
	  <li>multiple YANG modules (e.g., <xref target="RFC7407"/>).</li></ol>
        <t>Note that the term "YANG model" is sometimes used as an abbreviation of "YANG data model". However, that term should be avoided in favor of "YANG data model".
Likewise, "YANG data module" has no meaning and must be avoided.</t>
        <t>Even if a YANG data model is structured as a single YANG module, the term "YANG data model" should be used in the title, abstract, and in the body of the document where the overall design is described. "YANG module" should be used when a specific "*.yang" file is referenced. Likewise, "YANG module" should be used when using terms related to YANG module specifications (e.g., augmentation or deviation). However, when extending the concepts embodied in a YANG module, authors should refer to those as an extension to the "YANG data model".</t>
      </section>
    </section>
    <section anchor="general-documentation-guidelines">
      <name>General Documentation Guidelines</name>
      
<t>YANG modules being considered for publication in an RFC are contained in Internet-Drafts (I-Ds).  Guidelines for authoring an I-D can be found at <xref target="ID-Guidelines"/>.
   These guidelines are not repeated here.</t>
      <t>The following sections <bcp14>MUST</bcp14> be present in an I-D or RFC containing a YANG module:</t>
      <ul spacing="normal">
        <li>
          <t>Narrative sections (<xref target="sec-narrative"/>)</t>
        </li>
        <li>
	  
          <t>A Definitions section(s) (<xref target="sec-def"/>)</t>
        </li>
      </ul>
      <t>Additional YANG-specific considerations <bcp14>MUST</bcp14> be included for the following sections:</t>
      <ul spacing="normal">
        <li>
          <t>Security Considerations (<xref target="sec-sec-cons-sec"/>)</t>
        </li>
        <li>
          <t>IANA Considerations (<xref target="sec-iana-cons"/>)</t>
        </li>
        <li>
          <t>References (<xref target="sec-ref"/>)</t>
        </li>
      </ul>
      <t>There are three usage scenarios for YANG that can appear in an I-D or
   RFC:</t>
      <ul spacing="normal">
        <li>
          <t>normative module or submodule</t>
        </li>
        <li>
          <t>example module or submodule</t>
        </li>
        <li>
          <t>example YANG fragment that is not part of any module or submodule</t>
        </li>
      </ul>
      
      <t>The guidelines in this document refer mainly to a normative module or
   submodule, but they may be applicable to example modules and YANG fragments
   as well.</t>
      <section anchor="module-copyright">
        <name>Module Copyright</name>
        <t>The module "description" statement <bcp14>MUST</bcp14> contain a reference to the
   latest approved IETF Trust Copyright statement, which is available
   at: <eref target="https://trustee.ietf.org/license-info/" brackets="angle"/>.</t>
      </section>
      <section anchor="code-components">
        <name>Code Components</name>
        <t>Each normative YANG module or submodule contained within an I-D or
   RFC is considered to be a code component.  The strings "<tt>&lt;CODE
   BEGINS&gt;</tt>" and "<tt>&lt;CODE ENDS&gt;</tt>" <bcp14>MUST</bcp14> be used to identify each code
   component.</t>
        <t>The "<tt>&lt;CODE BEGINS&gt;</tt>" tag <bcp14>MUST</bcp14> be followed by a string identifying
   the file name specified in <xref section="5.2" sectionFormat="of" target="RFC7950"/>.  The name string
   form that includes the revision date <bcp14>SHOULD</bcp14> be used.  The revision
   date <bcp14>MUST</bcp14> match the date used in the most recent revision of the
   module.</t>
        <t>The following example is for the "2016-03-20" revision of the
   "ietf-foo" module:</t>
        <sourcecode name="" type="yang" markers="true"><![CDATA[
file "ietf-foo@2016-03-20.yang"

    module ietf-foo {
      namespace "urn:ietf:params:xml:ns:yang:ietf-foo";
      prefix "foo";
      organization "...";
      contact "...";
      description "...";
      revision 2016-03-20 {
        description "Latest revision";
        reference "RFC FFFF: Foo Protocol";
      }
      // ... more statements
    }
]]></sourcecode>

        <section anchor="example-modules">
          <name>Example Modules</name>


	  
          <t>Example modules are not code components.  The "<tt>&lt;CODE BEGINS&gt;</tt>"
convention <bcp14>MUST NOT</bcp14> be used for example modules. However, example modules <bcp14>MUST</bcp14> be validated (<xref target="sec-tools"/>).</t>
          <t>An example module <bcp14>SHOULD</bcp14> be named using the term "example", followed
by a hyphen, followed by a descriptive name, e.g., "example-toaster".</t>
          <t>See <xref target="sec-namespace-assignments"/> regarding the namespace guidelines for example
modules.</t>
        </section>
      </section>
      <section anchor="terminology-section">
        <name>Terminology Section</name>
        <t>A terminology section <bcp14>MUST</bcp14> be present if any terms are defined in the
document or if any terms are imported from other documents.</t>
      </section>
      <section anchor="tree-diagrams">
        <name>Tree Diagrams</name>
        <t>YANG tree diagrams provide a concise representation of a YANG module
and <bcp14>SHOULD</bcp14> be included to help readers understand YANG module
structure.  Guidelines on tree diagrams can be found in  <xref section="3" sectionFormat="of" target="RFC8340"/>.
Tree diagrams longer than one page <bcp14>SHOULD</bcp14> be included
	in an appendix, i.e., not in the main body of the document.</t>
	
        <t>If YANG tree diagrams are used, then an informative reference to the
YANG tree diagrams specification <bcp14>MUST</bcp14> be included in the document.
Refer to <xref section="2.2" sectionFormat="of" target="RFC8349"/> for an example of such a reference.</t>
      </section>
      <section anchor="sec-narrative">
	
        <name>Narrative Sections</name>
        <t>The narrative sections <bcp14>MUST</bcp14> include an overview section that describes
the scope and field of application of the data model(s) defined by the
specification and that specifies the relationship (if any) of these
data models to other standards, particularly to standards containing
other YANG data models.  The narrative part <bcp14>SHOULD</bcp14> include one or more
sections to briefly describe the structure of the data models defined in
	the specification.</t>

        <t>If the module (or modules) defined by the specification imports
definitions from other modules (except for those defined in <xref target="RFC7950"/>
or <xref target="RFC9911"/>) or is always implemented in conjunction with other
modules, then those facts <bcp14>MUST</bcp14> be noted in the overview section; any
special interpretations of definitions in other modules <bcp14>MUST</bcp14> be noted
as well.  Refer to <xref section="2.3" sectionFormat="of" target="RFC8349"/> for an example of this
overview section.</t>
        <t>If the document contains major Network Management Datastore Architecture (NMDA) exceptions or includes a temporary non-NMDA module <xref target="RFC8342"/>, then the Introduction
section <bcp14>SHOULD</bcp14> mention this fact with the reasoning that motivated that design.
Refer to <xref target="sec-op-state"/> for more NMDA-related guidance. Specifically, <xref target="sec-4.23.2"/> includes a recommendation for designers to describe and justify any NMDA exceptions in detail as part of the module itself.</t>
        <t>Consistent indentation <bcp14>SHOULD</bcp14> be used for all examples, including
YANG fragments and protocol message instance data.  If line wrapping
is used for formatting purposes, then this <bcp14>SHOULD</bcp14> be indicated per the guidance in <xref target="RFC8792"/>, as shown
in the following example:</t>
        <artwork><![CDATA[
=============== NOTE: '\' line wrapping per RFC 8792 ================

<myleaf xmlns="tag:example.com,2017:example-two">this is a long \
value so the line needs to wrap to stay within 72 characters</myleaf>
]]></artwork>
        <t>Built-in YANG features (e.g., breaking line, "+") <bcp14>SHOULD</bcp14> be used to fit a module into the line limits.
Exceptionally, YANG modules <bcp14>MAY</bcp14> be folded as described in RFC 8792 if and only if built-in YANG features are not sufficient.
A similar approach (e.g., using "--tree-line-length 69" or splitting a tree into subtrees) <bcp14>SHOULD</bcp14> be followed for tree diagrams.</t>
        <section anchor="yang-module-classification">
          <name>YANG Module Classification</name>
          <t>The narrative section <bcp14>SHOULD</bcp14> include a mention of the classification
of a given model. Such a mention is meant to ease positioning the
module in the overall operational ecosystem. Specifically, the following types
from <xref target="RFC8309"/> and <xref target="RFC8969"/> can be used:</t>
          <dl>
            <dt>Service Model:</dt>
            <dd>
              <t>Describes a service and the parameters of the service in a
portable way that can be used uniformly and independent of the
equipment and operating environment.</t>
            </dd>
            <dt/>
            <dd>
              <t>Examples of service models are the L3VPN Service Model (L3SM) <xref target="RFC8299"/> and the L2VPN Service Model (L2SM) <xref target="RFC8466"/>.</t>
            </dd>
            <dt>Network Model:</dt>
            <dd>
              <t>Describes a network-level abstraction (or a subset of aspects of a network infrastructure), including devices and their subsystems, and relevant protocols operating at the link and network layers across multiple devices. This model corresponds to the network configuration model discussed in <xref target="RFC8309"/>.</t>
            </dd>
            <dt/>
            <dd>
              <t>This model can be used by a network operator to allocate resources (e.g., a tunnel resource or a topology resource) for the service or to schedule resources to meet the service requirements defined in a service model.</t>
            </dd>
            <dt/>
            <dd>
              <t>Examples of network models are the L3VPN Network Model (L3NM) <xref target="RFC9182"/> or the L2VPN Network Model (L2NM) <xref target="RFC9291"/>.</t>
            </dd>
            <dt>Device Model:</dt>
            <dd>
              <t>Refers to the Network Element YANG data model described in <xref target="RFC8199"/> or the device configuration model discussed in <xref target="RFC8309"/>.</t>
            </dd>
            <dt/>
            <dd>
              <t>Device models are also used to model a function embedded in a device (e.g., Access Control Lists (ACLs) <xref target="RFC8519"/>).</t>
            </dd>
            <dt/>
            <dd>

              <t>A non-comprehensive list of device models is provided in <xref target="RFC8969" section="A.4.4"/>.</t>
            </dd>
          </dl>
        </section>
      </section>
      <section anchor="sec-def">
        <name>Definitions Section</name>
        <t>This section contains the module(s) defined by the specification.
These modules <bcp14>SHOULD</bcp14> be written using the YANG 1.1 <xref target="RFC7950"/> syntax.
YANG 1.0 <xref target="RFC6020"/> syntax <bcp14>MAY</bcp14> be used if no YANG 1.1 constructs or
semantics are needed in the module.  If any of the imported YANG
modules are written using YANG 1.1, then the module <bcp14>MUST</bcp14> be written
using YANG 1.1.</t>
        <t>A YANG Independent Notation (YIN) syntax version (<xref section="13" sectionFormat="of" target="RFC7950"/>) of the module <bcp14>MAY</bcp14> also be present in the
document.  There <bcp14>MAY</bcp14> also be other types of modules present in the
document, such as Structure of Management Information Version 2
	(SMIv2), which are not affected by these guidelines.</t>

	
        <t>Note that if the module itself is considered normative and not an
example module or example YANG fragment, then all YANG statements
within a YANG module are considered normative.  The use of keywords
defined in <xref target="RFC2119"/> and <xref target="RFC8174"/> apply to YANG "description"
statements in normative modules exactly as they would in any other
normative section.</t>
        <t>Example YANG modules and example YANG fragments <bcp14>MUST NOT</bcp14> contain any
normative text, including any key words from
<xref target="RFC2119"/> and <xref target="RFC8174"/>.</t>
        <t>Consistent indentation and formatting (e.g., folding) <bcp14>SHOULD</bcp14> be used in all YANG
statements within a module.</t>
        <t>See <xref target="sec-usage-guidelines"/> for guidelines on YANG usage.</t>
      </section>
      <section anchor="sec-sec-cons-sec">
        <name>Security Considerations Section</name>
        <t>Each specification that defines one or more modules <bcp14>MUST</bcp14> contain a
   section that discusses security considerations relevant to those
	modules.</t>


        <t>Unless the modules comply with <xref target="RFC8791"/> or define YANG extensions (e.g., <xref target="RFC7952"/>), the security section <bcp14>MUST</bcp14>
   be modeled after the latest approved template
   (available at <eref target="https://wiki.ietf.org/group/ops/yang-security-guidelines" brackets="angle"/>).  <xref target="sec-security-template"/> contains the security considerations
   template.  Authors
   <bcp14>MUST</bcp14> check the web page at the URL listed above in case there is a
   more recent version available.</t>
   <t>In particular:</t>
   
        <ul spacing="normal">
          <li>
            <t>Writable data nodes that could be especially disruptive if abused
 <bcp14>MUST</bcp14> be explicitly listed by name, and the associated security
 risks <bcp14>MUST</bcp14> be explained.</t>
          </li>
          <li>
            <t>Readable data nodes that contain especially sensitive information
 or that raise significant privacy concerns <bcp14>MUST</bcp14> be explicitly
 listed by name, and the reasons for the sensitivity/privacy
 concerns <bcp14>MUST</bcp14> be explained.</t>
          </li>
          <li>
            <t>Operations (i.e., YANG "rpc" statements) that are potentially
 harmful to system behavior or that raise significant privacy
 concerns <bcp14>MUST</bcp14> be explicitly listed by name, and the reasons for
 the sensitivity/privacy concerns <bcp14>MUST</bcp14> be explained.</t>
          </li>
        </ul>
        <t>Documents that exclusively define modules that follow the extension in <xref target="RFC8791"/> are not required to include the security template in <xref target="sec-security-template"/>. Likewise, following the template is not required for modules that define YANG extensions such as <xref target="RFC7952"/>.</t>
        <section anchor="sec-security-template">
          <name>Security Considerations Section Template</name>

          <artwork><![CDATA[
<BEGIN TEMPLATE TEXT>
	  
X.  Security Considerations

This section is modeled after the template described in Section 3.7.1
of [RFC9907].

The "<module-name>" YANG module defines a data model that is 
designed to be accessed via YANG-based management protocols, 
such as the Network Configuration Protocol (NETCONF) [RFC6241] 
and RESTCONF [RFC8040].  These YANG-based management protocols
(1) have to use a secure transport layer (e.g., Secure Shell (SSH)
[RFC4252], TLS [RFC8446], and QUIC [RFC9000]) and (2) have to use
mutual authentication.

The Network Configuration Access Control Model (NACM) [RFC8341]
provides the means to restrict access for particular NETCONF or
RESTCONF users to a preconfigured subset of all available NETCONF or
RESTCONF protocol operations and content.

-- Note: RFC 8341 (or a future RFC that replaces it) MUST be listed
-- as a normative reference.

-- By default, RFC 4252, RFC 6241, RFC 8040, RFC 8446, RFC 9000, and
-- RFC 9907 (or future RFCs that replace any of them) are listed as
-- informative references unless normatively cited in other sections
-- of the document that specifies the YANG module.

-- Writable nodes section:
-- 
-- If the data model contains any writable data nodes (those are all
-- the "config true" nodes), then include the following text:

There are a number of data nodes defined in this YANG module that are
writable/creatable/deletable (i.e., "config true", which is the
default).  All writable data nodes are likely to be sensitive or
vulnerable in some network environments.  Write
operations (e.g., edit-config) and delete operations to these data
nodes without proper protection or authentication can have a negative
effect on network operations.  The following subtrees and data nodes
have particular sensitivities/vulnerabilities:

-- If the data model contains any particularly sensitive data nodes,
-- e.g., ones that are protected by a "nacm:default-deny-write"
-- or a "nacm:default-deny-all" extensions statement, then those
-- subtrees and data nodes must be listed, with an explanation of the
-- associated security risks with a focus on how they can be
-- disruptive if abused.  Otherwise, state:
--
-- "There are no particularly sensitive writable data nodes."

-- Readable nodes section:
--
-- If the data model contains any readable data nodes (i.e., those
-- that are "config false" nodes, but also all other nodes because
-- they can also be read via operations like get or get-config), then
-- include the following text:

Some of the readable data nodes in this YANG module may be considered
sensitive or vulnerable in some network environments.  It is thus
important to control read access (e.g., via get, get-config, or
notification) to these data nodes.  Specifically, the following
subtrees and data nodes have particular sensitivities/
vulnerabilities:

-- You must evaluate whether the data model contains any readable
-- data nodes (those are all the "config false" nodes, but also all
-- other nodes because they can also be read via operations like get
-- or get-config) that are particularly sensitive or vulnerable 
-- (e.g., if they might reveal customer information or violate 
-- personal privacy laws).  Typically, particularly sensitive 
-- readable data nodes are ones that are protected by a
-- "nacm:default-deny-read" or a "nacm:default-deny-all" extensions
-- statement.
--
-- Otherwise, state:
-- "There are no particularly sensitive readable data nodes."

-- RPC/action operations section:
--
-- If the data model contains any RPC or action operations, then
-- include the following text:

Some of the RPC or action operations in this YANG module may be
considered sensitive or vulnerable in some network environments.
It is thus important to control access to these operations.
Specifically, the following operations have particular
sensitivities/ vulnerabilities:

-- If the data model contains any particularly sensitive RPC
-- or action operations, then those operations must be listed
-- here, along with an explanation of the associated specific
-- sensitivity or vulnerability concerns.
--
-- Otherwise, state:
-- "There are no particularly sensitive RPC or action operations."

-- Reusable groupings from other modules section:
-- 
-- If the data model reuses groupings from other modules and
-- the document that specifies these groupings also
-- includes those as data nodes, then add this text as a 
-- reminder of the specific sensitivity or vulnerability of
-- reused nodes.

This YANG module uses groupings from other YANG modules that
define nodes that may be considered sensitive or vulnerable
in network environments.  Refer to the Security Considerations
of <RFC-insert-numbers> for information as to which nodes may
be considered sensitive or vulnerable in network environments.

-- No data nodes section:
-- 
-- If the data model does not define any data nodes (i.e., none
-- of the above sections or readable/writable data nodes or RPCs
-- have been included), then add the following text:

The YANG module defines a set of identities, types, and
groupings.  These nodes are intended to be reused by other YANG
modules.  The module by itself does not expose any data nodes that
are writable, data nodes that contain read-only state, or RPCs.
As such, there are no additional security issues related to 
the YANG module that need to be considered.

Modules that use the groupings that are defined in this document
should identify the corresponding security considerations.  For
example, reusing some of these groupings will expose privacy-related
information (e.g., 'node-example').

<END TEMPLATE TEXT>
]]></artwork>
        </section>
      </section>
      <section anchor="sec-iana-cons">
        <name>IANA Considerations Section</name>
        <t>Each normative YANG module <bcp14>MUST</bcp14> be registered in both the "IETF XML
Registry" group <xref target="RFC3688"/> <xref target="IANA-XML"/> and the "YANG Module Names" registry
<xref target="RFC6020"/> <xref target="IANA-MOD-NAMES"/>. The registration request in the "YANG Module Names" registry
should indicate whether or not the module is IANA-maintained. This applies to new modules and updated
modules. An example of an update registration for the
"ietf-template" module can be found in <xref target="sec-iana"/>.</t>
        <t>Additional IANA considerations applicable to IANA-maintained YANG modules (including instructions to maintain them) are provided in <xref target="sec-iana-mm"/>.</t>
        <section anchor="documents-that-create-a-new-namespace">
          <name>Documents That Create a New Namespace</name>
          <t>If an I-D defines a new namespace that is to be administered by the
IANA, then the document <bcp14>MUST</bcp14> include an IANA Considerations section
that specifies how the namespace is to be administered.</t>
          <t>Specifically, if any YANG module "namespace" statement value contained
in the document is not already registered with IANA, then a new entry
in the "ns" registry within the "IETF XML Registry" registry group <bcp14>MUST</bcp14> be
requested from the IANA.</t>
          <t>A registration template for new YANG modules is provided in <xref target="sec-reg-def-iana"/>.</t>
        </section>
        <section anchor="documents-that-extend-an-existing-namespace">
          <name>Documents That Extend an Existing Namespace</name>
          <t>It is possible to extend an existing namespace using a YANG submodule
that belongs to an existing module already administered by IANA.  In
this case, the document containing the main module <bcp14>MUST</bcp14> be updated to
use the latest revision of the submodule.</t>
        </section>
        <section anchor="registration-templates">
          <name>Registration Templates</name>
          <section anchor="sec-reg-def-iana">
            <name>IANA Template for Documents Defining New YANG Modules</name>
            <t>A registration template for a new module is provided below:</t>

<artwork><![CDATA[
IANA is requested to register the following URI in the "ns"
registry within the "IETF XML Registry" group [RFC3688]:

   URI:
   Registrant Contact:  The IESG
   XML: N/A; the requested URI is an XML namespace.

IANA is requested to register the following YANG module in the "YANG
Module Names" registry [RFC6020] within the "YANG Parameters"
registry group.

   Name:
   Maintained by IANA?  Y/N
   Namespace:
   Prefix:
   Reference:]]></artwork>

          </section>
          <section anchor="iana-template-for-revising-yang-modules">
            <name>IANA Template for Revising YANG Modules</name>
            <t>A registration template for a revised module is provided below:</t>

<artwork><![CDATA[
IANA is requested to update the following registration in the "ns"
registry within the "IETF XML Registry" group [RFC3688] to
reference this document:

   URI:
   Registrant Contact:  The IESG
   XML: N/A; the requested URI is an XML namespace.

IANA is requested to register the following YANG module in the "YANG
Module Names" registry [RFC6020] [RFC9890] within the "YANG Parameters"
registry group.

   Name:
   Maintained by IANA?  Y/N
   Namespace:
   Prefix:
   Reference:]]></artwork>

          </section>
        </section>
      </section>
      <section anchor="sec-ref">
        <name>References Sections</name>
        <t>For every "import" or "include" statement that appears in a module
contained in the specification that identifies a module in a separate
document, a corresponding normative reference to that document <bcp14>MUST</bcp14>
appear in the Normative References section.  The reference <bcp14>MUST</bcp14>
correspond to the specific module version actually used within the
specification.</t>
        <t>For every normative "reference" statement that appears in a module
contained in the specification that identifies a separate document, a
corresponding normative reference to that document <bcp14>SHOULD</bcp14> appear in
the Normative References section.  The reference <bcp14>SHOULD</bcp14> correspond to
the specific document version actually used within the specification.
If the "reference" statement identifies an informative reference that
identifies a separate document, a corresponding informative reference
	to that document <bcp14>MAY</bcp14> appear in the Informative References section.</t>

      </section>
      <section anchor="sec-tools">
        <name>Validation Tools</name>
        <t>All modules need to be validated before submission in an I-D.  The
'pyang' YANG compiler is freely available from GitHub: <eref target="https://github.com/mbj4668/pyang" brackets="angle"/>.</t>
        <t>If the 'pyang' compiler is used to validate a normative module, then
the "--ietf" command-line option <bcp14>MUST</bcp14> be used to identify any IETF
guideline issues.</t>
        <t>If the 'pyang' compiler is used to validate an example module, then
the "--ietf" command-line option <bcp14>MAY</bcp14> be used to identify any IETF
guideline issues.</t>
        <t>To ensure that a module fits into the line limits of an I-D, the command
"pyang -f yang --keep-comments --yang-line-length 69" should be used.</t>
        <t>The 'yanglint' program is also freely available from GitHub: <eref target="https://github.com/CESNET/libyang" brackets="angle"/>.</t>
        <t>This tool can be used to validate "XPath" statements within YANG
modules.</t>
        <t>To check that JSON-encoded examples <xref target="RFC7951"/> comply with the target data models,
programs such as 'yangson' or 'yanglint' should be used. Both programs are freely available from GitHub: <eref target="https://github.com/CZ-NIC/yangson" brackets="angle"/> and <eref target="https://github.com/CESNET/libyang" brackets="angle"/>.</t>
      </section>
      <section anchor="module-extraction-tools">
<name>Module Extraction Tools</name>

        <t>A version of 'rfcstrip' that will extract YANG modules from an I-D or
RFC is freely available at: <eref target="https://github.com/mbj4668/rfcstrip" brackets="angle"/>.</t>
        <t>This tool can be used to verify that the "<tt>&lt;CODE BEGINS&gt;</tt>" and "<tt>&lt;CODE
ENDS&gt;</tt>" tags are used correctly and that the normative YANG modules
can be extracted correctly.</t>
        <t>The 'xym' tool is freely available on GitHub and can be used to
extract YANG modules from a document: <eref target="https://github.com/xym-tool/xym" brackets="angle"/>.</t>
      </section>
      <section anchor="module-usage-examples">
        <name>Module Usage Examples</name>
        <t>Each specification that defines one or more modules <bcp14>SHOULD</bcp14> contain
usage examples, either throughout the document or in an appendix.
This includes example instance document snippets in an appropriate
encoding (e.g., XML and/or JSON) to demonstrate the intended usage of
the YANG module(s).  Examples that are meant to illustrate a valid data instance <bcp14>MUST</bcp14> be validated (<xref target="sec-tools"/>).  Refer to
<xref target="sec-tools"/> for tools that validate YANG modules and examples. If IP addresses/prefixes
are used, then a mix of either IPv4 and IPv6 addresses/prefixes or IPv6
addresses/prefixes exclusively <bcp14>SHOULD</bcp14> be used in the examples.</t>
        <t>For some types (IP addresses, domain names, etc.), the IETF has reserved values for
documentation use. Authors <bcp14>SHOULD</bcp14> use these reserved values in the usage examples if these types are used. Examples of reserved values are listed below:</t>
        <ul spacing="normal">
          <li>
            <t>IPv4 and IPv6 addresses/prefixes reserved for documentation are defined in <xref target="RFC5737"/>, <xref target="RFC3849"/>, and <xref target="RFC9637"/>.</t>
          </li>
          <li>
            <t>The Enterprise Number 32473 reserved for documentation use is defined in <xref target="RFC5612"/>.</t>
          </li>
          <li>
            <t>Autonomous System Numbers (ASNs) reserved for documentation use are defined in <xref target="RFC5398"/>.</t>
          </li>
          <li>
            <t>Reserved domain names for documentation are defined in <xref target="RFC2606"/>.</t>
          </li>
        </ul>
        <t>URI examples <bcp14>SHOULD</bcp14> be prefixed with "example:".</t>
        <t>In order to ease extraction and validation of examples, it is <bcp14>RECOMMENDED</bcp14> to use code markers.</t>
      </section>
    </section>
    <section anchor="sec-usage-guidelines">
      <name>YANG Usage Guidelines</name>

      <t>Modules in IETF Standards Track specifications <bcp14>MUST</bcp14> comply with all
syntactic and semantic requirements of YANG 1.1 <xref target="RFC7950"/>.  See the
exception for YANG 1.0 in <xref target="sec-def"/>.  The guidelines in this
section are intended to supplement the YANG specification <xref target="RFC7950"/>,
which is intended to define a minimum set of conformance
requirements.</t>
      <t>In order to promote interoperability and establish a set of practices
based on previous experience, the following sections establish usage
guidelines for specific YANG constructs.</t>
      <t>Only guidelines that clarify or restrict the minimum conformance
requirements are included here.</t>
      <t>A template for IETF modules is provided in <xref target="tem-ietf"/>.</t>
      <section anchor="sec-module-naming-conventions">
        <name>Module Naming Conventions</name>
        <t>Normative modules contained in Standards Track documents <bcp14>MUST</bcp14> be
named according to the guidelines in the IANA Considerations section
of <xref target="RFC6020"/>.</t>
        <t>A distinctive word or abbreviation (e.g., protocol name or working
group abbreviation) <bcp14>SHOULD</bcp14> be used in the module name.  If new
definitions are being defined to extend one or more existing modules,
then the same word or abbreviation should be reused, instead of
creating a new one.</t>
        <t>All published module names <bcp14>MUST</bcp14> be unique.  For a YANG module
published in an RFC, this uniqueness is guaranteed by IANA (<xref section="14" sectionFormat="of" target="RFC6020"/>).  For
unpublished modules, the authors need to check that no other work in
progress is using the same module name.</t>
        <t>Example modules are non-normative and <bcp14>SHOULD</bcp14> be named with the prefix
"example-".</t>
        <t>It is suggested that a stable module name prefix be selected that represents the
entire organization.  All normative YANG modules published by the
IETF <bcp14>MUST</bcp14> begin with the prefix "ietf-". All IANA-maintained YANG modules <bcp14>MUST</bcp14> begin with the prefix "iana-".  Another standards
organization, such as the IEEE, might use the prefix "ieee-" for all
YANG modules.</t>
        <t>Once a module name is published, it <bcp14>MUST NOT</bcp14> be reused, even if the
RFC containing the module is reclassified to "Historic" status.  A
module name cannot be changed in YANG, and this would be treated as a
new module, not a name change.</t>
      </section>
      <section anchor="prefixes">
        <name>Prefixes</name>
        <t>All YANG definitions are scoped by the module containing the
definition being referenced. This allows the same name to be used
in multiple modules, even if the names are not unique. In the example
below, the identifier "foo" is used in all three modules:</t>

        <sourcecode name="" type="yang"><![CDATA[
    module example-foo {
      namespace "tag:example.com,2017:example-foo";
      prefix f;

      container foo;
    }

    module example-bar {
      namespace "tag:example.com,2017:example-bar";
      prefix b;

      typedef foo { type uint32; }
    }

    module example-one {
      namespace "tag:example.com,2017:example-one";
      prefix one;
      import example-foo { prefix f; }
      import example-bar { prefix b; }

      augment "/f:foo" {
        leaf foo { type b:foo; }
      }
    }]]></sourcecode>
        <t>YANG defines the following rules for prefix usage:</t>
        <ul spacing="normal">
          <li>
            <t>Prefixes are never used for built-in data types and YANG keywords.</t>
          </li>
          <li>
            <t>A prefix <bcp14>MUST</bcp14> be used for any external statement (i.e., a statement defined with the YANG "extension" statement).</t>
          </li>
          <li>
            <t>The proper module prefix <bcp14>MUST</bcp14> be used for all identifiers imported from other modules.</t>
          </li>
          <li>
            <t>The proper module prefix <bcp14>MUST</bcp14> be used for all identifiers included from a submodule.</t>
          </li>
        </ul>
        <t>The following guidelines apply to prefix usage of the current (local)
module:</t>
        <ul spacing="normal">
          <li>
            <t>The local module prefix <bcp14>SHOULD</bcp14> be used instead of no prefix in all path expressions.</t>
          </li>
          <li>
            <t>The local module prefix <bcp14>MUST</bcp14> be used instead of no prefix in all "default" statements for an "identityref" or "instance-identifier" data type.</t>
          </li>
          <li>
            <t>The local module prefix <bcp14>MAY</bcp14> be used for references to typedefs, groupings, extensions, features, and identities defined in the module.</t>
          </li>
        </ul>
        <t>Consistent with <xref section="7.1.4" sectionFormat="of" target="RFC7950"/>, the prefix defined by a module
<bcp14>SHOULD</bcp14> be used when the module is imported, unless there is a conflict.</t>
        <t>Prefix values <bcp14>SHOULD</bcp14> be short but meaningful to the intended user. Prefix values <bcp14>SHOULD NOT</bcp14> conflict with known modules that have been previously published.</t>
        <t>For convenience, prefix values of example modules <bcp14>SHOULD</bcp14> be prefixed with "ex"
or similar patterns. In doing so, readers of example modules or tree diagrams
that mix both example and standard modules can easily identify example parts.</t>
      </section>
      <section anchor="ids">
        <name>Identifiers</name>
        <t>All YANG identifiers in published modules <bcp14>MUST</bcp14> be between 1 and 64 characters in length.  These include any construct
specified as an "identifier-arg-str" token in the ABNF in <xref section="14" sectionFormat="of" target="RFC7950"/>.</t>
        <section anchor="sec-id-naming">
          <name>Identifier Naming Conventions</name>
          <t>Identifiers <bcp14>SHOULD</bcp14> follow a consistent naming pattern throughout the
module.  Only lowercase letters, numbers, and dashes <bcp14>SHOULD</bcp14> be used
in identifier names.  Uppercase characters, the period character, and
the underscore character <bcp14>MAY</bcp14> be used if the identifier represents a
well-known value that uses these characters.  YANG does not permit
any other characters in YANG identifiers.</t>
          <t>Identifiers <bcp14>SHOULD</bcp14> include complete words and/or well-known acronyms
or abbreviations.  Child nodes within a container or list <bcp14>SHOULD NOT</bcp14>
replicate the parent identifier.  YANG identifiers are hierarchical
and are only meant to be unique within the set of sibling nodes
defined in the same module namespace.</t>
          <t>List identifiers <bcp14>SHOULD</bcp14> be singular with the surrounding container name plural.
Similarly, "leaf-list" identifiers <bcp14>SHOULD</bcp14> be singular.</t>
          <t>It is permissible to use common identifiers such as "name" or "id" in
data definition statements, especially if these data nodes share a
common data type.</t>
          <t>Identifiers <bcp14>SHOULD NOT</bcp14> carry any special semantics that identify data
modeling properties. Only YANG statements and YANG extension
statements are designed to convey machine-readable data modeling
properties.  For example, naming an object "config" or "state" does
not change whether it is configuration data or state data.  Only
defined YANG statements or YANG "extension" statements can be used to
assign semantics in a machine-readable format in YANG.</t>
        </section>
      </section>
      <section anchor="defaults">
        <name>Defaults</name>
        <t>In general, it is suggested that substatements containing very common
default values <bcp14>SHOULD NOT</bcp14> be present.  The substatements listed in <xref target="stat-def"/>
are commonly used with the default value, which would make the module
difficult to read if used everywhere they are allowed.</t>
        <table anchor="stat-def">
          <name>Statement Defaults</name>
          <thead>
            <tr>
              <th align="left">Statement</th>
              <th align="left">Default Value</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">config</td>
              <td align="left">true</td>
            </tr>
            <tr>
              <td align="left">mandatory</td>
              <td align="left">false</td>
            </tr>
            <tr>
              <td align="left">max-elements</td>
              <td align="left">unbounded</td>
            </tr>
            <tr>
              <td align="left">min-elements</td>
              <td align="left">0</td>
            </tr>
            <tr>
              <td align="left">ordered-by</td>
              <td align="left">system</td>
            </tr>
            <tr>
              <td align="left">status</td>
              <td align="left">current</td>
            </tr>
            <tr>
              <td align="left">yin-element</td>
              <td align="left">false</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="conditional-statements">
        <name>Conditional Statements</name>
        <t>A module may be conceptually partitioned in several ways using the
"if-feature" and/or "when" statements.</t>
        <t>Data model designers need to carefully consider all modularity
aspects, including the use of YANG conditional statements.</t>
        <t>If a data definition is optional, depending on server support for a
NETCONF or RESTCONF protocol capability, then a YANG "feature"
statement <bcp14>SHOULD</bcp14> be defined.  The defined "feature" statement <bcp14>SHOULD</bcp14>
then be used in the conditional "if-feature" statement referencing
the optional data definition.</t>
        <t>If any notification data, or any data definition, for a non-
configuration data node is not mandatory, then the server may or may
not be required to return an instance of this data node.  If any
conditional requirements exist for returning the data node in a
notification payload or retrieval request, they <bcp14>MUST</bcp14> be documented
somewhere.  For example, a "when" or "if-feature" statement could
apply to the data node or the conditional requirements could be
explained in a "description" statement within the data node or one of
its ancestors (if any).</t>
        <t>If any "if-feature" statements apply to a list node, then the same
"if-feature" statements <bcp14>MUST</bcp14> apply to any key leaf nodes for the
list.  There <bcp14>MUST NOT</bcp14> be any "if-feature" statements applied to any
key leafs that do not also apply to the parent list node.</t>
        <t>There <bcp14>SHOULD NOT</bcp14> be any "when" statements applied to a key leaf node.
It is possible that a "when" statement for an ancestor node of a key
leaf will have the exact node-set result as the key leaf.  In such a
case, the "when" statement for the key leaf is redundant and <bcp14>SHOULD</bcp14>
be avoided.</t>
        <t>Some modules use a "case + when" construct but provide duplicated information (e.g., the "when" statements are constraining a single case in the choice as shown in the example below).
Such constructs with duplicated information <bcp14>SHOULD NOT</bcp14> be used.</t>
        <sourcecode name="" type="yang"><![CDATA[
    leaf type {
      type enumeration {
        enum a;
        enum b;
        enum c;
      }
      mandatory true;
    }
    choice type-choice {
      case b {
        container type-b {
          when "../type = 'b'";
          leaf foo {
            type string;
          }
        }
      }
      case c {
        container type-c {
          when "../type = 'c'";
          leaf bar {
            mandatory true;
            type string;
          }
        }
      }
    }]]></sourcecode>
        <t>The following example removes the duplicated information:</t>
        <sourcecode name="" type="yang"><![CDATA[
    leaf type {
      type enumeration {
        enum a;
        enum b;
        enum c;
      }
      mandatory true;
    }
    container type-b {
      when "../type = 'b'";
      leaf foo {
        type string;
      }
    }
    container type-c {
      when "../type = 'c'";
      leaf bar {
        mandatory true;
        type string;
      }
    }]]></sourcecode>
        <t>Note that the use of "case + when" is still useful in cases where complementary modeling constraints should be expressed. See the example provided below:</t>
        <sourcecode name="" type="yang"><![CDATA[
    leaf type {
      type enumeration {
        enum a;
        enum b;
        enum c;
      }
    }
    choice second-type {
      mandatory true;
      case foo {
        container foo {
          presence "When present, indicates type foo";
          leaf foo-attribute {
            type string;
          }
        }
      }
      case b {
        container bar {
          when "../type = 'a' or ../type = 'b'";
          presence "When present, indicates type bar";
          leaf bar-attribute {
            type string;
          }
        }
      }
      case c {
        container baz {
          when "../type = 'c'";
          leaf baz-attribute {
            mandatory true;
            type string;
          }
        }
      }
    }]]></sourcecode>
        <t><xref section="8.1" sectionFormat="of" target="RFC7950"/> includes provisions for defining constraints
on state data and specifies that a constraint must be true in a valid state data tree.
However, <xref section="5.3" sectionFormat="of" target="RFC8342"/> softens that behavior by allowing semantic
constraints to be violated under some circumstances to help to detect anomalies.
Relaxing validation constraints on state data is meant to reveal deviations of
the observed behavior versus intended behavior of a managed entity and hopefully
trigger corrective actions by a management system. From that perspective,
it is <bcp14>RECOMMENDED</bcp14> to avoid defining constraints on state data that would hinder
the detection by a management system of abnormal behaviors of a managed entity.</t>
      </section>
      <section anchor="xpath-usage">
        <name>XPath Usage</name>
        <t>This section describes guidelines for using the XML Path Language
(XPath) <xref target="W3C.REC-xpath"/> within YANG modules.</t>
        <section anchor="xpath-evaluation-contexts">
          <name>XPath Evaluation Contexts</name>
          <t>YANG defines five separate contexts for evaluation of "XPath"
statements:</t>
          <ol spacing="normal" type="1"><li>
              <t>The "running" datastore: collection of all YANG configuration
data nodes.  The document root is the conceptual container (e.g.,
"config" in the "edit-config" operation), which is the parent of
all top-level data definition statements with a "config"
statement value of "true".</t>
            </li>
            <li>
              <t>State data + the "running" datastore: collection of all YANG data
nodes.  The document root is the conceptual container, parent of
all top-level data definition statements.</t>
            </li>
            <li>
              <t>Notification: an event notification document.  The document root
is the notification element.</t>
            </li>
            <li>
              <t>RPC Input: The document root is the conceptual "input" node,
which is the parent of all RPC input parameter definitions.</t>
            </li>
            <li>
              <t>RPC Output: The document root is the conceptual "output" node,
which is the parent of all RPC output parameter definitions.</t>
            </li>
          </ol>
          <t>Note that these XPath contexts cannot be mixed.  For example, a
"when" statement in a notification context cannot reference
configuration data.</t>
          <sourcecode name="" type="yang"><![CDATA[
    notification foo {
      leaf mtu {
        // NOT okay because when-stmt context is this notification
        when "/if:interfaces/if:interface[name='eth0']";
        type leafref {
          // Okay because path-stmt has a different context
          path "/if:interfaces/if:interface/if:mtu";
        }
      }
    }]]></sourcecode>
          <t>It is especially important to consider the XPath evaluation context
for XPath expressions defined in groupings.  An XPath expression
defined in a grouping may not be portable, meaning it cannot be used
in multiple contexts and produce proper results.</t>
          <t>If the XPath expressions defined in a grouping are intended for a
particular context, then this context <bcp14>SHOULD</bcp14> be identified in the
"description" statement for the grouping.</t>
        </section>
        <section anchor="function-library">
          <name>Function Library</name>
          <t>The "position" and "last" functions <bcp14>SHOULD NOT</bcp14> be used.  This applies
to implicit use of the "position" function as well (e.g.,
<tt>'//chapter[42]'</tt>).  A server is only required to maintain the relative
XML document order of all instances of a particular user-ordered list
or leaf-list.  The "position" and "last" functions <bcp14>MAY</bcp14> be used if
they are evaluated in a context where the context node is a user-ordered "list" or "leaf-list".</t>
          <t>The "id" function <bcp14>SHOULD NOT</bcp14> be used.  The "ID" attribute is not
present in YANG documents, so this function has no meaning.  The
XPath execution environment <bcp14>SHOULD</bcp14> return an empty string for this function.</t>
          <t>The "namespace-uri" and "name" functions <bcp14>SHOULD NOT</bcp14> be used.
Expanded names in XPath are different than YANG.  A specific
canonical representation of a YANG-expanded name does not exist.</t>
          <t>The "lang" function <bcp14>SHOULD NOT</bcp14> be used.  This function does not apply
to YANG because there is no "lang" attribute set with the document.
The XPath execution environment <bcp14>SHOULD</bcp14> return "false" for this function.</t>
          <t>The "local-name", "namespace-uri", "name", "string", and "number"
functions <bcp14>SHOULD NOT</bcp14> be used if the argument is a node-set.  If so,
the function result will be determined by the document order of the
node-set.  Since this order can be different on each server, the
function results can also be different.  Any function call that
implicitly converts a node-set to a string will also have this issue.</t>
          <t>The "local-name" function <bcp14>SHOULD NOT</bcp14> be used to reference local names
outside of the YANG module that defines the "must" or "when" statement
containing the "local-name" function.  Example of a "local-name"
function that should not be used:</t>

          <sourcecode name="" type="yang"><![CDATA[
   /*[local-name()='foo']]]></sourcecode>

          <t>The "derived-from-or-self" function <bcp14>SHOULD</bcp14> be used instead of an
equality expression for identityref values.  This allows the
identities to be conceptually augmented.</t>
          <t>Example:</t>

          <sourcecode name="" type="yang"><![CDATA[
 // assume "ex" is the prefix of the module where the identity
 // name-format-null is defined

 // do not use
 when "md-name-format = 'name-format-null'";

 // this is preferred
 when "derived-from-or-self(md-name-format, 'ex:name-format-null')";]]></sourcecode>

        </section>
        <section anchor="axes">
          <name>Axes</name>
          <t>The "attribute" and "namespace" axes are not supported in YANG and
   <bcp14>MAY</bcp14> be empty in a NETCONF or RESTCONF server implementation.</t>
          <t>The "preceding" and "following" axes <bcp14>SHOULD NOT</bcp14> be used.  These
   constructs rely on XML document order within a NETCONF or RESTCONF
   server configuration database, which may not be supported
   consistently or produce reliable results across implementations.
   Predicate expressions based on static node properties (e.g., element
   name or value, and "ancestor" or "descendant" axes) <bcp14>SHOULD</bcp14> be used
   instead.  The "preceding" and "following" axes <bcp14>MAY</bcp14> be used if
   document order is not relevant to the outcome of the expression
   (e.g., check for global uniqueness of a parameter value).</t>
          <t>The "preceding-sibling" and "following-sibling" axes <bcp14>SHOULD NOT</bcp14> be
   used; however, they <bcp14>MAY</bcp14> be used if document order is not relevant to
   the outcome of the expression.</t>
          <t>A server is only required to maintain the relative XML document order
   of all instances of a particular user-ordered list or leaf-list.  The
   "preceding-sibling" and "following-sibling" axes <bcp14>MAY</bcp14> be used if they
   are evaluated in a context where the context node is a user-ordered
   "list" or "leaf-list".</t>
        </section>
        <section anchor="types">
          <name>Types</name>
          <t>Data nodes that use the "int64" and "uint64" built-in type <bcp14>SHOULD NOT</bcp14>
   be used within numeric or boolean expressions.  There are boundary
   conditions in which the translation from the YANG 64-bit type to an
   XPath number can cause incorrect results.  Specifically, an XPath
   "double" precision floating-point number cannot represent very large
   positive or negative 64-bit numbers because it only provides a total
   precision of 53 bits.  The "int64" and "uint64" data types <bcp14>MAY</bcp14> be
   used in numeric expressions if the value can be represented with no
   more than 53 bits of precision.</t>
          <t>Data modelers need to be careful not to confuse the YANG value space
   and the XPath value space.  The data types are not the same in both,
   and conversion between YANG and XPath data types <bcp14>SHOULD</bcp14> be considered
   carefully.</t>
          <t>Explicit XPath data type conversions <bcp14>MAY</bcp14> be used (e.g., "string",
   "boolean", or "number" functions), instead of implicit XPath data
   type conversions.</t>
          <t>XPath expressions that contain a literal value representing a YANG
   identity <bcp14>SHOULD</bcp14> always include the declared prefix of the module
   where the identity is defined.</t>
          <t>XPath expressions for "when" statements <bcp14>SHOULD NOT</bcp14> reference the
   context node or any descendant nodes of the context node.  They <bcp14>MAY</bcp14>
   reference descendant nodes if the "when" statement is contained
   within an "augment" statement and the referenced nodes are not
   defined within the "augment" statement.</t>
          <t>Example:</t>
          <sourcecode name="" type="yang"><![CDATA[
augment "/rt:active-route/rt:input/rt:destination-address" {
  when "derived-from-or-self(rt:address-family, "
     + "'v4ur:ipv4-unicast')" {
    description
      "This augment is valid only for IPv4 unicast.";
  }
  // nodes defined here within the augment-stmt
  // cannot be referenced in the when-stmt
}]]></sourcecode>
        </section>
        <section anchor="wildcards">
          <name>Wildcards</name>
          <t>It is possible to construct XPath expressions that will evaluate
   differently when combined with several modules within a server
   implementation rather than when evaluated within the single module.
   This is due to augmenting nodes from other modules.</t>
          <t>Wildcard expansion is done within a server against all the nodes from
   all namespaces, so it is possible for a "must" or "when" statement
   that uses the <tt>'*'</tt> operator to always evaluate to false if processed
   within a single YANG module.  In such cases, the "description"
   statement <bcp14>SHOULD</bcp14> clarify that augmenting objects are expected to
   match the wildcard expansion.</t>
          <sourcecode name="" type="yang"><![CDATA[
   when /foo/services/*/active {
     description
       "No services directly defined in this module.
        Matches objects that have augmented the services container.";
   }]]></sourcecode>
        </section>
        <section anchor="boolean-expressions">
          <name>Boolean Expressions</name>
          <t>The YANG "must" and "when" statements use an XPath boolean expression
   to define the test condition for the statement.  It is important to
   specify these expressions in a way that will not cause inadvertent
   changes in the result if the objects referenced in the expression are
   updated in future revisions of the module.</t>
          <t>For example, the leaf "foo2" must exist if the leaf "foo1" is equal
   to "one" or "three":</t>
          <sourcecode name="" type="yang"><![CDATA[
     leaf foo1 {
       type enumeration {
         enum one;
         enum two;
         enum three;
       }
     }

     leaf foo2 {
       // INCORRECT
       must "/f:foo1 != 'two'";
       type string;
     }
     leaf foo2 {
       // CORRECT
       must "/f:foo1 = 'one' or /f:foo1 = 'three'";
       type string;
     }]]></sourcecode>

          <t>In the next revision of the module, leaf "foo1" is extended with a
   new enum named "four":</t>

          <sourcecode name="" type="yang"><![CDATA[
     leaf foo1 {
       type enumeration {
         enum one;
         enum two;
         enum three;
         enum four;
       }
     }]]></sourcecode>

          <t>Now the first XPath expression will allow the enum "four" to be
   accepted in addition to the "one" and "three" enum values.</t>
        </section>
      </section>
      <section anchor="yang-definition-lifecycle-management">
        <name>YANG Definition Lifecycle Management</name>
        <t>The YANG status statement <bcp14>MUST</bcp14> be present within a definition if its
   value is "deprecated" or "obsolete".  The status <bcp14>SHOULD NOT</bcp14> be
   changed from "current" directly to "obsolete".  An object <bcp14>SHOULD</bcp14> be
   available for at least one year after the publication date with a "deprecated" status before it
   is changed to "obsolete".</t>
        <t>The module or submodule name <bcp14>MUST NOT</bcp14> be changed once the document
   containing the module or submodule is published.</t>
        <t>The module namespace URI value <bcp14>MUST NOT</bcp14> be changed once the document
   containing the module is published.</t>
        <t>The revision date substatement within the "import" statement <bcp14>SHOULD</bcp14> be
   present if any groupings are used from the external module.</t>
        <t>The revision date substatement within the "include" statement <bcp14>SHOULD</bcp14> be
   present if any groupings are used from the external submodule.</t>
        <t>If an "import" statement is for a module from a stable source (e.g., an
   RFC for an IETF module), then a reference-stmt <bcp14>SHOULD</bcp14> be present
   within an "import" statement.</t>
        <sourcecode name="" type="yang"><![CDATA[
     import ietf-yang-types {
        prefix yang;
        reference "RFC 9911: Common YANG Data Types";
     }]]></sourcecode>
        <t>If submodules are used, then the document containing the main module
   <bcp14>MUST</bcp14> be updated so that the main module revision date is equal to or
   more recent than the revision date of any submodule that is (directly
   or indirectly) included by the main module.</t>
        <t>Definitions for future use <bcp14>SHOULD NOT</bcp14> be specified in a module.  Do
   not specify placeholder objects like the "reserved" example below:</t>
        <sourcecode name="" type="yang"><![CDATA[
    leaf reserved {
      type string;
      description
        "This object has no purpose at this time, but a future
         revision of this module might define a purpose
         for this object.";
    }]]></sourcecode>
      </section>
      <section anchor="module-header-meta-and-revision-statements">
        <name>Module Header, Meta, and Revision Statements</name>
        <t>For published modules, the namespace <bcp14>MUST</bcp14> be a globally unique URI,
   as defined in <xref target="RFC3986"/>.  This value is usually assigned by the IANA.</t>
        <t>The "organization" statement <bcp14>MUST</bcp14> be present.  If the module is
   contained in a document intended for IETF Standards Track status,
   then the organization <bcp14>SHOULD</bcp14> be the IETF working group (WG) chartered
   to write the document. Exceptions include (but are not limited to): example modules, IANA-maintained YANG modules, or modules contained in AD-sponsored documents. For other standards organizations, a similar
   approach is also suggested.</t>
        <t>The "contact" statement <bcp14>MUST</bcp14> be present.  If the module is contained
   in a document intended for Standards Track status, then the WG web
   and mailing information <bcp14>SHOULD</bcp14> be present, and the main document
   author or editor contact information <bcp14>SHOULD</bcp14> be present.  If
   additional authors or editors exist, their contact information <bcp14>MAY</bcp14> be
   present.  There is no need to include the contact information for WG
Chairs.</t>

        <t>The "description" statement <bcp14>MUST</bcp14> be present.  For modules published
   within IETF documents, the appropriate IETF Trust Copyright text <bcp14>MUST</bcp14>
   be present, as described in <xref target="module-copyright"/>, and <bcp14>MUST</bcp14> contain the following statement:</t>

   <blockquote><t>All revisions of IETF and IANA published modules can be found at the "YANG Parameters" registry group: <eref target="https://www.iana.org/assignments/yang-parameters" brackets="angle"/>.</t></blockquote>

        <t>If the module relies on information contained in other documents,
   which are not the same documents implied by the "import" statements
   present in the module, then these documents <bcp14>MUST</bcp14> be identified in the
   "reference" statement.</t>
        <t>A "revision" statement <bcp14>MUST</bcp14> be present for each published version of
   the module.  The "revision" statement <bcp14>MUST</bcp14> have a "reference"
   substatement.  It <bcp14>MUST</bcp14> identify the published document that contains
   the module.  Modules are often extracted from their original
   documents, and it is useful for developers and operators to know how
   to find the original source document in a consistent manner.  The
   "revision" statement <bcp14>MAY</bcp14> have a "description" substatement. For convenience,
   the description text of a new published revision may summarize any changes made
   to a module compared to the previous published revision. Typically, that list
   is a YANG-specific subset of the summary of changes listing any changes made from the RFC
   being updated or obsoleted as per <xref target="ID-Guidelines"/>.</t>
        <t>The following example shows the "revision" statement for a published
   YANG module:</t>
        <sourcecode name="" type="yang"><![CDATA[
   revision 2010-09-24 {
     description
       "Initial revision.";
   reference
     "RFC 6021: Common YANG Data Types";
   }]]></sourcecode>
	

        <t>The following example shows the "revision" statements for a published
   YANG module that updates a published module. The new "revision" statement
   summarizes the changes compared to the previous published revision.</t>

        <sourcecode name="" type="yang"><![CDATA[
  revision 2013-07-15 {
    description
      "This revision adds the following new data types:
       - yang:yang-identifier
       - yang:hex-string
       - yang:uuid
       - yang:dotted-quad";
     reference
       "RFC 6991: Common YANG Data Types";
   }

   revision 2010-09-24 {
     description
       "Initial revision.";
   reference
     "RFC 6021: Common YANG Data Types";
   }]]></sourcecode>

        <t>For an unpublished module, a complete history of each unpublished
   module revision is not required.  That is, within a sequence of draft
   versions, only the most recent revision need be recorded in the
   module.  Do not remove or reuse a "revision" statement for a published
   module.  A new revision date is not required unless the module
   contents have changed.  If the module contents have changed, then the
   revision date of that new module version <bcp14>MUST</bcp14> be updated to a date
   later than that of the previous version.</t>
        <t>The following example shows the "revision" statements for an
   unpublished update to a published YANG module. The latest "revision" statement
   of the unpublished module summarizes the changes compared to the previous revision.</t>
        <sourcecode name="" type="yang"><![CDATA[
  revision 2025-12-22 {
    description
      "This revision adds the following new data types:
       - yang:date
       - yang:date-no-zone
       - yang:time
       - yang:time-no-zone
       - yang:hours32
       - yang:minutes32
       - yang:seconds32
       - yang:centiseconds32
       - yang:milliseconds32
       - yang:microseconds32
       - yang:microseconds64
       - yang:nanoseconds32
       - yang:nanoseconds64
       - yang:language-tag
       The yang-identifier definition has been aligned with YANG
       1.1 and types representing time support the representation
       of leap seconds.  The representation of time zone offsets
       has been aligned with RFC 9557.  Several description and
       pattern statements have been improved.";
    reference
      "RFC 9911: Common YANG Data Types";
   }
     
  revision 2013-07-15 {
    description
      "This revision adds the following new data types:
       - yang:yang-identifier
       - yang:hex-string
       - yang:uuid
       - yang:dotted-quad";
     reference
       "RFC 6991: Common YANG Data Types";
   }

   revision 2010-09-24 {
     description
       "Initial revision.";
   reference
     "RFC 6021: Common YANG Data Types";
   }]]></sourcecode>
      </section>

      <section anchor="sec-namespace-assignments">
        <name>Namespace Assignments</name>
        <t>It is <bcp14>RECOMMENDED</bcp14> that only valid YANG modules be included in
   documents, whether or not the modules are published yet.  This
   allows:</t>
        <ul spacing="normal">
          <li>
            <t>the module to compile correctly instead of generating disruptive fatal errors.</t>
          </li>
          <li>
            <t>early implementors to use the modules without picking a random value for the XML namespace.</t>
          </li>
          <li>
            <t>early interoperability testing since independent implementations will use the same XML namespace value.</t>
          </li>
        </ul>
        <t>Until a URI is assigned by the IANA, a proposed namespace URI <bcp14>MUST</bcp14> be
   provided for the "namespace" statement in a YANG module.  A value
   <bcp14>SHOULD</bcp14> be selected that is not likely to collide with other YANG
   namespaces.  Standard module names, prefixes, and URI strings already
   listed in the "YANG Module Names" registry group <bcp14>MUST NOT</bcp14> be used.</t>
        <t>A standard "namespace" statement value <bcp14>SHOULD</bcp14> have the following form:</t>
        <sourcecode type="pseudocode"><![CDATA[
    <URN prefix string>:<module-name>]]></sourcecode>

        <t>The following URN prefix string <bcp14>SHOULD</bcp14> be used for published and
   unpublished YANG modules:</t>
        <sourcecode type="pseudocode"><![CDATA[
    urn:ietf:params:xml:ns:yang]]></sourcecode>

        <t>The following example URNs would be valid "namespace" statement values
   for Standards Track modules:</t>
        <sourcecode type="pseudocode"><![CDATA[
    urn:ietf:params:xml:ns:yang:ietf-netconf-partial-lock]]></sourcecode>
        <sourcecode type="pseudocode"><![CDATA[
    urn:ietf:params:xml:ns:yang:ietf-netconf-state]]></sourcecode>
        <sourcecode type="pseudocode"><![CDATA[
    urn:ietf:params:xml:ns:yang:ietf-netconf]]></sourcecode>

        <t>Note that a different URN prefix string <bcp14>SHOULD</bcp14> be used for modules
   that are not Standards Track.  The string <bcp14>SHOULD</bcp14> be selected
   according to the guidelines in <xref section="5.3" sectionFormat="of" target="RFC7950"/>.</t>
        <t>The following URIs exemplify what might be used by modules that are
   not Standards Track.  Note that the domain "example.com" <bcp14>SHOULD</bcp14> be
   used by example modules in I-Ds from the IETF Stream.  These URIs are not intended to
   be dereferenced.  They are used for module namespace identification
   only.</t>
        <t>Example URIs using URLs per <xref target="RFC3986"/>:</t>
        <sourcecode type="pseudocode"><![CDATA[
    https://example.com/ns/example-interfaces]]></sourcecode>
        <sourcecode type="pseudocode"><![CDATA[
    https://example.com/ns/example-system]]></sourcecode>

        <t>Example URIs using tags per <xref target="RFC4151"/>:</t>
        <sourcecode type="pseudocode"><![CDATA[
    tag:example.com,2017:example-interfaces]]></sourcecode>
        <sourcecode type="pseudocode"><![CDATA[
    tag:example.com,2017:example-system]]></sourcecode>

      </section>
      <section anchor="top-level-data-definitions">
        <name>Top-Level Data Definitions</name>
        <t>The top-level data organization <bcp14>SHOULD</bcp14> be considered carefully, in
   advance.  Data model designers need to consider how the functionality
   for a given protocol or protocol family will grow over time.</t>
        <t>The separation of configuration data and operational state <bcp14>SHOULD</bcp14> be
   considered carefully.  It is sometimes useful to define separate top-
   level containers for configuration and non-configuration data.  For
   some existing top-level data nodes, configuration data was not in
   scope, so only one container representing operational state was
   created.  Refer to NMDA <xref target="RFC8342"/> for details.</t>
        <t>The number of top-level data nodes within a module <bcp14>SHOULD</bcp14> be
   minimized.  It is often useful to retrieve related information within
   a single subtree.  If data is too distributed, it becomes difficult
   to retrieve all at once.</t>
        <t>The names and data organization <bcp14>SHOULD</bcp14> reflect persistent
   information, such as the name of a protocol.  The name of the working
   group <bcp14>SHOULD NOT</bcp14> be used because this may change over time.</t>
        <t>A mandatory database data definition is defined as a node that a
   client must provide for the database to be valid.  The server is not
   required to provide a value.</t>
        <t>Top-level database data definitions <bcp14>MUST NOT</bcp14> be mandatory.  If a
   mandatory node appears at the top level, it will immediately cause
   the database to be invalid.  This can occur when the server boots or
   when a module is loaded dynamically at runtime.</t>
      </section>
      <section anchor="data-types">
        <name>Data Types</name>
        <t>Selection of an appropriate data type (i.e., built-in type, existing
   derived type, or new derived type) is very subjective; therefore, few
   requirements can be specified on that subject.</t>
        <t>Data model designers <bcp14>SHOULD</bcp14> use the most appropriate built-in data
   type for the particular application.</t>
        <t>The signed numeric data types (i.e., "int8", "int16", "int32", and
   "int64") <bcp14>SHOULD NOT</bcp14> be used unless negative values are allowed for
   the desired semantics.</t>
        <section anchor="sec-fve">
          <name>Fixed-Value Extensibility</name>
          <t>If the set of values is fixed and the data type contents are
   controlled by a single naming authority (e.g., IANA), then an "enumeration" data
   type <bcp14>SHOULD</bcp14> be used.</t>
          <sourcecode name="" type="yang"><![CDATA[
    leaf foo {
      type enumeration {
        enum one;
        enum two;
      }
    }]]></sourcecode>
          <t>If distributed extensibility or hierarchical organization of enumerated values is required, then the
   "identityref" data type <bcp14>SHOULD</bcp14> be used instead of an "enumeration" or
   other built-in type.</t>
          <sourcecode name="" type="yang"><![CDATA[
    identity foo-type {
      description "Base for the extensible type";
    }

    identity one {
      base f:foo-type;
    }

    identity two {
      base f:foo-type;
    }

    leaf foo {
      type identityref {
        base f:foo-type;
      }
    }]]></sourcecode>
          <t>Note that any module can declare an identity with base "foo-type"
   that is valid for the "foo" leaf.  Identityref values are considered
   to be qualified names.</t>
        </section>
        <section anchor="patterns-and-ranges">
          <name>Patterns and Ranges</name>
          <t>For string data types, if a machine-readable pattern can be defined
   for the desired semantics, then one or more pattern statements <bcp14>SHOULD</bcp14>
   be present.  A single-quoted string <bcp14>SHOULD</bcp14> be used to specify the
   pattern, since a double-quoted string can modify the content.  If the
   patterns used in a type definition have known limitations such as
   false negative or false positive matches, then these limitations
   <bcp14>SHOULD</bcp14> be documented within the typedef or data definition.</t>
          <t>The following typedef from <xref target="RFC9911"/> demonstrates the proper use of
   the "pattern" statement:</t>
          <sourcecode name="" type="yang"><![CDATA[
    typedef ipv6-address-no-zone {
      type inet:ipv6-address {
        pattern '[0-9a-fA-F:\.]*';
      }
      ...
    }]]></sourcecode>
          <t>For string data types, if the length of the string is required to be
   bounded in all implementations, then a "length" statement <bcp14>MUST</bcp14> be
   present.</t>
          <t>The following typedef from <xref target="RFC9911"/> demonstrates the proper use of
   the "length" statement:</t>
          <sourcecode name="" type="yang"><![CDATA[
    typedef yang-identifier {
      type string {
        length "1..max";
        pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*';
        pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*';
      }
      ...
    }]]></sourcecode>
          <t>For numeric data types, if the values allowed by the intended
   semantics are different than those allowed by the unbounded intrinsic
   data type (e.g., "int32"), then a range statement <bcp14>SHOULD</bcp14> be present.</t>
          <t>The following typedef from <xref target="RFC9911"/> demonstrates the proper use of
   the "range" statement:</t>
          <sourcecode name="" type="yang"><![CDATA[
    typedef dscp {
      type uint8 {
        range "0..63";
      }
      ...
    }]]></sourcecode>
        </section>
        <section anchor="enumerations-and-bits">
          <name>Enumerations and Bits</name>
          <t>For "enumeration" or "bits" data types, the semantics for each "enum"
   or "bit" <bcp14>SHOULD</bcp14> be documented.  A separate "description" statement
   (within each "enum" or "bit" statement) <bcp14>SHOULD</bcp14> be present.</t>
          <sourcecode name="" type="yang"><![CDATA[
    leaf foo {
      // INCORRECT
      type enumeration {
        enum one;
        enum two;
      }
      description
        "The foo enum...
         one: The first enum
         two: The second enum";
    }
    leaf foo {
      // CORRECT
      type enumeration {
        enum one {
          description "The first enum";
        }
        enum two {
          description "The second enum";
        }
      }
      description
        "The foo enum...  ";
    }]]></sourcecode>
        </section>
        <section anchor="union-types">
          <name>Union Types</name>
          <t>The YANG "union" type is evaluated by testing a value against each
   member type in the union.  The first type definition that accepts a
   value as valid is the member type used.  In general, member types
   <bcp14>SHOULD</bcp14> be ordered from most restrictive to least restrictive types.</t>
          <t>In the following example, the "enumeration" type will never be
   matched because the preceding "string" type will match everything.</t>
          <t>Incorrect:</t>
          <sourcecode name="" type="yang"><![CDATA[
   type union {
     type string;
     type enumeration {
       enum up;
       enum down;
     }
   }]]></sourcecode>
          <t>Correct:</t>
          <sourcecode name="" type="yang"><![CDATA[
   type union {
     type enumeration {
       enum up;
       enum down;
     }
     type string;
   }]]></sourcecode>
          <t>It is possible for different member types to match, depending on the
   input encoding format.  In XML, all values are passed as string
   nodes; but in JSON, there are different value types for numbers,
   booleans, and strings.</t>
          <t>In the following example, a JSON numeric value will always be matched
   by the "int32" type, but in XML the string value representing a
   number will be matched by the "string" type.  The second version will
   match the "int32" member type no matter how the input is encoded.</t>
          <t>Incorrect:</t>
          <sourcecode name="" type="yang"><![CDATA[
   type union {
     type string;
     type int32;
   }]]></sourcecode>
          <t>Correct:</t>
          <sourcecode name="" type="yang"><![CDATA[
   type union {
     type int32;
     type string;
   }]]></sourcecode>
        </section>
        <section anchor="empty-and-boolean">
          <name>Empty and Boolean</name>
          <t>YANG provides an "empty" data type, which has one value (i.e.,
   present).  The default is "not present", which is not actually a
   value.  When used within a list key, only one value can (and must)
   exist for this key leaf.  The type "empty" <bcp14>SHOULD NOT</bcp14> be used for a
   key leaf since it is pointless.</t>
          <t>There is really no difference between a leaf of type "empty" and a
   leaf-list of type "empty".  Both are limited to one instance.  The
   type "empty" <bcp14>SHOULD NOT</bcp14> be used for a leaf-list.</t>
          <t>The advantage of using type "empty" instead of type "boolean" is that
   the default (not present) does not take up any bytes in a
   representation.  The disadvantage is that the client may not be sure
   if an empty leaf is missing because it was filtered somehow or not
   implemented.  The client may not have a complete and accurate schema
   for the data returned by the server and may not be aware of the
   missing leaf.</t>
          <t>The YANG "boolean" data type provides two values ("true" and
   "false").  When used within a list key, two entries can exist for
   this key leaf.  Default values are ignored for key leafs, but a
   default statement is often used for plain boolean leafs.  The
   advantage of the "boolean" type is that the leaf or leaf-list has a
   clear representation for both values.  The default value is usually
   not returned unless explicitly requested by the client, so no bytes
   are used in a typical representation.</t>
          <t>In general, the "boolean" data type <bcp14>SHOULD</bcp14> be used instead of the
   "empty" data type, as shown in the example below:</t>
          <t>Incorrect:</t>
          <sourcecode name="" type="yang"><![CDATA[
   leaf flag1 {
     type empty;
   }]]></sourcecode>
          <t>Correct:</t>
          <sourcecode name="" type="yang"><![CDATA[
   leaf flag2 {
     type boolean;
     default false;
   }]]></sourcecode>
        </section>
      </section>
      <section anchor="reusable-type-definitions">
        <name>Reusable Type Definitions</name>
        <t>If an appropriate derived type exists in any standard module, such as
   <xref target="RFC9911"/>, then it <bcp14>SHOULD</bcp14> be used instead of defining a new derived
   type.</t>
        <t>If an appropriate units identifier can be associated with the desired
   semantics, then a units statement <bcp14>SHOULD</bcp14> be present.</t>
        <t>If an appropriate default value can be associated with the desired
   semantics, then a default statement <bcp14>SHOULD</bcp14> be present.</t>
        <t>If a significant number of derived types are defined, and it is
   anticipated that these data types will be reused by multiple modules,
   then these derived types <bcp14>SHOULD</bcp14> be contained in a separate module or
   submodule to allow easier reuse without unnecessary coupling.</t>
        <t>The "description" statement <bcp14>MUST</bcp14> be present.</t>
        <t>If the type definition semantics are defined in an external document
   (other than another YANG module indicated by an "import" statement),
   then the "reference" statement <bcp14>MUST</bcp14> be present.</t>
      </section>
      <section anchor="reusable-groupings">
        <name>Reusable Groupings</name>
        <t>A reusable grouping is a YANG grouping that can be imported by
   another module and is intended for use by other modules.  This is not
   the same as a grouping that is used within the module in which it is
   defined, but it happens to be exportable to another module because it
   is defined at the top level of the YANG module.</t>
        <t>The following guidelines apply to reusable groupings, in order to
   make them as robust as possible:</t>
        <ul spacing="normal">
          <li>
            <t>Clearly identify the purpose of the grouping in the "description" statement.</t>
          </li>
          <li>
            <t>There are five different XPath contexts in YANG (rpc/input, rpc/output, notification, "config true" data nodes, and all data
 nodes).  Clearly identify which XPath contexts are applicable or
 excluded for the grouping.</t>
          </li>
          <li>
            <t>Do not reference data outside the grouping in any "path", "must", or "when" statements.</t>
          </li>
          <li>
            <t>Do not include a "default" substatement on a leaf or choice unless the value applies on all possible contexts.</t>
          </li>
          <li>
            <t>Do not include a "config" substatement on a data node unless the value applies on all possible contexts.</t>
          </li>
          <li>
            <t>Clearly identify any external dependencies in the grouping "description" statement, such as nodes referenced by an absolute path from a "path", "must", or "when" statement.</t>
          </li>
        </ul>
      </section>
      <section anchor="sec-data-def">
        <name>Data Definitions</name>
        <t>The "description" statement <bcp14>MUST</bcp14> be present in the following YANG
   statements:</t>
        <ul spacing="normal">
          <li>
            <t>anydata</t>
          </li>
          <li>
            <t>anyxml</t>
          </li>
          <li>
            <t>augment</t>
          </li>
          <li>
            <t>choice</t>
          </li>
          <li>
            <t>container</t>
          </li>
          <li>
            <t>extension</t>
          </li>
          <li>
            <t>feature</t>
          </li>
          <li>
            <t>grouping</t>
          </li>
          <li>
            <t>identity</t>
          </li>
          <li>
            <t>leaf</t>
          </li>
          <li>
            <t>leaf-list</t>
          </li>
          <li>
            <t>list</t>
          </li>
          <li>
            <t>notification</t>
          </li>
          <li>
            <t>rpc</t>
          </li>
          <li>
            <t>typedef</t>
          </li>
        </ul>
        <t>If the data definition semantics are defined in an external document,
   (other than another YANG module indicated by an "import" statement),
   then a "reference" statement <bcp14>MUST</bcp14> be present.</t>
        <t>The "anyxml" construct may be useful to represent an HTML banner
   containing markup elements, such as <tt>"&lt;b&gt;"</tt> and <tt>"&lt;/b&gt;"</tt>, and <bcp14>MAY</bcp14> be used
   in such cases.  However, this construct <bcp14>SHOULD NOT</bcp14> be used if other
   YANG data node types can be used instead to represent the desired
   syntax and semantics.</t>
        <t>It has been found that the "anyxml" statement is not implemented
   consistently across all servers.  It is possible that mixed-mode XML
   will not be supported or that configuration anyxml nodes will not be
   supported.</t>
        <t>If there are referential integrity constraints associated with the
   desired semantics that can be represented with XPath, then one or
   more "must" statements <bcp14>SHOULD</bcp14> be present.</t>
        <t>For list and leaf-list data definitions, if the number of possible
   instances is required to be bounded for all implementations, then the
   max-elements statements <bcp14>SHOULD</bcp14> be present.</t>
        <t>If any "must" or "when" statements are used within the data
   definition, then the data definition "description" statement <bcp14>SHOULD</bcp14>
   describe the purpose of each one.</t>
        <t>The "choice" statement is allowed to be directly present within a
   "case" statement in YANG 1.1.  This needs to be considered carefully.
   Consider simply including the nested "choice" as additional "case"
   statements within the parent "choice" statement.  Note that the
   "mandatory" and "default" statements within a nested "choice"
   statement only apply if the "case" containing the nested "choice"
   statement is first selected.</t>
        <t>If a list defines any key leafs, then these leafs <bcp14>SHOULD</bcp14> be defined
   in order, as the first child nodes within the list.  The key leafs
   <bcp14>MAY</bcp14> be in a different order in some cases, e.g., they are defined in
   a grouping, and not inline in the list statement.</t>
        <section anchor="non-presence-containers">
          <name>Non-Presence Containers</name>
          <t>A non-presence container is used to organize data into specific
   subtrees.  It is not intended to have semantics within the data model
   beyond this purpose, although YANG allows it (e.g., a "must"
   statement within the non-presence container).</t>
          <t>Example using container wrappers:</t>
          <sourcecode name="" type="yang"><![CDATA[
    container top {
       container foos {
          list foo { ... }
       }
       container bars {
          list bar { ... }
       }
    }]]></sourcecode>
          <t>Example without container wrappers:</t>
          <sourcecode name="" type="yang"><![CDATA[
    container top {
       list foo { ... }
       list bar { ... }
    }]]></sourcecode>
          <t>Use of non-presence containers to organize data is a subjective
   matter similar to use of subdirectories in a file system.  Although
   these containers do not have any semantics, they can impact protocol
   operations for the descendant data nodes within a non-presence
   container, so use of these containers <bcp14>SHOULD</bcp14> be considered carefully.</t>
          <t>The NETCONF and RESTCONF protocols do not currently support the
   ability to delete all list (or leaf-list) entries at once.  This
   deficiency is sometimes avoided by use of a parent container (i.e.,
   deleting the container also removes all child entries).</t>
        </section>
        <section anchor="top-level-data-nodes">
          <name>Top-Level Data Nodes</name>
          <t>Use of top-level objects needs to be considered carefully:</t>
          <ul spacing="normal">
            <li>
              <t>top-level siblings are not ordered</t>
            </li>
            <li>
              <t>top-level siblings are not static and depend on the modules that are loaded</t>
            </li>
            <li>
              <t>for subtree filtering, retrieval of a top-level leaf-list will be treated as a content-match node for all top-level-siblings</t>
            </li>
            <li>
              <t>a top-level list with many instances may impact performance</t>
            </li>
          </ul>
        </section>
      </section>
      <section anchor="operation-definitions">
        <name>Operation Definitions</name>
        <t>If the operation semantics are defined in an external document (other
   than another YANG module indicated by an "import" statement), then a
   "reference" statement <bcp14>MUST</bcp14> be present.</t>
        <t>If the operation impacts system behavior in some way, it <bcp14>SHOULD</bcp14> be
   mentioned in the "description" statement.</t>
        <t>If the operation is potentially harmful to system behavior in some
   way, it <bcp14>MUST</bcp14> be mentioned in the Security Considerations section of
   the document.</t>
      </section>
      <section anchor="notification-definitions">
        <name>Notification Definitions</name>
        <t>The "description" statement <bcp14>MUST</bcp14> be present.</t>
        <t>If the notification semantics are defined in an external document
   (other than another YANG module indicated by an "import" statement),
   then a "reference" statement <bcp14>MUST</bcp14> be present.</t>
        <t>If the notification refers to a specific resource instance, then this
   instance <bcp14>SHOULD</bcp14> be identified in the notification data.  This is
   usually done by including "leafref" leaf nodes with the key leaf
   values for the resource instance.  For example:</t>
        <sourcecode name="" type="yang"><![CDATA[
  notification interface-up {
    description "Sent when an interface is activated.";
    leaf name {
      type leafref {
        path "/if:interfaces/if:interface/if:name";
      }
    }
  }]]></sourcecode>
        <t>Note that there are no formal YANG statements to identify any data
   node resources associated with a notification.  The "description"
   statement for the notification <bcp14>SHOULD</bcp14> specify if and how the
   notification identifies any data node resources associated with the
   specific event.</t>
      </section>
      <section anchor="feature-definitions">
        <name>Feature Definitions</name>
        <t>The YANG "feature" statement is used to define a label for a set of
   optional functionality within a module.  The "if-feature" statement
   is used in the YANG statements associated with a feature.  The
   description-stmt within a feature-stmt <bcp14>MUST</bcp14> specify any interactions
   with other features.</t>
        <t>The set of YANG features defined in a module should be considered
   carefully.  Very fine granular features increase interoperability
   complexity and should be avoided.  A likely misuse of the feature
   mechanism is the tagging of individual leafs (e.g., counters) with
   separate features.</t>
        <t>If there is a large set of objects associated with a YANG feature,
   then consider moving those objects to a separate module instead of
   using a YANG feature.  Note that the set of features within a module
   is easily discovered by the reader, but the set of related modules
   within the entire YANG library is not as easy to identify.  Module
   names with a common prefix can help readers identify the set of
   related modules, but this assumes the reader will have discovered and
   installed all the relevant modules.</t>
        <t>Another consideration for deciding whether to create a new module or
   add a YANG feature is the stability of the module in question.  It
   may be desirable to have a stable base module that is not changed
   frequently.  If new functionality is placed in a separate module,
   then the base module does not need to be republished.  If it is
   designed as a YANG feature, then the module will need to be
   republished.</t>
        <t>If one feature requires implementation of another feature, then an
   "if-feature" statement <bcp14>SHOULD</bcp14> be used in the dependent "feature"
   statement.</t>
        <t>For example, feature2 requires implementation of feature1:</t>
        <sourcecode name="" type="yang"><![CDATA[
   feature feature1 {
     description "Some protocol feature";
   }

   feature feature2 {
     if-feature "feature1";
     description "Another protocol feature";
   }]]></sourcecode>

      </section>
      <section anchor="yang-data-node-constraints">
        <name>YANG Data Node Constraints</name>
        <section anchor="controlling-quantity">
          <name>Controlling Quantity</name>
          <t>The "min-elements" and "max-elements" statements can be used to
   control how many list or leaf-list instances are required for a
   particular data node.  YANG constraint statements <bcp14>SHOULD</bcp14> be used to
   identify conditions that apply to all implementations of the data
   model.  If platform-specific limitations (e.g., the "max-elements"
   supported for a particular list) are relevant to operations, then a
   data model definition statement (e.g., "max-ports" leaf) <bcp14>SHOULD</bcp14> be
   used to identify the limit.</t>
        </section>
        <section anchor="must-versus-when">
          <name>"must" versus "when"</name>
          <t>"must" and "when" YANG statements are used to provide cross-object
   referential tests.  They have very different behavior.  The "when"
   statement causes data node instances to be silently deleted as soon
   as the condition becomes false.  A false "when" statement is not
   considered to be an error.</t>
          <t>The "when" statement <bcp14>SHOULD</bcp14> be used together with "augment" or "uses"
   statements to achieve conditional model composition.  The condition
   <bcp14>SHOULD</bcp14> be based on static properties of the augmented entry (e.g.,
   list key leafs).</t>
          <t>The "must" statement causes a datastore validation error if the
   condition is false.  This statement <bcp14>SHOULD</bcp14> be used for enforcing
   parameter value restrictions that involve more than one data node
   (e.g., end-time parameter must be after the start-time parameter).</t>
        </section>
      </section>
      <section anchor="augment-statements">
        <name>"augment" Statements</name>
        <t>The YANG "augment" statement is used to define a set of data
   definition statements that will be added as child nodes of a target
   data node.  The module namespace for these data nodes will be the
   augmenting module, not the augmented module.</t>
        <t>A top-level "augment" statement <bcp14>SHOULD NOT</bcp14> be used if the target data
   node is in the same module or submodule as the evaluated "augment"
   statement.  The data definition statements <bcp14>SHOULD</bcp14> be added inline
   instead.</t>
        <section anchor="conditional-augment-statements">
          <name>Conditional Augment Statements</name>
          <t>The "augment" statement is often used together with the "when"
   statement and/or "if-feature" statement to make the augmentation
   conditional on some portion of the data model.</t>
          <t>The following example from <xref target="RFC8343"/> shows how a conditional
   container called "ethernet" is added to the "interface" list only for
   entries of the type "ethernetCsmacd".</t>
          <sourcecode name="" type="yang"><![CDATA[
     augment "/if:interfaces/if:interface" {
         when "if:type = 'ianaift:ethernetCsmacd'";

         container ethernet {
             leaf duplex {
                 ...
             }
         }
     }]]></sourcecode>
        </section>
        <section anchor="conditionally-mandatory-data-definition-statements">
          <name>Conditionally Mandatory Data Definition Statements</name>
          <t>YANG has very specific rules about how configuration data can be
   updated in new releases of a module.  These rules allow an "old
   client" to continue interoperating with a "new server".</t>
          <t>If data nodes are added to an existing entry, the old client <bcp14>MUST NOT</bcp14>
   be required to provide any mandatory parameters that were not in the
   original module definition.</t>
          <t>It is possible to add conditional "augment" statements such that the
   old client would not know about the new condition and would not
   specify the new condition.  The conditional "augment" statement can
   contain mandatory objects only if the condition is false, unless
   explicitly requested by the client.</t>
          <t>Only a conditional "augment" statement that uses the "when" statement
   form of a condition can be used in this manner.  The YANG features
   enabled on the server cannot be controlled by the client in any way,
   so it is not safe to add mandatory augmenting data nodes based on the
   "if-feature" statement.</t>
          <t>The XPath "when" statement condition <bcp14>MUST NOT</bcp14> reference data outside
   of the target data node because the client does not have any control
   over this external data.</t>
          <t>In the following sample, it is okay to augment the "interface"
   entry with "mandatory-leaf" because the augmentation depends on
   support for "some-new-iftype".  The old client does not know about
   this type, so it would never select this type; therefore, it would
   not add a mandatory data node.</t>
          <sourcecode name="" type="yang"><![CDATA[
  module example-module {

    yang-version 1.1;
    namespace "tag:example.com,2017:example-module";
    prefix mymod;

    import iana-if-type { prefix iana; }
    import ietf-interfaces { prefix if; }

    identity some-new-iftype {
      base iana:iana-interface-type;
    }

    augment "/if:interfaces/if:interface" {
      when "if:type = 'mymod:some-new-iftype'";

      leaf mandatory-leaf {
        type string;
        mandatory true;
      }
    }
  }]]></sourcecode>
          <t>Note that this practice is safe only for creating data resources.  It
   is not safe for replacing or modifying resources if the client does
   not know about the new condition.  The YANG data model <bcp14>MUST</bcp14> be
   packaged in a way that requires the client to be aware of the
   mandatory data nodes if it is aware of the condition for this data.
   In the example above, the "some-new-iftype" identity is defined in
   the same module as the "mandatory-leaf" data definition statement.</t>
          <t>This practice is not safe for identities defined in a common module
   such as "iana-if-type" because the client is not required to know
   about "my-module" just because it knows about the "iana-if-type"
   module.</t>
        </section>
      </section>
      <section anchor="deviation-statements">
        <name>Deviation Statements</name>
        <t>Per <xref section="7.20.3" sectionFormat="of" target="RFC7950"/>, the YANG "deviation" statement is not
   allowed to appear in IETF YANG modules, but it can be useful for
   documenting server capabilities.  Deviation statements are not
   reusable and typically not shared across all platforms.</t>
        <t>There are several reasons that deviations might be needed in an
   implementation, e.g., an object cannot be supported on all platforms,
   or feature delivery is done in multiple development phases.
   Deviation statements can also be used to add annotations to a module,
   which does not affect the conformance requirements for the module.</t>
        <t>It is suggested that deviation statements be defined in separate
   modules from regular YANG definitions.  This allows the deviations to
   be platform specific and/or temporary.</t>
        <t>The order that deviation statements are evaluated can affect the
   result.  Therefore, multiple deviation statements in the same module,
   for the same target object, <bcp14>SHOULD NOT</bcp14> be used.</t>
        <t>The "max-elements" statement is intended to describe an architectural
   limit to the number of list entries.  It is not intended to describe
   platform limitations.  It is better to use a "deviation" statement
   for the platforms that have a hard resource limit.</t>
        <t>Example documenting platform resource limits:</t>

<t>Wrong: (max-elements in the list itself)</t>
        <sourcecode name="" type="yang"><![CDATA[
     container backups {
       list backup {
         ...
         max-elements 10;
         ...
       }
     }]]></sourcecode>

<t>Correct: (max-elements in a deviation)</t>
        <sourcecode name="" type="yang"><![CDATA[
     deviation /bk:backups/bk:backup {
       deviate add {
         max-elements 10;
       }
     }]]></sourcecode>
      </section>
      <section anchor="extension-statements">
        <name>Extension Statements</name>
        <t>The YANG "extension" statement is used to specify external
   definitions.  This appears in the YANG syntax as an
   "unknown-statement".  Usage of "extension" statements in a published
   module needs to be considered carefully.</t>
        <t>The following guidelines apply to the usage of YANG extensions:</t>
        <ul spacing="normal">
          <li>
            <t>The semantics of the extension <bcp14>MUST NOT</bcp14> contradict any YANG
 statements.  Extensions can add semantics not covered by the
 normal YANG statements.</t>
          </li>
          <li>
            <t>The module containing the "extension" statement <bcp14>MUST</bcp14> clearly
 identify the conformance requirements for the extension.  It
 should be clear whether all implementations of the YANG module
 containing the extension need to also implement the extension.  If
 not, identify what conditions apply that would require
 implementation of the extension.</t>
          </li>
          <li>
            <t>The extension <bcp14>MUST</bcp14> clearly identify where it can be used within
 other YANG statements.</t>
          </li>
          <li>
            <t>The extension <bcp14>MUST</bcp14> clearly identify if YANG statements or other
 extensions are allowed or required within the extension as
 substatements.</t>
          </li>
        </ul>
      </section>
      <section anchor="data-correlation">
        <name>Data Correlation</name>
        <t>Data can be correlated in various ways, using common data types,
   common data naming, and common data organization.  There are several
   ways to extend the functionality of a module, based on the degree of
   coupling between the old and new functionality:</t>
        <dl>
          <dt>inline:</dt>
          <dd>
            <t>update the module with new protocol-accessible objects.
 The naming and data organization of the original objects is used.
 The new objects are in the original module namespace.</t>
          </dd>
          <dt>augment:</dt>
          <dd>
            <t>create a new module with new protocol-accessible objects
 that augment the original data structure.  The naming and data
 organization of the original objects is used.  The new objects are
 in the new module namespace.</t>
          </dd>
          <dt>mirror:</dt>
          <dd>
            <t>create new objects in a new module or the original module,
 except use a new naming scheme and data location.  The naming can
 be coupled in different ways.  Tight coupling is achieved with a
 "leafref" data type, with the "require-instance" substatement set
 to "true".  This method <bcp14>SHOULD</bcp14> be used.</t>
          </dd>
        </dl>
        <t>If the new data instances are not limited to the values in use in the
   original data structure, then the "require-instance" substatement
   <bcp14>MUST</bcp14> be set to "false".  Loose coupling is achieved by using key
   leafs with the same data type as the original data structure.  This
   has the same semantics as setting the "require-instance" substatement
   to "false".</t>
        <t>The relationship between configuration and operational state has been
   clarified in NMDA <xref target="RFC8342"/>.</t>
        <section anchor="use-of-leafref-for-key-correlation">
          <name>Use of "leafref" for Key Correlation</name>
          <t>Sometimes it is not practical to augment a data structure.  For
   example, the correlated data could have different keys or contain
   mandatory nodes.</t>
          <t>The following example shows the use of the "leafref" data type for
   data correlation purposes:</t>
          <t>Not preferred:</t>
          <sourcecode name="" type="yang"><![CDATA[
   list foo {
      key name;
      leaf name {
         type string;
      }
      ...
   }

   list foo-addon {
      key name;
      config false;
      leaf name {
         type string;
      }
      ...
   }]]></sourcecode>
          <t>Preferred:</t>
          <sourcecode name="" type="yang"><![CDATA[
   list foo {
      key name;
      leaf name {
         type string;
      }
      ...
   }

   list foo-addon {
      key name;
      config false;
      leaf name {
         type leafref {
            path "/foo/name";
            require-instance false;
         }
      }
      leaf addon {
         type string;
         mandatory true;
      }
   }]]></sourcecode>
        </section>
      </section>
      <section anchor="sec-op-state">
        <name>Operational State</name>
        <t>The modeling of operational state with YANG has been refined over
   time.  At first, only data that has a "config" statement value of
   "false" was considered to be operational state.  This data was not
   considered to be part of any datastore, which made the YANG XPath
   definition much more complicated.</t>
        <t>Operational state is now modeled using YANG according to the NMDA
   <xref target="RFC8342"/> and conceptually contained in the operational state
   datastore, which also includes the operational values of
   configuration data.  There is no longer any need to duplicate data
   structures to provide separate configuration and operational state
   sections.</t>
        <t>This section describes some data modeling issues related to
   operational state and guidelines for transitioning YANG data model
   design to be NMDA compatible.</t>
        <section anchor="combining-operational-state-and-configuration-data">
          <name>Combining Operational State and Configuration Data</name>
          <t>If possible, operational state <bcp14>SHOULD</bcp14> be combined with its associated
   configuration data.  This prevents duplication of key leafs and
   ancestor nodes.  It also prevents race conditions for retrieval of
   dynamic entries and allows configuration and operational state to be
   retrieved together with minimal message overhead.</t>
          <sourcecode name="" type="yang"><![CDATA[
   container foo {
     ...
     // contains "config true" and "config false" nodes that have
     // no corresponding "config true" object (e.g., counters)
   }]]></sourcecode>
        </section>
        <section anchor="sec-4.23.2">
          <name>Representing Operational Values of Configuration Data</name>
          <t>If possible, the same data type <bcp14>SHOULD</bcp14> be used to represent the
   configured value and the operational value, for a given leaf or leaf-
   list object.</t>
          <t>Sometimes the configured value set is different than the operational
   value set for that object, for example, the "admin-status" and
   "oper-status" leafs in <xref target="RFC8343"/>.  In this case, a separate object
   <bcp14>MAY</bcp14> be used to represent the configured and operational values.</t>
          <t>Sometimes the list keys are not identical for configuration data and
   the corresponding operational state.  In this case, separate lists
   <bcp14>MAY</bcp14> be used to represent the configured and operational values.</t>
          <t>If it is not possible to combine configuration and operational state,
   then the keys used to represent list entries <bcp14>SHOULD</bcp14> be the same type.
   The "leafref" data type <bcp14>SHOULD</bcp14> be used in operational state for key
   leafs that have corresponding configuration instances.  The
   "require-instance" statement <bcp14>MAY</bcp14> be set to "false" (in YANG 1.1
   modules only) to indicate instances are allowed in the operational
   state that do not exist in the associated configuration data.</t>
          <t>The need to replicate objects or define different operational state
   objects depends on the data model.  It is not possible to define one
   approach that will be optimal for all data models.</t>
          <t>Designers <bcp14>SHOULD</bcp14> describe and justify any NMDA exceptions in detail,
   such as the use of separate subtrees and/or separate leafs.  The
   "description" statements for both the configuration and the
   operational state <bcp14>SHOULD</bcp14> be used for this purpose.</t>
        </section>
        <section anchor="nmda-transition-guidelines">
          <name>NMDA Transition Guidelines</name>
          <t>YANG modules <bcp14>SHOULD</bcp14> be designed with the assumption that they will be
   used on servers supporting the operational state datastore.  With
   this in mind, YANG modules <bcp14>SHOULD</bcp14> define "config false" nodes
   wherever they make sense to the data model.  "Config false" nodes
   <bcp14>SHOULD NOT</bcp14> be defined to provide the operational value for
   configuration nodes, except when the value space of a configured and
   operational value may differ, in which case a distinct "config false"
   node <bcp14>SHOULD</bcp14> be defined to hold the operational value for the
   configured node.</t>
          <t>The following guidelines are meant to help modelers develop YANG
   modules that will maximize the utility of the module with both current
   and new implementations.</t>
          <t>New modules and modules that are not concerned with the operational
   state of configuration information <bcp14>SHOULD</bcp14> immediately be structured
   to be NMDA compatible, as described in <xref target="combining-operational-state-and-configuration-data"/>.  This
   transition <bcp14>MAY</bcp14> be deferred if the module does not contain any
   configuration datastore objects.</t>
          <t>The remaining are options that <bcp14>MAY</bcp14> be followed during the time that
   NMDA mechanisms are being defined.</t>
          <ol group="bar" spacing="normal" type="(%c)"><li>
              <t>Modules that require immediate support for the NMDA features
   <bcp14>SHOULD</bcp14> be structured for NMDA.  A temporary non-NMDA version of
   this type of module <bcp14>MAY</bcp14> exist, as either an existing module or a
   module created by hand or with suitable tools that mirror the
   current modeling strategies.  Both the NMDA and the non-NMDA
   modules <bcp14>SHOULD</bcp14> be published in the same document, with NMDA
   modules in the document main body and the non-NMDA modules in a
   non-normative appendix.  The use of the non-NMDA module will
   allow temporary bridging of the time period until NMDA
   implementations are available.</t>
            </li>
            <li>
              <t>For published modules, the module should be republished with an
   NMDA-compatible structure, deprecating non-NMDA constructs.  For
   example, the "ietf-interfaces" module in <xref target="RFC7223"/> has been
   restructured as an NMDA-compatible module in <xref target="RFC8343"/> (which obsoletes <xref target="RFC7223"/>).  The
   "/interfaces-state" hierarchy has been marked with "status
   deprecated".  Modules that mark their "/foo-state" hierarchy with
   "status deprecated" will allow NMDA-capable implementations to
   avoid the cost of duplicating the state nodes, while enabling
   non-NMDA-capable implementations to utilize them for access to
   the operational values.</t>
            </li>
            <li>
              <t>For modules that augment modules that have not been structured
   with the NMDA, the modeler will have to consider the structure
   of the base module and the guidelines listed above.  Where
   possible, such modules should move to new revisions of the base
   module that are NMDA compatible.  When that is not possible,
   augmenting "state" containers <bcp14>SHOULD</bcp14> be avoided, with the
   expectation that the base module will be re-released with the
   state containers marked as "deprecated".  It is <bcp14>RECOMMENDED</bcp14> to
   augment only the "/foo" hierarchy of the base module.  Where this
   recommendation cannot be followed, any new "state" elements
   <bcp14>SHOULD</bcp14> be included in their own module.</t>
            </li>
          </ol>
          <section anchor="temporary-non-nmda-modules">
            <name>Temporary Non-NMDA Modules</name>
            <t>A temporary non-NMDA module allows a non-NMDA-aware client to access
   operational state from an NMDA-compliant server.  It contains the
   top-level "config false" data nodes that would have been defined in a
   legacy YANG module (before NMDA).</t>
            <t>A server that needs to support both NMDA and non-NMDA clients can
   advertise both the new NMDA module and the temporary non-NMDA module.
   A non-NMDA client can use separate "foo" and "foo-state" subtrees,
   except the "foo-state" subtree is located in a different (temporary)
   module.  The NMDA module can be used by a non-NMDA client to access
   the conventional configuration datastores and the deprecated <tt>&lt;get&gt;</tt>
   operation to access nested "config false" data nodes.</t>
            <t>To create the temporary non-NMDA module from an NMDA module, the
   following steps can be taken:</t>
            <ul spacing="normal">
              <li>
                <t>Change the module name by appending "-state" to the original module name.</t>
              </li>
              <li>
                <t>Change the namespace by appending "-state" to the original namespace value.</t>
              </li>
              <li>
                <t>Change the prefix by appending "-s" to the original prefix value.</t>
              </li>
              <li>
                <t>Add an import to the original module (e.g., for typedef definitions).</t>
              </li>
              <li>
                <t>Retain or create only the top-level nodes that have a "config"
 statement value "false".  These subtrees represent "config false"
 data nodes that were combined into the configuration subtree;
 therefore, they are not available to non-NMDA-aware clients.  Set
 the "status" statement to "deprecated" for each new node.</t>
              </li>
              <li>
                <t>The module description <bcp14>SHOULD</bcp14> clearly identify the module as a
 temporary non-NMDA module.</t>
              </li>
            </ul>
          </section>
          <section anchor="example-create-a-new-nmda-module">
            <name>Example: Create a New NMDA Module</name>
            <t>Create an NMDA-compliant module, using combined configuration and
   state subtrees, whenever possible.</t>
            <sourcecode name="" type="yang"><![CDATA[
  module example-foo {
    namespace "urn:example:params:xml:ns:yang:example-foo";
    prefix "foo";

    container foo {
      // configuration data child nodes
      // operational value in operational state datastore only
      // may contain "config false" nodes as needed
    }
 }]]></sourcecode>
          </section>
          <section anchor="example-convert-an-old-non-nmda-module">
            <name>Example: Convert an Old Non-NMDA Module</name>
            <t>Do not remove non-compliant objects from existing modules.  Instead,
   change the status to "deprecated".  At some point, usually after 1
   year, the status <bcp14>MAY</bcp14> be changed to "obsolete".</t>
            <t>Old Module:</t>
            <sourcecode name="" type="yang"><![CDATA[
  module example-foo {
    namespace "urn:example:params:xml:ns:yang:example-foo";
    prefix "foo";

    container foo {
      // configuration data child nodes
    }

    container foo-state {
      config false;
      // operational state child nodes
    }
 }]]></sourcecode>

<t>Converted NMDA Module:</t>

            <sourcecode name="" type="yang"><![CDATA[
  module example-foo {
    namespace "urn:example:params:xml:ns:yang:example-foo";
    prefix "foo";

    container foo {
      // configuration data child nodes
      // operational value in operational state datastore only
      // may contain "config false" nodes as needed
      // will contain any data nodes from old foo-state
    }

    // keep original foo-state but change status to deprecated
    container foo-state {
      config false;
      status deprecated;
      // operational state child nodes
    }
 }]]></sourcecode>
          </section>
          <section anchor="example-create-a-temporary-nmda-module">
            <name>Example: Create a Temporary NMDA Module</name>
            <t>Create a new module that contains the top-level operational state
   data nodes that would have been available before they were combined
   with configuration data nodes (to be NMDA compliant).</t>
            <sourcecode name="" type="yang"><![CDATA[
  module example-foo-state {
    namespace "urn:example:params:xml:ns:yang:example-foo-state";
    prefix "foo-s";

    // import new or converted module; not used in this example
    import example-foo { prefix foo; }

    container foo-state {
      config false;
      status deprecated;
      // operational state child nodes
     }
  }]]></sourcecode>
          </section>
        </section>
      </section>
      <section anchor="performance-considerations">
        <name>Performance Considerations</name>
        <t>It is generally likely that certain YANG statements require more
   runtime resources than other statements.  Although there are no
   performance requirements for YANG validation, the following
   information <bcp14>MAY</bcp14> be considered when designing YANG data models:</t>
        <ul spacing="normal">
          <li>
            <t>Lists are generally more expensive than containers</t>
          </li>
          <li>
            <t>"when" statement evaluation is generally more expensive than "if-feature" or "choice" statements</t>
          </li>
          <li>
            <t>"must" statements are generally more expensive than "min-elements", "max-elements", "mandatory", or "unique" statements</t>
          </li>
          <li>
            <t>"identityref" leafs are generally more expensive than "enumeration" leafs</t>
          </li>
          <li>
            <t>"leafref" and "instance-identifier" types with "require-instance" set to "true" are generally more expensive than if "require-instance" is set to "false"</t>
          </li>
        </ul>
      </section>
      <section anchor="open-systems-considerations">
        <name>Open Systems Considerations</name>
        <t>Only the modules imported by a particular module can be assumed to be
   present in an implementation.  An open system <bcp14>MAY</bcp14> include any
   combination of YANG modules.</t>
      </section>
      <section anchor="guidelines-for-constructs-specific-to-yang-11">
        <name>Guidelines for Constructs Specific to YANG 1.1</name>
	
        <t>The set of guidelines for YANG 1.1 will grow as operational
   experience is gained with the new language features.  This section
   contains an initial set of guidelines for YANG 1.1 language
   features.</t>
        <section anchor="importing-multiple-revisions">
          <name>Importing Multiple Revisions</name>
          <t>Standard modules <bcp14>SHOULD NOT</bcp14> import multiple revisions of the same
   module into a module.  This <bcp14>MAY</bcp14> be done if independent definitions
   (e.g., "enumeration" typedefs) from specific revisions are needed in
   the importing module.</t>
        </section>
        <section anchor="using-feature-logic">
          <name>Using Feature Logic</name>
          <t>The YANG 1.1 feature logic is much more expressive than YANG 1.0.  A
   "description" statement <bcp14>SHOULD</bcp14> describe the "if-feature" logic in
   text, to help readers understand the module.</t>
          <t>YANG features <bcp14>SHOULD</bcp14> be used instead of the "when" statement, if
   possible.  Features are advertised by the server, and objects
   conditional by the "if-feature" statement are conceptually grouped
   together.  There is no such commonality supported for "when"
   statements.</t>
          <t>Features generally require less server implementation complexity and
   runtime resources than objects that use "when" statements.  Features
   are generally static (i.e., set when a module is loaded and not
   changed at runtime).  However, every client edit might cause a "when"
   statement result to change.</t>
        </section>
        <section anchor="anyxml-versus-anydata">
          <name>"anyxml" versus "anydata"</name>
          <t>The "anyxml" statement <bcp14>MUST NOT</bcp14> be used to represent a conceptual
   subtree of YANG data nodes.  The "anydata" statement <bcp14>MUST</bcp14> be used for
   this purpose.</t>
        </section>
        <section anchor="action-versus-rpc">
          <name>"action" versus "rpc"</name>
          <t>The use of "action" statements or "rpc" statements is a subjective
   design decision.  RPC operations are not associated with any
   particular data node.  Actions are associated with a specific data
   node definition.  An "action" statement <bcp14>SHOULD</bcp14> be used if the
   protocol operation is specific to a subset of all data nodes instead
   of all possible data nodes.</t>
          <t>The same action name <bcp14>MAY</bcp14> be used in different definitions within
   different data node.  For example, a "reset" action defined with a
   data node definition for an interface might have different parameters
   than for a power supply or a VLAN.  The same action name <bcp14>SHOULD</bcp14> be
   used to represent similar semantics.</t>
          <t>The NETCONF Access Control Model (NACM) <xref target="RFC8341"/> does not support
   parameter-based access control for RPC operations.  The user is given
   permission (or not) to invoke the RPC operation with any parameters.
   For example, if each client is only allowed to reset their own
   interface, then NACM cannot be used.</t>
          <t>For example, NACM cannot enforce access control based on the value of
   the "interface" parameter, only the "reset" operation itself:</t>
          <sourcecode name="" type="yang"><![CDATA[
   rpc reset {
     input {
       leaf interface {
         type if:interface-ref;
         mandatory true;
         description "The interface to reset.";
       }
     }
   }]]></sourcecode>
          <t>However, NACM can enforce access control for individual interface
   instances, using a "reset" action.  If the user does not have read
   access to the specific "interface" instance, then it cannot invoke
   the "reset" action for that interface instance:</t>
          <sourcecode name="" type="yang"><![CDATA[
   container interfaces {
     list interface {
       ...
       action reset { }
     }
   }]]></sourcecode>
        </section>
      </section>
      <section anchor="updating-yang-modules-published-versus-unpublished">
        <name>Updating YANG Modules (Published versus Unpublished)</name>
        <t>YANG modules can change over time.  Typically, new data model
   definitions are needed to support new features.  YANG update rules
   defined in <xref section="11" sectionFormat="of" target="RFC7950"/> <bcp14>MUST</bcp14> be followed for published
   modules.  They <bcp14>MAY</bcp14> be followed for unpublished modules.</t>
        <t>The YANG update rules only apply to published module revisions.  Each
   organization will have their own way to identify published work that
   is considered to be stable and unpublished work that is considered to
   be unstable.  For example, in the IETF, an RFC is used for
   published work, and an I-D is used for unpublished work.</t>
      </section>
      <section anchor="sec-tags">
        <name>Defining Standard Tags</name>
        <t><xref target="RFC8819"/> specifies a method for associating tags with YANG modules. Tags may
be defined and associated at design time, at implementation time, or via
user administrative control. Design-time tags are indicated using the module-tag
"extension" statement.</t>
        <t>A module <bcp14>MAY</bcp14> indicate, using module-tag "extension" statements, a set of
tags that are to be automatically associated with it (i.e., not added through configuration).</t>
        <sourcecode name="" type="yang"><![CDATA[
module example-module {
  namespace "https://example.com/yang/example";
  prefix "ex";
  //...
  import module-tags { prefix tags; }

  tags:module-tag "ietf:some-new-tag";
  tags:module-tag "ietf:some-other-tag";
  // ...
}]]></sourcecode>
        <t>Authors can use existing standard tags or use new tags defined in the model definition,
as appropriate. For IETF modules, new tags <bcp14>MUST</bcp14> be assigned in the IANA "IETF YANG Module Tags"
registry within the "YANG Module Tags" registry group <xref target="IANA-TAGS"/>.</t>
      </section>
      <section anchor="modeling-abstract-data-structures">
        <name>Modeling Abstract Data Structures</name>
        <t>For contexts where YANG is used to model abstract data structures (e.g., protocol messages), the use of the "structure" extension statement <xref target="RFC8791"/> is <bcp14>RECOMMENDED</bcp14> compared to the "yang-data" extension statement <xref target="RFC8040"/>. Examples of modules that rely upon the "structure" extension statement from <xref target="RFC8791"/> can be found in <xref target="RFC9132"/> or <xref target="RFC9195"/>.</t>
        <t>Abstract data structures can be augmented using the "augment-structure" statement <xref target="RFC8791"/>. Examples of modules that augment abstract data structures can be found in <xref target="RFC9244"/> and <xref target="RFC9362"/>.</t>
      </section>
      <section anchor="iana-maintained-modules">
        <name>IANA-Maintained YANG Modules</name>
        <section anchor="context">
          <name>Context</name>
          <t>IANA maintains a set of registries that are key for interoperability.
   The content of these registries is usually available using various
   formats (e.g., plain text or XML).  However, there was some confusion
   in the past about whether the content of some registries is dependent
   on a specific representation format.  For example, 
   <xref target="RFC8892" section="5"/> was published to clarify that MIB and YANG modules are
   merely additional formats in which the "Interface Types (ifType)" and
   "Tunnel Types (tunnelType)" registries are available.  The MIB
   <xref target="RFC2863"/> and YANG modules (<xref target="RFC7224"/> <xref target="RFC8675"/>) are not separate
   registries, and the same values are always present in all formats of
   the same registry.</t>
          <t>A design in which a YANG module includes parameters and values directly in a
   module that is not maintained by IANA while these are populated in an
   IANA registry could lead to ambiguity and maintain stale information. Such a design creates another
   source of information that may deviate from the IANA registry as new
   values are assigned or some values are deprecated.</t>
          <t>For the sake of consistency and the ability to support new values while
   maintaining IANA registries as the unique authoritative source of
   information, this document recommends the use of IANA-maintained YANG modules
   as the single source of information.</t>
          <t>The following section provides a set of guidelines for YANG module authors
   related to the design of IANA-maintained YANG modules.  These guidelines
   are meant to leverage existing IANA registries and use YANG as
   another format to present the content of these registries when
   appropriate.</t>
        </section>
        <section anchor="guidelines-for-iana-maintained-modules">
          <name>Guidelines for IANA-Maintained YANG Modules</name>
          <t>When designing a YANG module for a functionality governed by a
   protocol for which IANA maintains a registry, it is <bcp14>RECOMMENDED</bcp14> to
   specify an IANA-maintained YANG module that echoes the content of that
   registry.  This is superior to including that content in an
   IETF-maintained module.</t>
          <t>When one or multiple registries are available under the same
   registry group, it is <bcp14>RECOMMENDED</bcp14> to define an IANA-maintained YANG module for
   each registry.  However, module designers <bcp14>MAY</bcp14> consider defining
   one single IANA-maintained YANG module that covers all registries if
   maintaining that single module is manageable (e.g., very few values
   are present or expected to be present for each registry).  An
   example of such a module is documented in <xref section="5.2" sectionFormat="of" target="RFC9132"/>.</t>
          <t>An IANA-maintained YANG module may use the "identityref" data type approach (e.g., <xref target="RFC8675"/>) or
   an "enumeration" data type approach (e.g., <xref target="RFC9108"/>). See <xref target="sec-fve"/> for a guidance on which data type to use. The decision about which type to use
   should be made based upon
   specifics related to the intended use of the IANA-maintained YANG module.
   For example, identities are useful if the registry entries are
   organized hierarchically, possibly including multiple inheritances.
   The reasoning for the design choice <bcp14>MUST</bcp14> be
   documented in the companion specification that registers an
   IANA-maintained YANG module. For example, <xref target="RFC9244"/> defines an IANA-maintained YANG 
   module that uses enumerations for the following reason:</t>

          <blockquote>
            <t>The DOTS telemetry module (Section <xref target="RFC9244"
            section="11.1" sectionFormat="bare"/>) uses "enumerations" rather
            than "identities" to define units, samples, and intervals because
            otherwise the namespace identifier "ietf-dots-telemetry" must be
            included when a telemetry attribute is included (e.g., in a
            mitigation efficacy update).  The use of "identities" is thus
            suboptimal from the standpoint of message compactness, as message
            compactness is one of the key requirements for DOTS signal channel
            messages.</t>
          </blockquote>

          <t>Designers of IANA-maintained YANG modules <bcp14>MAY</bcp14> supply the initial full
   version of the module in a specification document that registers the
   module or only a script to be used (including by IANA) for generating
   the module (e.g., an Extensible Stylesheet Language Transformations (XSLT) stylesheet as in <xref section="A" target="RFC9108"/> or a Python script as in <xref target="RFC9645"/>).
   For both cases, the document that defines an IANA-maintained YANG module
   <bcp14>MUST</bcp14> include a note indicating that the document is only documenting
   the initial version of the module and that the authoritative version
   is to be retrieved from the IANA registry. Also, the IANA-maintained
   module <bcp14>MUST</bcp14> include the following note indicating the RFC that
   registered the initial version of the IANA-maintained YANG module:</t>

   <blockquote><t>The initial version of this YANG module is part of RFC IIII;
     see the RFC itself for full legal notices.</t></blockquote>

          <t>It is <bcp14>RECOMMENDED</bcp14> to
   include the URL from where to retrieve the recent version of the
   module.  When a script is used, the Internet-Draft that defines an
   IANA-maintained YANG module has to include an appendix with the full script and <bcp14>SHOULD</bcp14> include an appendix with the initial
   full version of the module. Including such an appendix in Internet-Drafts is meant to assess the correctness of the outcome of the
   supplied script.  The authors <bcp14>MUST</bcp14> include a note to the RFC Editor
   requesting that the appendix with the initial version of the module be removed before publication as RFC and
   that RFC IIII is replaced with the RFC number that is assigned to the document.
   Initial versions of IANA-maintained YANG modules that are published in
   RFCs may be misused despite the appropriate language to refer to the
   IANA registry to retrieve the up-to-date module.  This is problematic
   for interoperability, e.g., when values are deprecated or are
   associated with a new meaning.</t>

  <aside><t>Note: <xref target="Style"/> provides XSLT 1.0 stylesheets and other tools for
  translating IANA registries to YANG modules.  The tools can be
  used to generate up-to-date revisions of an IANA-maintained YANG module
  based upon the XML representation of an IANA registry.</t></aside>

          <t>If an IANA-maintained YANG module is imported by another module, a
   normative reference with the IANA URL from which to retrieve the
   IANA-maintained YANG module <bcp14>SHOULD</bcp14> be included.  Although not encouraged,
   referencing the RFC that defines the initial version of the IANA
   module is acceptable in specific cases (e.g., the imported version is
   specifically the initial version, the RFC includes useful description
   about the usage of the module).</t>

          <t>Examples of IANA URLs from which to retrieve the latest version of an
	  IANA-maintained YANG module are as follows:</t>
<ul>
	  <li><eref target="https://www.iana.org/assignments/iana-bgp-l2-encaps"/>,</li> <li><eref target="https://www.iana.org/assignments/iana-pseudowire-types"/>,
   and</li> <li><eref target="https://www.iana.org/assignments/iana-bfd-types"/>.</li></ul><t> "IANA_FOO_URL" is used in the following to refer
   to such URLs.  These URLs are expected to be sufficiently permanent
   and stable.</t>
   <t>Whenever referencing a specific version of an
   IANA-maintained YANG module is needed, then URLs such as the following are used:</t>
   <ul>
     <li><eref target="https://www.iana.org/assignments/iana-bgp-l2-encaps@2022-09-20.yang"/></li></ul>
   <t>"IANA_FOO_URL_With_REV" is used in the following to refer
   to such URLs.</t>
          <t>A template for IANA-maintained YANG modules is provided in <xref target="tem-iana"/>.</t>
        </section>
        <section anchor="sec-iana-mm">
          <name>Guidance for Writing the IANA Considerations for RFCs Defining IANA-Maintained YANG Modules</name>
          <t>In addition to the IANA considerations in <xref target="sec-iana-cons"/>,
   the IANA Considerations section of an RFC that includes an
   IANA-maintained YANG module <bcp14>MUST</bcp14> provide the required instructions for IANA to
   automatically perform the maintenance of that IANA module.  These
   instructions describe how to proceed with updates to the
   IANA-maintained YANG module that are triggered by a change to the authoritative
   registry.  Concretely, the IANA Considerations section <bcp14>SHALL</bcp14> at least
   provide the following information:</t>
          <ul spacing="normal">
            <li>
              <t>A request to IANA to add a note to the page displaying the
information about the IANA-maintained YANG module that new values must
not be directly added to the module. These values should be added to an authoritative IANA
registry.</t>
            </li>
            <li>
              <t>A request to IANA to add a note to the authoritative IANA registry
to indicate that any change to the registry must be reflected into
the corresponding IANA-maintained YANG module. That is, any changes to the registry must be accompanied by an update to the corresponding
IANA-maintained YANG module.</t>
            </li>
            <li>
              <t>Details about the required actions (e.g., add a new "identity" or
"enum" statement) to update the IANA-maintained YANG module to reflect
changes to an authoritative IANA registry.  Typically, these
details have to include the procedure to create a new "identity"
statement name and substatements ("base", "status",
"description", and "reference") or a new "enum" statement and
substatements ("value", "status", "description", and "reference").  </t>
              <ul spacing="normal">
                <li>
                  <t>When creating a new "identity" statement name or a new "enum" statement,
it is <bcp14>RECOMMENDED</bcp14> to use the same name (if present) as recorded in the IANA registry.</t>
                </li>
                <li>
		  
                  <t>If the name in the IANA registry does not comply with the naming conventions
listed in <xref target="sec-id-naming"/>, the procedure <bcp14>MUST</bcp14> detail how IANA
can generate legal identifiers from such a name. Specifically, if the name
begins with a number, it is <bcp14>RECOMMENDED</bcp14> to spell out (i.e., not use a digit) the number when used as an identifier. IANA should be provided with instructions to perform such a task. For example, authors of a module with such identifiers have to indicate whether:      </t>
                  <ul spacing="normal">
                    <li>
                      <t>"3des-cbc" should be "three-des-cbc" or rather "triple-des-cbc" to be consistent with <xref section="6.3" sectionFormat="of" target="RFC4253"/>.</t>
                    </li>
                    <li>
                      <t>"6to4" should be "sixToFour" as in <xref target="RFC7224"/> or "sixtofour" as in <xref target="RFC8675"/>.</t>
                    </li>
                  </ul>
                </li>
                <li>
                  <t>If a new registration uses an identifier that does not comply with the naming conventions
listed in <xref target="sec-id-naming"/>, IANA should check if guidance to generate legal identifiers was supplied in the RFC that specified the initial version of the module. If no such guidance is available, IANA should check the latest revision of the IANA-maintained YANG module for similar patterns. If all else fails, IANA should seek advice from relevant registry experts (e.g., designated experts for a registry using the Expert Review policy (<xref section="4.5" sectionFormat="of" target="RFC8126"/>) or responsible area director).</t>
                </li>
              </ul>
            </li>
	  </ul>
<t>The IANA Considerations Section <bcp14>MAY</bcp14> also provide the following information
if a default action is to be overridden:</t>
<ul>
            <li>
              <t>A note whether unassigned or reserved values should be present in
  the IANA-maintained YANG module.  If no instruction is provided,
  unassigned or reserved values must not be present in
  the IANA-maintained YANG module.</t>
            </li>
            <li>
              <t>An instruction whether experimental values should be included in
  the IANA-maintained YANG module.  If no instruction is provided,
  experimental values <bcp14>MUST NOT</bcp14> be listed in the IANA-maintained
  YANG module.</t>
            </li>
            <li>
              <t>An instruction about how to generate the "revision" statement.
  If no instruction is provided, default actions provided in <xref target="iana-maintained-modules-1"/> will be followed.</t>
            </li></ul>
          
          <t>A template for the IANA Considerations is provided in <xref target="sec-temp-id"/> for
   IANA-maintained YANG modules with identities and <xref target="sec-temp-enum"/> for
   IANA-maintained YANG modules with enumerations.  Authors may modify the
   template to reflect specifics of their modules (e.g., multiple
   registries can be listed for a single IANA-maintained YANG module, no
   explicit description (or name) field is listed under the
   authoritative IANA registry, or the name does not comply with YANG naming conventions (<xref target="sec-id-naming"/>)).</t>
          <t>An example of "revision" statements that are generated following the guidance in <xref target="iana-maintained-modules-1.2"/>
is provided below:</t>

          <sourcecode name="" type="yang"><![CDATA[
  revision 2023-11-27 {
    description
      "Registered RR Type RESINFO 261.";
    reference
      "https://www.iana.org/assignments/yang-parameters/"
    + "iana-dns-class-rr-type@2023-11-27.yang";
  }

  revision 2023-11-08 {
    description
      "Updated description and replaced draft string reference to
       64 and 65 with RFC 9460: Service Binding and Parameter
       Specification via the DNS (SVCB and HTTPS Resource Records).";
    reference
      "RFC 9460: Service Binding and Parameter Specification via the
                 DNS (SVCB and HTTPS Resource Records)
       https://www.iana.org/assignments/yang-parameters/"
    + "iana-dns-class-rr-type@2023-11-08.yang";
  }

  revision 2023-04-25 {
    description
      "Updated reference for 64 and 65.";
    reference
      "https://www.iana.org/assignments/yang-parameters/"
    + "iana-dns-class-rr-type@2023-04-25.yang";
  }

  revision 2022-05-30 {
    description
      "Updated description, reference for 64 and 65.";
    reference
      "https://www.iana.org/assignments/yang-parameters/"
    + "iana-dns-class-rr-type@2022-05-30.yang";
  }

  revision 2021-08-31 {
    description
      "Initial revision.";
    reference
      "RFC 9108: YANG Types for DNS Classes and Resource Record
                 Types";
  }]]></sourcecode>
          <t>Duplicating the same reference at the high level and at the level of a new addition might be redundant. For example, the following does not provide access to a specific (OLD) revision of the module when future revisions are made <xref target="IANA_Tunnel_Type_URL"/>:</t>
          <sourcecode name="" type="yang"><![CDATA[
revision 2021-04-23 {
  description
    "Registered tunnelType 19.";
  reference
    "RFC 4301: Security Architecture for the Internet Protocol";
}

revision 2019-11-16 {
  description
    "Initial revision.";
  reference
    "RFC 8675: A YANG Data Model for Tunnel Interface Types";
}

...

identity ipsectunnelmode {
  base ift:tunnel;
  description
    "IpSec tunnel mode encapsulation.";
  reference
    "RFC 4301: Security Architecture for the Internet Protocol";
}]]></sourcecode>
          <t>The following example shows how to generate the "revision" statements following the guidance in <xref target="iana-maintained-modules-1.2"/>:</t>
          <sourcecode name="" type="yang"><![CDATA[
revision 2021-04-23 {
  description
    "Registered tunnelType 19.";
  reference
    "https://www.iana.org/assignments/yang-parameters/"
  + "iana-tunnel-type@2021-04-23.yang
     RFC 4301: Security Architecture for the Internet Protocol";
}

revision 2019-11-16 {
  description
    "Initial revision.";
  reference
    "RFC 8675: A YANG Data Model for Tunnel Interface Types";
}
...
identity ipsectunnelmode {
  base ift:tunnel;
  description
    "IpSec tunnel mode encapsulation.";
  reference
    "RFC 4301: Security Architecture for the Internet Protocol";
}]]></sourcecode>
          <t>The templates in the following subsections are to be considered in addition to the
   required information that is provided in <xref target="sec-iana-cons"/>.</t>
          <section anchor="sec-temp-id">
            <name>Template for IANA-Maintained YANG Modules with Identities</name>

            <artwork><![CDATA[
<BEGIN TEMPLATE TEXT>
	    
This document defines the initial version of the IANA-maintained
"iana-foo" YANG module.  The most recent version of the YANG module
is available from the "YANG Parameters" registry group
[IANA-YANG-PARAMETERS].

IANA is requested to add this note to the registry:

   New values must not be directly added to the "iana-foo" YANG
   module.  They must instead be added to the "foo" registry.

IANA is requested to add this note to [reference-to-the-iana-foo-
registry]:

   When this registry is modified, the YANG module "iana-foo"
   [IANA_FOO_URL] must be updated as defined in RFC IIII.
   
When a value is added to the "foo" registry, a new "identity"
statement needs to be added to the "iana-foo" YANG module. 
The name of the "identity" MUST be the name as provided in the 
registry.  The "identity" statement should have the following
substatements defined:

 "base":        Contains 'name-base-identity-defined-in-foo'.

 "status":      Include only if a registration has been deprecated or
                obsoleted.  IANA "deprecated" maps to YANG status
                "deprecated", and IANA "obsolete" maps to YANG status
                "obsolete".

 "description":  Replicates the description from the registry.

 "reference":   Replicates the reference(s) from the registry with
                the title of the document(s) added.

-- Optional:

-- Include only text that needs to be customized for the module.
-- Text that does not require customization should be
-- omitted.

-- Notes tagged with "--" include instructions for authors.  These 
-- notes must not be copied. 

Unassigned and Reserved Values:

-- To be completed only if unassigned and/or reserved values 
-- (which may include experimental values) should be included 
-- in the module.  These values are typically not included.

Description Substatements:

-- To be completed only if the default actions described in 
-- Section 5.3.2 of RFC 9907 are to be overridden.
-- Specify whether instructions apply to "revision" statements,
-- "identity" statements, or both.

Reference Substatements:

-- To be completed only if the default actions described in 
-- Section 5.3.2 of RFC 9907 are to be overridden.
-- Specify whether instructions apply to "revision" statements,
-- "identity" statements, or both.

Naming Considerations:

-- If a name in the IANA registry does not comply with the
-- YANG naming conventions, add details how IANA can generate
-- legal identifiers.  For example, if the name begins with
-- a number, indicate a preference to spell out the number when
-- used as an identifier.

<END TEMPLATE TEXT>
     
]]></artwork>
          </section>
          <section anchor="sec-temp-enum">
            <name>Template for IANA-Maintained YANG Modules with Enumerations</name>

            <artwork><![CDATA[
<BEGIN TEMPLATE TEXT>
	    
This document defines the initial version of the IANA-maintained
"iana-foo" YANG module.  The most recent version of the YANG module
is available from the "YANG Parameters" registry group
[IANA-YANG-PARAMETERS].

IANA is requested to add this note to the registry:

    New values must not be directly added to the "iana-foo" YANG
    module.  They must instead be added to the "foo" registry.

When a value is added to the "foo" registry, a new "enum" statement
must be added to the "iana-foo" YANG module.  The "enum" statement,
and substatements thereof, should be defined:

 "enum":        Replicates a name from the registry.

 "value":       Contains the decimal value of the IANA-assigned
                value.

 "status":      Is included only if a registration has been 
                deprecated or obsoleted.  IANA "deprecated" maps 
                to YANG status "deprecated", and IANA "obsolete" 
                maps to YANG status "obsolete".

 "description":  Replicates the description from the registry.

 "reference":   Replicates the reference(s) from the registry. 
                References to documents should also include titles.

-- Optional:

-- Include only text that needs to be customized for the module.
-- Text that does not require customization should be
-- omitted.

-- Notes tagged with "--" include instructions for authors.  These
-- notes must not be copied.

Unassigned and Reserved Values:

-- To be completed only if unassigned and/or reserved values 
-- (which may include experimental values) should be included 
-- in the module.  These values are typically not included.

Description Substatements:

-- To be completed only if the default actions described in 
-- Section 5.3.2 of RFC 9907 are to be overridden.
-- Specify whether instructions apply to "revision" statements, "enum"
-- statements, or both.

Reference Substatements:

-- To be completed only if the default actions described in 
-- Section 5.3.2 of RFC 9907 are to be overridden.
-- Specify whether instructions apply to "revision" statements, "enum"
-- statements, or both.

Naming Considerations:

-- If a name in the IANA registry does not comply with the
-- YANG naming conventions, add details how IANA can generate
-- legal identifiers.  For example, if the name begins with
-- a number, indicate a preference to spell out the number when
-- used as an identifier.

<END TEMPLATE TEXT>
]]></artwork>

          </section>
        </section>
      </section>
    </section>
    <section anchor="sec-iana">
      <name>IANA Considerations</name>
      <section anchor="yang-modules">
        <name>YANG Modules</name>
        <t>The following registration in the "ns" registry of the "IETF XML
Registry" registry group <xref target="RFC3688"/> was detailed in <xref target="RFC8407"/>. IANA
has updated this registration to reference this document.</t>
<dl spacing="compact" newline="false">
  <dt>URI:</dt><dd>urn:ietf:params:xml:ns:yang:ietf-template</dd>
  <dt>Registrant Contact:</dt><dd>The IESG</dd>
  <dt>XML:</dt><dd>N/A; the requested URI is an XML namespace.</dd>
</dl>
        <t>IANA has registered the following URI in the "ns" registry within
   the "IETF XML Registry" registry group <xref target="RFC3688"/>:</t>
<dl spacing="compact" newline="false">
  <dt>URI:</dt><dd>urn:ietf:params:xml:ns:yang:iana-template</dd>
  <dt>Registrant Contact:</dt><dd>The IESG</dd>
  <dt>XML:</dt><dd>N/A; the requested URI is an XML namespace.</dd>
</dl>
        <t>IANA has registered the following YANG modules in the "YANG Module
Names" registry <xref target="RFC6020"/> <xref target="RFC9890"/> within the "YANG Parameters" registry group.</t>
<dl spacing="compact" newline="false">
  <dt>Name:</dt><dd>ietf-template</dd>
  <dt>Maintained by IANA?</dt><dd>N</dd>
  <dt>Namespace:</dt><dd>urn:ietf:params:xml:ns:yang:ietf-template</dd>
  <dt>Prefix:</dt><dd>temp</dd>
  <dt>Reference:</dt><dd>RFC 9907</dd>
</dl>
<dl spacing="compact" newline="false">
  <dt>Name:</dt><dd>iana-template</dd>
  <dt>Maintained by IANA?</dt><dd>N</dd>
  <dt>Namespace:</dt><dd>urn:ietf:params:xml:ns:yang:iana-template</dd>
  <dt>Prefix:</dt><dd>iana-foo</dd>
  <dt>Reference:</dt><dd>RFC 9907</dd>
</dl>
      </section>
      <section anchor="update-yang-parameters-registry-group">
        <name>Update in YANG Parameters Registry Group</name>
        <t>For the references of the "YANG Module Names" registry under the "YANG Parameters" registry group, IANA has updated <xref target="RFC8407"/> to this document, as it contains the template necessary
for registration in <xref target="tem-ietf"/>.</t>
      </section>
      <section anchor="iana-maintained-modules-1">
        <name>IANA-Maintained YANG Modules</name>
        <t>IANA should refer to <xref target="sec-iana-mm"/> for information necessary to populate "revision" statements and "identity" and "enum" substatements in IANA-maintained YANG modules.</t>
	<t>These considerations cover both the creation and maintenance of an IANA-maintained YANG module, and they include both instructions applicable to all IANA-maintained YANG modules and instructions that can be customized by module creators.</t>
	<section anchor="iana-maintained-modules-1.1">
	  <name>Requirements for All Modules</name>
	<t>In particular, the following instructions should apply to all modules:</t>
        <ul spacing="normal">
          <li>
            <t>When a YANG module is updated, a new "revision" statement with
    a unique revision date must be added in front of the existing revision
    statements. The "revision" statement MUST contain both "description"
    and "reference" substatements as described in <xref target="iana-maintained-modules-1.2" />.</t>
          </li>
	  <li>
	    <t>When an underlying registration is deprecated or obsoleted, a
     corresponding "status" substatement should be added to the
	    "identity" or "enum" statement.</t>
	  </li>
          <li>
            <t>The "reference" substatement in the "revision" statement should point specifically to the published module (i.e., IANA_FOO_URL_With_REV).  When the registration is triggered by an RFC, that RFC must also be included in the "reference" substatement.  It may also point to an authoritative event triggering the update to the YANG module.  In all cases, the event is cited from the underlying IANA registry.</t>
          </li>
	  <li>
	  <t>References to documents should include titles.</t></li>
        </ul>
        <t>In addition, when the module is published, IANA must add the following notes to:</t>
        <dl newline="true">
          <dt>The YANG Module Names registry:</dt>
          <dd>
            <t>New values must not be directly added to the "iana-foo" YANG module. They must instead be added to the "foo" registry.</t>
          </dd>
          <dt>The underlying registry:</dt>
          <dd>
            <t>When this registry is modified, the YANG module "iana-foo" [IANA_FOO_URL] must be updated as defined in RFC IIII.</t>
          </dd>
        </dl>
	</section>
	<section anchor="iana-maintained-modules-1.2">
	<name>Requirements Subject to Customization</name>
	<t>Unless the creators of an IANA-maintained YANG module specify otherwise in their document's IANA Considerations section, the following instructions will apply:</t>
	<ul>
	  <li>Unassigned and reserved values (including experimental values) will be omitted from the module.</li>
	  <li>The "reference" substatement in an "identity" or "enum" statement should mirror the underlying registry.  It may point to contact names as well as documents.</li>
	  <li><t>In a "revision" statement, the "description" substatement captures what changed in the
revised version.  Typically, the "description" enumerates changes
such as updates to existing entries (e.g., update a "description" or
a "reference") or notes which identities were added or had their status
changed (e.g., deprecated, discouraged, or obsoleted).</t>
	<t>When such a description is not feasible, the description varies in accordance with the trigger for the update.</t>
	<t>If the update is triggered by an RFC, the "description" substatement should include or consist of this text:</t>
	<ul empty="true">
	  <li>Applied updates as specified by RFC XXXX.</li>
	</ul>
	<t>If the registration policy for the registry does not require RFC publication (Section 4 of <xref target="RFC8126"/>), insert this text:</t>
	<ul empty="true">
	  <li>Applied updates as specified by the registration policy
	  &lt;Some_IANA_policy&gt;.</li>
	</ul>
	  </li>
	</ul>
      </section>
      </section>
    </section>
    <section anchor="operations-and-manageability-considerations">
      <name>Operational Considerations</name>
      <t>Although the document focuses on YANG data modeling language guidance, the document does not define a protocol or a protocol extension. As such, there are no new operations or manageability requirements introduced by this document.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>This document defines guidelines for NETCONF or
RESTCONF content defined with the YANG data modeling language.
It does not introduce any new or increased security risks.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="W3C.REC-xpath" target="https://www.w3.org/TR/1999/REC-xpath-19991116">
          <front>
            <title>XML Path Language (XPath) Version 1.0</title>
            <author initials="J." surname="Clark" fullname="James Clark" role="editor">
              <organization/>
            </author>
            <author initials="S." surname="DeRose" fullname="Steve DeRose" role="editor">
              <organization/>
            </author>
            <date day="16" year="1999" month="November"/>
          </front>
          <refcontent>W3C Recommendation</refcontent>
        </reference>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8040.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8791.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7952.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8792.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8819.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3986.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5378.xml"/>
	<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9890.xml"/>
      </references>

      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="IANA-MOD-NAMES" target="https://www.iana.org/assignments/yang-parameters/">
          <front>
            <title>YANG Module Names</title>
            <author>
              <organization>IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
        <reference anchor="IANA-XML" target="https://www.iana.org/assignments/xml-registry/">
          <front>
            <title>IETF XML Registry</title>
            <author>
              <organization>IANA</organization>
            </author>
            <date/>
          </front>
        </reference>


        <reference anchor="Style" target="https://github.com/llhotka/iana-yang">
          <front>
            <title>IANA YANG</title>
            <author>
              <organization/>
            </author>
            <date month="Dec" year="2021"/>
          </front>
          <refcontent>commit 3a6cb69</refcontent>
        </reference>
        <reference anchor="IANA-YANG-PARAMETERS" target="https://www.iana.org/assignments/yang-parameters">
          <front>
            <title>YANG Parameters</title>
            <author>
              <organization>IANA</organization>
            </author>
          </front>
        </reference>
        <reference anchor="IANA-TAGS" target="https://www.iana.org/assignments/yang-module-tags/">
          <front>
            <title>YANG Module Tags</title>
            <author>
              <organization>IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
        <reference anchor="IANA_Tunnel_Type_URL" target="https://www.iana.org/assignments/iana-tunnel-type">
          <front>
            <title>iana-tunnel-type YANG Module</title>
            <author>
              <organization>IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
        <reference anchor="ID-Guidelines" target="https://authors.ietf.org/en/content-guidelines-overview">
          <front>
            <title>Content guidelines overview</title>
            <author>
              <organization>IETF</organization>
            </author>
          </front>
        </reference>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8407.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8675.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9291.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2026.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8309.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9129.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7407.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8349.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9911.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8969.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8299.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8466.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9182.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8199.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8519.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4252.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9000.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7951.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5737.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3849.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9637.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5612.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5398.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2606.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4151.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8343.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7223.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9132.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9195.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9244.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9362.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8892.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2863.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7224.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9108.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9645.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4253.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4181.xml"/>

<reference anchor="Err5693" quote-title="false" target="https://www.rfc-editor.org/errata/eid5693"> 
   <front> 
      <title>Erratum ID 5693</title>
      <author>
         <organization>RFC Errata</organization>
      </author> 
   </front> 
   <refcontent>RFC 8407</refcontent>
</reference>

<reference anchor="Err5800" quote-title="false" target="https://www.rfc-editor.org/errata/eid5800"> 
   <front> 
      <title>Erratum ID 5800</title>
      <author>
         <organization>RFC Errata</organization>
      </author> 
   </front> 
   <refcontent>RFC 8407</refcontent>
</reference>

<reference anchor="Err6899" quote-title="false" target="https://www.rfc-editor.org/errata/eid6899"> 
   <front> 
      <title>Erratum ID 6899</title>
      <author>
         <organization>RFC Errata</organization>
      </author> 
   </front> 
   <refcontent>RFC 8407</refcontent>
</reference>

<reference anchor="Err7416" quote-title="false" target="https://www.rfc-editor.org/errata/eid7416"> 
   <front> 
      <title>Erratum ID 7416</title>
      <author>
         <organization>RFC Errata</organization>
      </author> 
   </front> 
   <refcontent>RFC 8407</refcontent>
</reference>
	
      </references>
    </references>

    <section anchor="module-review-checklist">
      <name>Module Review Checklist</name>
      <t>This section is adapted from <xref target="RFC4181"/>.</t>

      <t>The purpose of a YANG module review is to review the YANG module for
   both technical correctness and adherence to IETF documentation
   requirements.  The following checklist may be helpful when reviewing
   an I-D:</t>
      <ul spacing="normal">
        <li>
          <t>I-D Boilerplate: Verify that the document contains the required
          sections (see <eref
          target="https://authors.ietf.org/required-content"
          brackets="angle"/>).</t>
        </li>
        <li>
          <t>Abstract: Verify that the abstract does not contain references,
          that it does not have a section number, and that its content follows
          the guidelines in <eref
          target="https://www.ietf.org/id-info/guidelines.html"
          brackets="angle"/>.</t>
        </li>
        <li>

          <t>Copyright Notice: Verify that the document has the appropriate
          text regarding the rights that document contributors provide to the
          IETF Trust <xref target="RFC5378"/>.  Verify that it contains the
          full IETF Trust copyright notice at the beginning of the document.
          The IETF Trust Legal Provisions (TLP) can be found at: <eref
          target="https://trustee.ietf.org/license-info/"
          brackets="angle"/></t>
        </li>
        <li>
          <t>Security Considerations section: If none of the modules in the
          document falls under the exceptions in <xref
          target="sec-sec-cons-sec"/> (e.g., use YANG data structure), verify
          that the section is modeled after the latest approved template from
          the Operations and Management (OPS) area website (see <eref
          target="https://wiki.ietf.org/group/ops/yang-security-guidelines"
          brackets="angle"/>) and that the guidelines therein have been
          followed.</t>
        </li>
        <li>
          <t>IANA Considerations section: This section must always be present.
          For each module within the document, ensure that the IANA
          Considerations section contains entries for the following IANA
          registries: </t>
          <ul>
            <li>XML Namespace Registry: Register the YANG module
            namespace.</li>
            <li>YANG Module Registry: Register the YANG module name,
            prefix, namespace, and RFC number according to the rules
            specified in <xref target="RFC6020"/>.</li>
          </ul>
        </li>
        <li>
          <t>References: Verify that the references are properly divided
          between normative and informative references, that RFCs 2119 and
          8174 are included as normative references if the terminology defined
          therein is used in the document, that all references required by the
          boilerplate are present, that all YANG modules containing imported
          items are cited as normative references, and that all citations
          point to the most current RFCs, unless there is a valid reason to do
          otherwise (for example, it is okay to include an informative
          reference to a previous version of a specification to help explain a
          feature included for backward compatibility).  Be sure citations for
          all imported modules are present somewhere in the document text
          (outside the YANG module).  If a YANG module contains "reference" or
          "description" statements that refer to an I-D, then the I-D is
          included as an informative reference.</t>
        </li>
        <li>
          <t>License: Verify that the document contains the Revised BSD
          License in each YANG module or submodule.  Some guidelines related
          to this requirement are described in <xref
          target="module-copyright"/>.  Make sure that the correct year is
          used in all copyright dates.  Use the approved text from the latest
          TLP document, which can be found at: 
          <eref target="https://trustee.ietf.org/license-info/" brackets="angle"/></t>
        </li>
        <li>
          <t>Other Issues: Check for any issues mentioned in <eref
          target="https://www.ietf.org/id-info/checklist.html"
          brackets="angle"/> that are not covered elsewhere.</t>
        </li>
        <li>
          <t>Technical Content: Review the actual technical content for
          compliance with the guidelines in this document.  The use of a YANG
          module compiler is recommended when checking for syntax errors.  A
          list of freely available tools and other information, including
          formatting advice, can be found at:
          <eref target="https://wiki.ietf.org/group/netconf" brackets="angle"/> and
          <eref target="https://wiki.ietf.org/group/netmod" brackets="angle"/>  </t>
          <t>Checking for correct syntax, however, is only part of the job.
          It is just as important to actually read the YANG module document
          from the point of view of a potential implementor.  It is
          particularly important to check that "description" statements are
          sufficiently clear and unambiguous to allow interoperable
          implementations to be created.</t>
        </li>
      </ul>
    </section>
    <section anchor="tem-ietf">
      <name>Template for IETF Modules</name>

      <sourcecode name="ietf-template@2023-07-26.yang" type="yang" markers="true"><![CDATA[
module ietf-template {
  yang-version 1.1;

  // replace this string with a unique namespace URN value

  namespace "urn:ietf:params:xml:ns:yang:ietf-template";

  // replace this string, and try to pick a unique prefix

  prefix temp;

  // import statements here: e.g.,
  // import ietf-yang-types { prefix yang; }
  // import ietf-inet-types { prefix inet; }
  // identify the IETF working group if applicable

  organization
    "IETF your-wg-name (Expanded WG Name) Working Group";

  // update this contact statement with your info

  contact
    "WG Web:   https://datatracker.ietf.org/wg/your-wg-name
     WG List:  YOUR-WG-NAME <mailto:your-wg-name@ietf.org>

     Editor:   your-name
               <mailto:your-email@example.com>";

  // replace the first sentence in this "description" statement.
  // replace the copyright notice with the most recent
  // version, if it has been updated since the publication
  // of this document.

  description
    "This module defines a template for other YANG modules.

     Copyright (c) <insert year> IETF Trust and the persons
     identified as authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Revised BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     All revisions of IETF and IANA published modules can be found
     at the YANG Parameters registry group
     (https://www.iana.org/assignments/yang-parameters).

     This version of this YANG module is part of RFC XXXX; see
     the RFC itself for full legal notices.";

  // RFC Ed: replace 'date-revision' with the module publication date
  // the format is (YYYY-MM-DD)

  // replace XXXX with actual RFC number and remove
  // this note

  revision date-revision {
    description
      "What changed in this revision.";
    reference
      "RFC XXXX: <Replace With Document Title>";
  }

  // Authors: Replace RFC IIII with the RFC number and title 
  // of the RFC that defined the initial version of
  // the module and remove this note

  revision date-initial {
    description
      "Initial version."; 
    reference
      "RFC IIII: <Replace With Document Title>";
  }

  // extension statements
  // feature statements
  // identity statements
  // typedef statements
  // grouping statements
  // data definition statements
  // augment statements
  // rpc statements
  // notification statements
  // DO NOT put deviation statements in a published module
}]]></sourcecode>
    </section>
    <section anchor="tem-iana">
      <name>Template for IANA-Maintained YANG Modules</name>
 
     <sourcecode name="iana-template@2023-12-08.yang" markers="true"><![CDATA[
module iana-template {
  yang-version 1.1;

  // replace this string with a unique namespace URN value

  namespace "urn:ietf:params:xml:ns:yang:iana-template";

  // replace with the assigned prefix

  prefix iana-foo;

  organization
    "Internet Assigned Numbers Authority (IANA)";

  contact
    "Internet Assigned Numbers Authority

     ICANN
     12025 Waterfront Drive, Suite 300
     Los Angeles, CA 90094

     Tel: +1 310 301 5800

     <mailto:iana@iana.org>";

  description
    "This module defines a template for IANA-maintained modules.

     Copyright (c) <insert year> IETF Trust and the persons 
     identified as authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject to
     the license terms contained in, the Revised BSD License set
     forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     All revisions of IETF and IANA published modules can be found
     at the YANG Parameters registry group
     (https://www.iana.org/assignments/yang-parameters).

     The initial version of this YANG module is part of RFC IIII; 
     see the RFC itself for full legal notices.

  // RFC Ed.: replace IIII with actual RFC number and remove
  // this note

  // If a script is used, complete with the script information

     This version of this YANG module was generated from the
     corresponding IANA registry using a <script-info>.

  // RFC Ed.: replace the IANA_FOO_URL and remove this note

     The latest version of this YANG module is available at
     <IANA_FOO_URL>.";

  // replace with the registry name and the URL of the IANA registry

  reference
    "Registry Name (URL)";


  // replace 'date-revision' with the module publication date
  // the format is (YYYY-MM-DD)

  revision date-revision {
    description
      "Indicates the list of changes per Section 4.30.3 of RFC 9907";
    reference
      "URL of the latest version of the module
       (if any) list the authoritative event (e.g., RFC) that 
       triggered the update to the YANG module";
  }

  // replace 'date-initial' with the module publication date
  // the format is (YYYY-MM-DD)

  revision date-initial {
    description
      "Initial version.";
    reference
      "URL of the published initial version of the module
       RFC IIII: RFC Title";

  // RFC Ed.: Update with the RFC number and title 
  // of the RFC that defined the initial version of
  // the module and remove this note
  }

  // identity statements
  // typedef statements
}]]></sourcecode>
    </section>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>Thanks to <contact fullname="Jürgen Schönwälder"/> and <contact
      fullname="Ladislav Lhotka"/> for the discussion and valuable comments.
      Special thanks to <contact fullname="Ladislav Lhotka"/> for sharing more
      context that led to the design documented in <xref
      target="RFC9108"/>.</t>
      <t>Thanks to <contact fullname="Italo Busi"/>, <contact fullname="Benoît
      Claise"/>, <contact fullname="Tom Petch"/>, <contact fullname="Randy
      Presuhn"/>, <contact fullname="Martin Björklund"/>, <contact
      fullname="Acee Lindem"/>, <contact fullname="Dale R. Worley"/>, <contact
      fullname="Kent Watsen"/>, <contact fullname="Jan Lindblad"/>, <contact
      fullname="Qiufang Ma"/>, <contact fullname="Mahesh Jethanandani"/>,
      <contact fullname="Robert Wilton"/>, and <contact fullname="Thomas
      Fossati"/> for the comments.</t>
      <t><contact fullname="Lou Berger"/> suggested to include more details about IANA considerations.</t>
      <t><xref target="sec-tags"/> is inspired by <xref target="RFC8819"/>.</t>
      <t><contact fullname="Michal Vaško"/> reported an inconsistency in
      Sections <xref target="RFC8407" section="4.6.2" sectionFormat="bare"/>
      and <xref target="RFC8407" section="4.6.4" sectionFormat="bare"/> of
      <xref target="RFC8407"/>.</t>
      <t>Thanks to <contact fullname="Xufeng Liu"/> for reviewing the document, including providing YANGDOCTORS reviews.</t>
      <t><contact fullname="Italo Busi"/> provided the examples of "case + when" construct.</t>
      <t>Thanks to <contact fullname="Rich Salz"/> and <contact fullname="Michael Richardson"/> for the SAAG review.</t>
      <t><contact fullname="Kent Watsen"/> contributed text to the security and IANA-maintained YANG module templates.</t>
      <t>Special thanks to <contact fullname="Amanda Baber"/> for the thoughtful and careful review of the document.</t>
      <t>Thanks to <contact fullname="Qiufang Ma"/> for the careful shepherd review.</t>
      <t>Thanks to <contact fullname="Acee Lindem"/> for triggering the discussion on data model versus module.</t>
      <t>Thanks to <contact fullname="Mahesh Jethanandani"/> for the thoughtful AD review.</t>
      <t>Thanks to <contact fullname="Christer Holmberg"/> for the genart
      review, <contact fullname="Jean Mahoney"/> for the check on RPC
      implications, <contact fullname="Ralf Weber"/> for the dnsdir, <contact
      fullname="Giuseppe Fioccola"/> for the opsdir review, <contact
      fullname="Joseph Touch"/> for the tsvart review, and <contact
      fullname="Yoav Nir"/> for the secdir review.</t>
      <t>Thanks <contact fullname="Éric Vyncke"/>, <contact fullname="Mike
      Bishop"/>, <contact fullname="Roman Danyliw"/>, <contact fullname="Orie
      Steele"/>, <contact fullname="Ketan Talaulikar"/>, <contact
      fullname="Deb Cooley"/>, and <contact fullname="Gorry Fairhurst"/> for
      the IESG review.</t>

      <t>The author of RFC 8407:</t>
    <contact fullname="Andy Bierman">
      <organization>YumaWorks</organization>
      <address>
        <email>andy@yumaworks.com</email>
      </address>
    </contact>

    <t>Acknowledgments from RFC 8407:</t>

    <blockquote><t>The structure and contents of this document are adapted
    from "Guidelines for Authors and Reviewers of MIB Documents" <xref
    target="RFC4181"/>, by <contact fullname="C. M. Heard"/>.</t>
    <t>The working group thanks <contact fullname="Martin Bjorklund"/>,
    <contact fullname="Juergen Schoenwaelder"/>, <contact fullname="Ladislav
    Lhotka"/>, <contact fullname="Jernej Tuljak"/>, <contact fullname="Lou
    Berger"/>, <contact fullname="Robert Wilton"/>, <contact fullname="Kent
    Watsen"/>, and <contact fullname="William Lupton"/> for their extensive
    reviews and contributions to this document.</t></blockquote>

    </section>
    
  </back>

</rfc>
