<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="4"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-boucadair-netmod-iana-registries-00"
     ipr="trust200902" updates="8407">
  <front>
    <title abbrev="IANA-Maintained YANG Modules">Recommendations for Creating
    IANA-Maintained YANG Modules</title>

    <author fullname="Mohamed Boucadair" initials="M." surname="Boucadair">
      <organization>Orange</organization>

      <address>
        <postal>
          <street></street>

          <city>Rennes</city>

          <region></region>

          <code>35000</code>

          <country>France</country>
        </postal>

        <email>mohamed.boucadair@orange.com</email>
      </address>
    </author>

    <date />

    <workgroup>netmod</workgroup>

    <abstract>
      <t>This document provides a set of guidelines for YANG module authors
      related to the design of IANA-maintained modules. These guidelines are
      meant to leverage existing IANA registries and use YANG as just another
      format to present the content of these registries. </t>

      <t>This document updates RFC 8407. </t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction" title="Introduction">
      <t>IANA maintains a set of registries that are key for inexorability.
      The content of these registries are usually available using various
      formats (e.g., plain text, XML). However, there were some confusion in
      the past about whether the content of some registries is dependent on a
      specific representation format. For example, Section 5 of <xref
      target="RFC8892"></xref> 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"></xref> and YANG modules <xref
      target="RFC7224"></xref><xref target="RFC8675"></xref> are not separate
      registries, and the same values are always present in all formats of the
      same registry. </t>

      <t>Also, some YANG modules include parameters and values directly in a
      module that is not maintained by IANA while these are populated in an
      IANA registry. Such a design is suboptimal as it creates another source
      of information that may deviate from the IANA registry as new values are
      assigned. </t>

      <t>For the sake of consistency, better flexibility to support new
      values, and maintaining IANA registries as the unique authoritative
      source of information, when such an information is maintained in a
      registry, this document encourages the use of IANA-maintained modules.
      </t>

      <t><xref target="update"></xref> updates the guidelines in <xref
      target="RFC8407"></xref>.</t>
    </section>

    <section anchor="notation" title="Terminology">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
      "OPTIONAL" in this document are to be interpreted as described in BCP 14
      <xref target="RFC2119"></xref><xref target="RFC8174"></xref> when, and
      only when, they appear in all capitals, as shown here.</t>

      <t>This document makes use of the terms defined in Section 2 of <xref
      target="RFC8407"></xref>.</t>
    </section>

    <section anchor="update" title="Guidelines for IANA-Maintained Registries">
      <t>When designing a YANG module for a functionality governed by a
      protocol for which IANA maintains a registry, it is RECOMMENDED to
      specify an IANA-maintained module that echoes the content of that
      registry. </t>

      <t>When one or multiple sub-registries are available under the same
      registry, it is RECOMMENDED to define an IANA-maintained module for each
      sub-registry. However, designers MAY consider defining one single
      IANA-maintained module that covers all sub-registries if maintaining
      that single module is manageable (e.g., very few values are present or
      expected to be present for each sub-registry).</t>

      <t>An IANA-maintained module may use identities (e.g., <xref
      target="RFC8675"></xref>) or typedefs (e.g., <xref
      target="RFC9108"></xref>). Such a decision is left to the module
      designers and should be made based upon specifics related to the
      intended use of the module. It is RECOMMENDED that the reasoning for the
      design choice is documented in the companion specification document. For
      example, <xref target="I-D.ietf-dots-telemetry"></xref> define
      IANA-maintained module that use typedefs for the following reason:</t>

      <t><figure>
          <artwork><![CDATA[  "The DOTS telemetry module (Section 10.1) 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 a message compactness standpoint; one of the key
   requirements for DOTS messages."]]></artwork>
        </figure></t>

      <t>This recommendation takes precedence over the behavior in Section
      4.11.1 of <xref target="RFC8407"></xref> for IANA-maintained modules
      because the extensibility concern is not applicable for such modules.
      </t>

      <t>Designers of IANA-maintained modules MAY supply the full Initial
      version of the module in the specification document or only a script to
      be used by IANA (e.g., XSLT 1.0 stylesheet in Appendix A of <xref
      target="RFC9108"></xref>). </t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document does not require any IANA action.</t>
    </section>

    <section anchor="security" title="Security Considerations">
      <t>This document does not introduce new concerns other than those
      already discussed in Section 15 of <xref target="RFC8407"></xref>.</t>
    </section>

    <section anchor="ack" title="Acknowledgements">
      <t>This document is triggered by a discusison the author had with Dhruv
      Dhody and Jensen Zhang.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.RFC.2119'?>

      <?rfc include='reference.RFC.8174'?>

      <?rfc include='reference.RFC.8407'?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.RFC.9132'?>

      <?rfc include='reference.RFC.8675'?>

      <?rfc include='reference.RFC.8892'?>

      <?rfc include='reference.RFC.9108'?>

      <?rfc include='reference.I-D.ietf-dots-telemetry'?>

      <?rfc include='reference.RFC.2863'?>

      <?rfc include='reference.RFC.7224'?>
    </references>
  </back>
</rfc>
