<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.29 (Ruby 3.3.8) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-richardson-netmod-atrest-extensions-02" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.25.0 -->
  <front>
    <title abbrev="yang-extensions">Extending YANG modules at runtime</title>
    <seriesInfo name="Internet-Draft" value="draft-richardson-netmod-atrest-extensions-02"/>
    <author initials="M." surname="Richardson" fullname="Michael Richardson">
      <organization>Sandelman Software Works</organization>
      <address>
        <email>mcr+ietf@sandelman.ca</email>
      </address>
    </author>
    <date year="2025" month="October" day="09"/>
    <area>Internet</area>
    <workgroup>NETMOD Working Group</workgroup>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <?line 36?>

<t>This document describes a mechanism of signaling extensions to YANG modules that
can be used when YANG is not used in an online fashion.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-richardson-netmod-atrest-extensions/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        cbor Working Group mailing list (<eref target="mailto:cbor@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/cbor/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/cbor/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/mcr/yang-extensions-at-reset"/>.</t>
    </note>
  </front>
  <middle>
    <?line 41?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>In the process of revising <xref target="RFC8366"/> to accomodate needed extensions an effort was initially made to do this using augment (cite) and later augment-structure.
<xref target="RFC8366"/> is a digitally signed voucher format used in onboarding of new devices.
It is a file format that may be transmitted over CoAP, HTTP or via USB key, but it does not use RESTCONF.  The contents of the file are not subject to negotiation as might be done with
<xref target="RFC8528"/>.</t>
      <t>Rather than have each topic document define the relevant extensions needed, it turned out to be necessary to collect all the extensions necessary into a single revision to the YANG module, which is being produced as <xref target="I-D.ietf-anima-rfc8366bis"/>.</t>
      <t><xref target="RFC8520"/> is like <xref target="RFC8366"/>: it is a file format.  When <xref target="RFC8520"/> was defined, it anticipated that there would be future extensions, and defined a YANG leaf called "extensions"
which is a list of subsequent YANG modules which are included.  This is being used to define, for instance, <xref target="I-D.ietf-opsawg-ol"/>.</t>
      <t>When YANG is serialized to XML or JSON, the keys used in the attribute map are strings, and so it seems relatively straightforward for a human programmer to understand how to insert these new keys into the same attribute map.
YANG however, is intended to be machine parseable, and <xref target="RFC9254"/> provides a way to serialize YANG to CBOR.  While strings can be used if necessary, the preferred method is via YANG-SID values, allocated for instance, via <xref target="RFC9595"/>.
It is not obvious how an extension mechanism as described by <xref target="RFC8520"/> can be efficiently encoded to CBOR, nor how YANG tooling should react to these ad-hoc extensions.</t>
      <t>This document makes the <xref target="RFC8520"/> extension mechanism a generic mechanism that can be used by any YANG module, and explains how to efficiently encode this to CBOR using YANG-SID.</t>
    </section>
    <section anchor="terminology">
      <name>Terminology</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>
      <?line -18?>

<section anchor="motivation">
        <name>Motivation</name>
        <t>XXX - Do we need more details about the motivation?</t>
      </section>
    </section>
    <section anchor="protocol">
      <name>Protocol</name>
      <section anchor="extensions">
        <name>Extensions</name>
        <t>A YANG module that expects to have extensions establishes an attribute called "extensions"
This attribute value is a list of extensions that are included in this object.</t>
        <t>This set of available values is established as an IANA registry by the document defining this module.</t>
        <t>(XXX- this assumes per-module extensions, vs a global set of extensions that could be used by many modules)</t>
        <t>Extension documents are presented as new YANG modules.
They are <em>not</em> defined using augment against the original module.</t>
        <t>When encoding YANG as CBOR, in order to encode the additional attributes defined by that extension, a new sub-map is created.
The key for this sub-map, in the parent map, consists of the YANG module SID, encoded using the CBOR Tag 47, the tag for an absolute SID.
Within the sub-map, the normal delta-encoding is used, using the SID values allocated for that module.</t>
        <t>When encoding YANG as JSON, a sub-map is also used.
The key for the sub-map is the YANG module name for the extension.
Within the sub-map, normal JSON encoding rules are used.
(This is in contrast to example in <xref target="RFC8520"/> in which a colon-joined key is used, and no sub-map is used)</t>
      </section>
    </section>
    <section anchor="privacy-considerations">
      <name>Privacy Considerations</name>
      <t>YYY</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>ZZZ</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
    </section>
    <section anchor="acknowledgements">
      <name>Acknowledgements</name>
      <t>Hello.</t>
    </section>
    <section anchor="changelog">
      <name>Changelog</name>
    </section>
  </middle>
  <back>
    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="RFC9254" target="https://www.rfc-editor.org/info/rfc9254">
          <front>
            <title>Encoding of Data Modeled with YANG in the Concise Binary Object Representation (CBOR)</title>
            <author fullname="M. Veillette" initials="M." role="editor" surname="Veillette"/>
            <author fullname="I. Petrov" initials="I." role="editor" surname="Petrov"/>
            <author fullname="A. Pelov" initials="A." surname="Pelov"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <author fullname="M. Richardson" initials="M." surname="Richardson"/>
            <date month="July" year="2022"/>
            <abstract>
              <t>YANG (RFC 7950) is a data modeling language used to model configuration data, state data, parameters and results of Remote Procedure Call (RPC) operations or actions, and notifications.</t>
              <t>This document defines encoding rules for YANG in the Concise Binary Object Representation (CBOR) (RFC 8949).</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9254"/>
          <seriesInfo name="DOI" value="10.17487/RFC9254"/>
        </reference>
        <reference anchor="RFC9595" target="https://www.rfc-editor.org/info/rfc9595">
          <front>
            <title>YANG Schema Item iDentifier (YANG SID)</title>
            <author fullname="M. Veillette" initials="M." role="editor" surname="Veillette"/>
            <author fullname="A. Pelov" initials="A." role="editor" surname="Pelov"/>
            <author fullname="I. Petrov" initials="I." role="editor" surname="Petrov"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <author fullname="M. Richardson" initials="M." surname="Richardson"/>
            <date month="July" year="2024"/>
            <abstract>
              <t>YANG Schema Item iDentifiers (YANG SIDs) are globally unique 63-bit unsigned integers used to identify YANG items. SIDs provide a more compact method for identifying those YANG items that can be used efficiently, notably in constrained environments (RFC 7228). This document defines the semantics, registration processes, and assignment processes for YANG SIDs for IETF-managed YANG modules. To enable the implementation of these processes, this document also defines a file format used to persist and publish assigned YANG SIDs.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9595"/>
          <seriesInfo name="DOI" value="10.17487/RFC9595"/>
        </reference>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="RFC8366" target="https://www.rfc-editor.org/info/rfc8366" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8366.xml">
          <front>
            <title>A Voucher Artifact for Bootstrapping Protocols</title>
            <author fullname="K. Watsen" initials="K." surname="Watsen"/>
            <author fullname="M. Richardson" initials="M." surname="Richardson"/>
            <author fullname="M. Pritikin" initials="M." surname="Pritikin"/>
            <author fullname="T. Eckert" initials="T." surname="Eckert"/>
            <date month="May" year="2018"/>
            <abstract>
              <t>This document defines a strategy to securely assign a pledge to an owner using an artifact signed, directly or indirectly, by the pledge's manufacturer. This artifact is known as a "voucher".</t>
              <t>This document defines an artifact format as a YANG-defined JSON document that has been signed using a Cryptographic Message Syntax (CMS) structure. Other YANG-derived formats are possible. The voucher artifact is normally generated by the pledge's manufacturer (i.e., the Manufacturer Authorized Signing Authority (MASA)).</t>
              <t>This document only defines the voucher artifact, leaving it to other documents to describe specialized protocols for accessing it.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8366"/>
          <seriesInfo name="DOI" value="10.17487/RFC8366"/>
        </reference>
        <reference anchor="RFC8528" target="https://www.rfc-editor.org/info/rfc8528" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8528.xml">
          <front>
            <title>YANG Schema Mount</title>
            <author fullname="M. Bjorklund" initials="M." surname="Bjorklund"/>
            <author fullname="L. Lhotka" initials="L." surname="Lhotka"/>
            <date month="March" year="2019"/>
            <abstract>
              <t>This document defines a mechanism that adds the schema trees defined by a set of YANG modules onto a mount point defined in the schema tree in another YANG module.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8528"/>
          <seriesInfo name="DOI" value="10.17487/RFC8528"/>
        </reference>
        <reference anchor="I-D.ietf-anima-rfc8366bis" target="https://datatracker.ietf.org/doc/html/draft-ietf-anima-rfc8366bis-14" xml:base="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-anima-rfc8366bis.xml">
          <front>
            <title>A Voucher Artifact for Bootstrapping Protocols</title>
            <author fullname="Kent Watsen" initials="K." surname="Watsen">
              <organization>Watsen Networks</organization>
            </author>
            <author fullname="Michael Richardson" initials="M." surname="Richardson">
              <organization>Sandelman Software</organization>
            </author>
            <author fullname="Max Pritikin" initials="M." surname="Pritikin">
              <organization>Cisco Systems</organization>
            </author>
            <author fullname="Toerless Eckert" initials="T. T." surname="Eckert">
              <organization>Futurewei Technologies Inc.</organization>
            </author>
            <author fullname="Qiufang Ma" initials="Q." surname="Ma">
              <organization>Huawei</organization>
            </author>
            <date day="1" month="April" year="2025"/>
            <abstract>
              <t>This document defines a strategy to securely assign a Pledge to an owner using an artifact signed, directly or indirectly, by the Pledge's manufacturer. This artifact is known as a "voucher". This document defines an artifact format as a YANG-defined JSON or CBOR document that has been signed using a variety of cryptographic systems. The voucher artifact is normally generated by the Pledge's manufacturer (i.e., the Manufacturer Authorized Signing Authority (MASA)). This document updates RFC8366, includes a number of desired extensions into the YANG. The voucher request defined in RFC8995 is also now included in this document, as well as other YANG extensions needed for variants of BRSKI/RFC8995.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-anima-rfc8366bis-14"/>
        </reference>
        <reference anchor="RFC8520" target="https://www.rfc-editor.org/info/rfc8520">
          <front>
            <title>Manufacturer Usage Description Specification</title>
            <author fullname="E. Lear" initials="E." surname="Lear"/>
            <author fullname="R. Droms" initials="R." surname="Droms"/>
            <author fullname="D. Romascanu" initials="D." surname="Romascanu"/>
            <date month="March" year="2019"/>
            <abstract>
              <t>This memo specifies a component-based architecture for Manufacturer Usage Descriptions (MUDs). The goal of MUD is to provide a means for end devices to signal to the network what sort of access and network functionality they require to properly function. The initial focus is on access control. Later work can delve into other aspects.</t>
              <t>This memo specifies two YANG modules, IPv4 and IPv6 DHCP options, a Link Layer Discovery Protocol (LLDP) TLV, a URL, an X.509 certificate extension, and a means to sign and verify the descriptions.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8520"/>
          <seriesInfo name="DOI" value="10.17487/RFC8520"/>
        </reference>
        <reference anchor="I-D.ietf-opsawg-ol" target="https://datatracker.ietf.org/doc/html/draft-ietf-opsawg-ol-08" xml:base="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-opsawg-ol.xml">
          <front>
            <title>Ownership and licensing statements in YANG</title>
            <author fullname="Eliot Lear" initials="E." surname="Lear">
              <organization>Cisco Systems</organization>
            </author>
            <author fullname="Carsten Bormann" initials="C." surname="Bormann">
              <organization>Universität Bremen TZI</organization>
            </author>
            <date day="23" month="April" year="2025"/>
            <abstract>
              <t>This memo provides for an extension to RFC 8520 (Manufacturer Usage Description Specification, MUD) that allows MUD file authors to specify ownership and licensing of MUD files themselves. This memo updates RFC 8520. However, it can also be used for purposes outside of MUD, and the grouping is structured as such.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-opsawg-ol-08"/>
        </reference>
      </references>
    </references>
    <?line 127?>

<section anchor="appendix-a-example-module-and-extension">
      <name>Appendix A: Example module and extension</name>
      <t>TODO.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA31Y7XL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