<?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-00" 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-00"/>
    <author initials="M." surname="Richardson" fullname="Michael Richardson">
      <organization>Sandelman Software Works</organization>
      <address>
        <email>mcr+ietf@sandelman.ca</email>
      </address>
    </author>
    <date year="2024" month="September" day="27"/>
    <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.
This set of available values is established as an IANA registry by the document defining the module.</t>
        <t>(XXX- this assumes per-module extensions, vs a global set of extensions that could be used by many modules)</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>(XXX- the submap should allow to XML and JSON too?)</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">
          <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">
          <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-12" 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="8" month="July" year="2024"/>
            <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, merging a number of extensions into the YANG. The RFC8995 voucher request is also merged into this document.</t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-anima-rfc8366bis-12"/>
        </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-06" 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="27" month="April" 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-06"/>
        </reference>
      </references>
    </references>
    <?line 120?>



  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA21X63LbuBX+z6dAnT+brqjabrLraHbW69jejXd8q6VM4nQ6
HRA8klCTgAqA0qqZvEufpU/W7wAURTr5JfEQOJfvfOfCPM+zoENFE3H5RyBT
arMQj2e3v4nalk1FXsggXGOCrimTReFoPRFbaRY58XGvrfFZaZWRNVSUTs5D
7rRaSld6a3JDAXpyGRz50LuSHx5m2QvhgzTlP2VlDS4H11CW6ZWLf304Pjx8
c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