<?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.19 (Ruby 3.1.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-richardson-netmod-atrest-extensions-01" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.20.1 -->
  <front>
    <title abbrev="yang-extensions">Extending YANG modules at runtime</title>
    <seriesInfo name="Internet-Draft" value="draft-richardson-netmod-atrest-extensions-01"/>
    <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="March" day="31"/>
    <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" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9254.xml">
          <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" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9595.xml">
          <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-13" 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="18" month="February" 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-13"/>
        </reference>
        <reference anchor="RFC8520" target="https://www.rfc-editor.org/info/rfc8520" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8520.xml">
          <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-07" 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="21" month="October" year="2024"/>
            <abstract>
              <t>This memo provides for an extension to RFC 8520 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-07"/>
        </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:
H4sIAAAAAAAAA31Y7XLbuBX9z6dAnT9JKqq2N9l1NDubVSzvxh3bci1lEqfT
6YDklYQ1CagAKEXN5F36LH2yngtQFOl4+kskCNyPc8/9gNI0TbzyJY3ExRdP
ulB6Ke7HN7+LyhR1SU5IL2ytvaookVlmaTMSO6mXKfF2p4x2SWFyLSuIKKxc
+NSqfCVt4YxONXnISaW35HznSHp8kiTPhPNSF/+UpdE47G1NSaLWNjw6f3p8
/Ob4NJGW5Ehcak8W0pLtciRuLubX04n4aOwDm/u7NfU6edgedqUTNiTJpR9B
R5EkuWHHRqL2i/QsWatRIoQ3OVwhh0dnLCxcuJEQ4pkoaCHr0jvs2H/fVfEz
vyay9itjR0mSCqWxeD0Ud63L2B2xuOYlKvufjIURMzhNZSW1mJmF38LB4Aor
okqqciSq3P5ZkV/86vZbh7lMEm1sJb3aEHQrvTi8CXH32/nZDz/+iA8b0nVY
iqLyzNhfWdYQurG6VH5VZ0HFXx7FEWFKESeAnKRpKmTmvJU53uYr5QSCXFek
PeBxuVUZU0NUBOe0cpUwC+HUUsuSI3KQyRj26ORXkgOjRUaidlSI7Yp03AIl
2vi4qrTAHqMhjsRCuhWEDaNdlSqKkpg+CLeF2NzjY5JcaggnsbYmJ+fYIJBV
Obbn69e3DUDfvrFFMs8NDJKehCYqoK9jMfTSAuB6sZUOhiivZFnugGdBfLgw
0ANb6yBa1suAyvNceXqBw4UoIdfuP6QAERbWloZJzwzF+BUK8QjSGTzYsTF1
vsLpGNwWC6MzAxKxQvilaYsobBT8HCaXPopaqJL2xxhk2LtjkBFD7SrlPSSZ
DUSfm/HtQLyfz29BR7FRUnyYvRMPtBuIrIYwRNhQGwpxdzGbn09vfhsKMQe8
uUGOaR/wZbiDWqYw73d19gflnlHStDQAjkMjAGOllivP5hTIdbEFCfdovD49
+/YNob2T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