<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?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="info" ipr="trust200902" docName="draft-ietf-netmod-yang-solutions-01" obsoletes="" updates="" submissionType="IETF" xml:lang="en">
  <front>
    <title abbrev="YANG Versioning Solution Overview">YANG Versioning Solution Overview</title>
    <author initials="R." role="editor" surname="Wilton" fullname="Robert Wilton">
      <organization abbrev="Cisco Systems, Inc.">
	Cisco Systems, Inc.
      </organization>
      <address>
        <email>rwilton@cisco.com</email>
      </address>
    </author>
    <date/>
    <abstract>
      <t>
	This document gives an overview of the different documents
	that comprise a full solution to the YANG versioning
	requirements document.  The purpose of this document is to
	help readers understand how the discrete parts of the YANG
	versioning solution fit together during working group
	development of the solution documents.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" title="Introduction" numbered="true" toc="default">
      <t><xref target="I-D.ietf-netmod-yang-versioning-reqs" pageno="false" format="default"/>
      documents the requirements for any solution to the YANG <xref target="RFC7950" pageno="false" format="default"/> versioning problem.  In particular, chapter 5
      lists the formal requirements that a solution requires.</t>
      <t>The complete solution to all of the YANG versioning
      requirements is comprised of five documents, each addressing
      different aspects of the solution.  These documents are:
      <list style="numbers">
          <t><xref target="I-D.ietf-netmod-yang-module-versioning" pageno="false" format="default"/></t>
          <t><xref target="I-D.ietf-netmod-yang-semver" pageno="false" format="default"/></t>
          <t><xref target="I-D.ietf-netmod-yang-packages" pageno="false" format="default"/></t>
          <t><xref target="I-D.ietf-netmod-yang-ver-selection" pageno="false" format="default"/></t>
          <t><xref target="I-D.ietf-netmod-yang-schema-comparison" pageno="false" format="default"/></t>
        </list>
      </t>
      <t>The aim of this document is to help readers understand how
      these different solution documents fit together, and also which
      documents contribute solutions that address particular
      individual requirements.</t>
      <t>Open issues, across all of the solution documents are tracked at <eref target="https://github.com/netmod-wg/yang-ver-dt/issues"/>.</t>
    </section>
    <section anchor="soln_documents" title="Solution Documents" numbered="true" toc="default">
      <section anchor="module_versioning" title="Updated YANG Module Revision Handling" numbered="true" toc="default">
        <t>In summary, <xref target="I-D.ietf-netmod-yang-module-versioning" pageno="false" format="default"/> specifies
	minimal extensions and updates to the YANG language, YANG
	Library, and YANG author guidelines to provide more flexible
	YANG module revision handling.  The intent is that these
	changes and extensions could be folded into future revisions
	of the updated specifications.  The document provides a base
	solution for all requirements except Req 2.2, Req 3.1 and Req
	3.2.</t>
        <t>The extensions and changes in the document can be summarized thus:
	<list style="symbols">
            <t>It defines a YANG extension statement to indicate where
	non-backwards-compatible changes have occurred in a module's revision
	history.</t>
            <t>It relaxes the rules for the module revision history to allow for a
	non-linear module revision history.  I.e., any given module revision may
	have multiple revisions directly derived from it.</t>
            <t>It defines a new import extension statement that restricts the
	allowed module revisions that satisfy the import to only those derived
	from a specified module revision.</t>
            <t>It defines a revision label extension statement to allow an
	informative name to be associated with a particular revision date, and
	to be used in import statements, YANG module filenames, and is available
	in YANG library.  One example of how the revision label could be used is
	to associate a semantic versioning scheme to YANG module revisions.</t>
            <t>It updates the YANG rules for changes between module revisions that
	are allowed to be classified as backwards-compatible.  In particular,
	marking a node as obsolete is no longer classified as a backwards
	compatible change.</t>
            <t>It provides updated guidance on how servers handle deprecated and
	obsolete YANG nodes and augments YANG library with additional leaves to
	report the server's behavior to clients.</t>
            <t>It provides an extension statement to allow a description statement
	to be associated with a YANG status statement, providing more
	information about why the status has changed.</t>
            <t>It defines how versioning relates to YANG instance data.</t>
            <t>It refines the guidelines for updating modules, taking into
	consideration that non-backwards-compatible changes are sometimes
	necessary for various pragmatic reasons.</t>
          </list></t>
      </section>
      <section anchor="yang_semver" title="YANG Semantic Versioning" numbered="true" toc="default">
        <t><xref target="I-D.ietf-netmod-yang-semver" pageno="false" format="default"/> defines a
	semantic versioning scheme, derived from the semver.org 2.0.0
	specification, that can be used in conjunction with the
	revision label extension statement defined in <xref target="module_versioning" pageno="false" format="default"/> to allow semantic version numbers
	to be used to manage the revision lifecycle of YANG modules
	and other related YANG assets, e.g., YANG packages.  This document
	provides an enhanced solution for Req 2.1, but organizations
	authoring modules are not obliged to use this specific
	versioning scheme, and could choose a different overlaid
	versioning scheme, or none at all and rely solely on revision
	dates.</t>
        <t>The aims of the YANG semantic versioning scheme are:
	<list style="symbols">
            <t>to generally allow clients to determine whether NBC
	  changes have occurred between two revisions from the version
	  number alone, without having to check the full revision
	  history;</t>
            <t>to give a more informative identifier for a branched
	  revision history over revision dates alone;</t>
            <t>to allow revision branches that contain fixes for
	  published non-latest releases.</t>
          </list>
        </t>
      </section>
      <section anchor="yang_pkgs" title="Versioned YANG packages" numbered="true" toc="default">
        <t>The two previous solution documents primarily address
	version and revision management of individual modules.  <xref target="I-D.ietf-netmod-yang-packages" pageno="false" format="default"/> provides a
	mechanism to group sets of related YANG modules revisions
	together, into constructs called YANG packages, and to apply
	a versioning scheme to the groups.</t>
        <t>The core part of this document are YANG module definitions
	that define a YANG package.  The definitions are used as an
	augmentation to YANG library and also in YANG instance data
	documents for offline access.</t>
        <t>The principle aims of YANG packages are:
	<list>
            <t>To define an efficient hierarchical structure that can
          precisely specify a YANG schema.</t>
            <t>To provide an simple alternative mechanism to manage
	  conformance of modules.  Rather than checking conformance
	  against a set of individual YANG module revisions and
	  enabled features, it should be easier to check for
	  conformance against a much smaller set of YANG package
	  versions.</t>
            <t>To provide a more efficient mechanism for servers to
	  share conformance information with clients.  Rather that
	  downloading and comparing all individual module revisions
	  and features via YANG library, the client can just check
	  whether the package version is compatible instead.  The
	  package definition could be retrieved and cached from
	  multiple sources.</t>
            <t>To define constructs that can be used for YANG schema
          selection.</t>
          </list>
        </t>
        <t>Although the YANG packages document does not satisfy any
	versioning requirements directly, it provides foundational
	building blocks for the schema selection solution, described
	in <xref target="schema_sel" pageno="false" format="default"/>, that does address two of the
	requirements.</t>
      </section>
      <section anchor="schema_sel" title="Dynamic YANG schema selection" numbered="true" toc="default">
        <t><xref target="I-D.ietf-netmod-yang-ver-selection" pageno="false" format="default"/>
	specifies a solution for requirements 3.1 and 3.2 via the use
	of <xref target="I-D.ietf-netmod-yang-packages" pageno="false" format="default"/> and a
	model and protocol based schema selection scheme that can be
	used by clients to choose which schemas to use when
	interacting with the device from the available schema that are
	supported and advertised by the server.</t>
        <t>The dynamic YANG schema selection solution:
	<list>
            <t>allows servers to define named 'schema-sets' which
          specify the schema for each supported datastore via
          references to YANG packages;</t>
            <t>can support clients choosing a single default schema-set
          (from those advertised by the server) that is used for all
          NETCONF/RESTCONF protocol sessions;</t>
            <t>can support clients enabling multiple compatible secondary
	  schema-sets that can be used on separate NETCONF/RESTCONF
	  protocol sessions;</t>
            <t>can support clients configuring named custom schema-sets that
          can be selected as default or secondary schema-sets;</t>
            <t>can support different module versions via placing them in
          different schema-sets;</t>
            <t>can support different schema families (e.g., IETF YANG
          modules , native vendor, or OpenConfig);</t>
            <t>allows considerable freedom in the schema selection
          capabilities that servers choose to support.</t>
          </list>
        </t>
      </section>
      <section anchor="schema_comp" title="YANG Schema Comparison" numbered="true" toc="default">
        <t>The final piece of the solution jigsaw is a document that
        describes how to algorithmically compare YANG schema,
        addressing Req 2.2.</t>
        <t><xref target="I-D.ietf-netmod-yang-schema-comparison" pageno="false" format="default"/>
        specifies an algorithm that can be used to compare two
        revisions of a YANG schema to determine the overall scope of
        the changes, and a list of the specific changes, between the
        two revisions.</t>
        <t>The YANG Schema Comparison solution:
        <list>
            <t>defines a algorithm for comparing two YANG schema,
          identifying the differences and classifying them as
          backwards-compatible, non-backwards-compatible or
          editorial;</t>
            <t>can be used to compare individual YANG module
          revisions;</t>
            <t>can be used to compare YANG schema defined using YANG
          packages;</t>
            <t>can filter the comparison output to the subset of the
          schema nodes that are of interest, providing a more precise
          answer for clients to determine whether they would likely be
          affected when upgrading between two schema versions;</t>
            <t>defines YANG extensions to improve the accuracy of the
          comparison algorithm by explicitly annotating the type of
          change to statements within a YANG module, for use where the
          type of change would otherwise be ambiguous to a simple
          programmatic comparison algorithm.</t>
          </list>
        </t>
      </section>
    </section>
    <section anchor="contributor" title="Contributors" numbered="true" toc="default">
      <t>This document grew out of the YANG module versioning design
    team that started after IETF 101. The following individuals are
    (or have been) members of that design team and have contributed to
    defining the problem, specifying the requirements, and working on
    a solution:</t>
      <t>
        <list style="symbols">
          <t>Balazs Lengyel</t>
          <t>Benoit Claise</t>
          <t>Ebben Aries</t>
          <t>Jason Sterne</t>
          <t>Joe Clarke</t>
          <t>Juergen Schoenwaelder</t>
          <t>Mahesh Jethanandani</t>
          <t>Michael (Wangzitao)</t>
          <t>Qin Wu</t>
          <t>Reshad Rahman</t>
          <t>Rob Wilton</t>
          <t>Susan Hares</t>
          <t>Wu Bo</t>
        </list>
      </t>
    </section>
    <section anchor="security" title="Security Considerations" numbered="true" toc="default">
      <t>
        The document does not define any new protocol or data model. There is no security impact.
      </t>
    </section>
    <section anchor="iana" title="IANA Considerations" numbered="true" toc="default">
      <t>None.</t>
    </section>
  </middle>
  <?rfc needLines="20"?>
  <back>
    <references title="Normative References">
      <reference anchor="RFC7950" target="https://www.rfc-editor.org/info/rfc7950" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7950.xml">
        <front>
          <title>The YANG 1.1 Data Modeling Language</title>
          <author initials="M." surname="Bjorklund" fullname="M. Bjorklund" role="editor">
            <organization/>
          </author>
          <date year="2016" month="August"/>
          <abstract>
            <t>YANG is a data modeling language used to model configuration data, state data, Remote Procedure Calls, and notifications for network management protocols.  This document describes the syntax and semantics of version 1.1 of the YANG language.  YANG version 1.1 is a maintenance release of the YANG language, addressing ambiguities and defects in the original specification.  There are a small number of backward incompatibilities from YANG version 1.  This document also specifies the YANG mappings to the Network Configuration Protocol (NETCONF).</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="7950"/>
        <seriesInfo name="DOI" value="10.17487/RFC7950"/>
      </reference>
      <reference anchor="I-D.ietf-netmod-yang-versioning-reqs" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-versioning-reqs.xml">
        <front>
          <title>YANG Module Versioning Requirements</title>
          <author initials="J" surname="Clarke" fullname="Joe Clarke">
            <organization/>
          </author>
          <date month="June" day="29" year="2020"/>
          <abstract>
            <t>This document describes the problems that can arise because of the YANG language module update rules, that require all updates to YANG module preserve strict backwards compatibility.  It also defines the requirements on any solution designed to solve the stated problems. This document does not consider possible solutions, nor endorse any particular solution.</t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-netmod-yang-versioning-reqs-03"/>
        <format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-netmod-yang-versioning-reqs-03.txt"/>
      </reference>
    </references>
    <references title="Informative References">
      <reference anchor="I-D.ietf-netmod-yang-packages" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-packages.xml">
        <front>
          <title>YANG Packages</title>
          <author initials="R" surname="Wilton" fullname="Robert Wilton">
            <organization/>
          </author>
          <author initials="R" surname="Rahman" fullname="Reshad Rahman">
            <organization/>
          </author>
          <author initials="J" surname="Clarke" fullname="Joe Clarke">
            <organization/>
          </author>
          <author initials="J" surname="Sterne" fullname="Jason Sterne">
            <organization/>
          </author>
          <author initials="W" surname="Bo" fullname="Wu Bo">
            <organization/>
          </author>
          <date month="March" day="17" year="2020"/>
          <abstract>
            <t>This document defines YANG packages, a versioned organizational structure holding a set of related YANG modules, that collectively define a YANG schema.  It describes how packages: are represented on a server, can be defined in offline YANG instance data documents, and can be used to define the schema associated with YANG instance data documents.</t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-netmod-yang-packages-00"/>
        <format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-netmod-yang-packages-00.txt"/>
      </reference>
      <reference anchor="I-D.ietf-netmod-yang-ver-selection" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-ver-selection.xml">
        <front>
          <title>YANG Schema Selection</title>
          <author initials="R" surname="Wilton" fullname="Robert Wilton">
            <organization/>
          </author>
          <author initials="R" surname="Rahman" fullname="Reshad Rahman">
            <organization/>
          </author>
          <author initials="J" surname="Clarke" fullname="Joe Clarke">
            <organization/>
          </author>
          <author initials="J" surname="Sterne" fullname="Jason Sterne">
            <organization/>
          </author>
          <author initials="W" surname="Bo" fullname="Wu Bo">
            <organization/>
          </author>
          <date month="March" day="17" year="2020"/>
          <abstract>
            <t>This document defines a mechanism to allow clients, using NETCONF or RESTCONF, to configure and select YANG schema for interactions with a server.  This functionality can help servers support clients using older revisions of YANG modules even if later revisions contain non- backwards-compatible changes.  It can also be used to allow clients to select between YANG schema defined by different organizations.  This draft provides a solution to YANG versioning requirements 3.1 and 3.2.</t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-netmod-yang-ver-selection-00"/>
        <format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-netmod-yang-ver-selection-00.txt"/>
      </reference>
      <reference anchor="I-D.ietf-netmod-yang-module-versioning" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-module-versioning.xml">
        <front>
          <title>Updated YANG Module Revision Handling</title>
          <author initials="R" surname="Wilton" fullname="Robert Wilton">
            <organization/>
          </author>
          <author initials="R" surname="Rahman" fullname="Reshad Rahman">
            <organization/>
          </author>
          <author initials="B" surname="Lengyel" fullname="Balazs Lengyel">
            <organization/>
          </author>
          <author initials="J" surname="Clarke" fullname="Joe Clarke">
            <organization/>
          </author>
          <author initials="J" surname="Sterne" fullname="Jason Sterne">
            <organization/>
          </author>
          <author initials="B" surname="Claise" fullname="Benoit Claise">
            <organization/>
          </author>
          <author initials="K" surname="D'Souza" fullname="Kevin D'Souza">
            <organization/>
          </author>
          <date month="July" day="10" year="2020"/>
          <abstract>
            <t>This document specifies a new YANG module update procedure that can document when non-backwards-compatible changes have occurred during the evolution of a YANG module.  It extends the YANG import statement with an earliest revision filter to better represent inter-module dependencies.  It provides help and guidelines for managing the lifecycle of YANG modules and individual schema nodes.  It provides a mechanism, via the revision-label YANG extension, to specify a revision identifier for YANG modules.  This document updates RFC 7950, RFC 8407 and RFC 8525.</t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-netmod-yang-module-versioning-01"/>
        <format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-netmod-yang-module-versioning-01.txt"/>
      </reference>
      <reference anchor="I-D.ietf-netmod-yang-semver" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-semver.xml">
        <front>
          <title>YANG Semantic Versioning</title>
          <author initials="B" surname="Claise" fullname="Benoit Claise">
            <organization/>
          </author>
          <author initials="J" surname="Clarke" fullname="Joe Clarke">
            <organization/>
          </author>
          <author initials="R" surname="Rahman" fullname="Reshad Rahman">
            <organization/>
          </author>
          <author initials="R" surname="Wilton" fullname="Robert Wilton">
            <organization/>
          </author>
          <author initials="B" surname="Lengyel" fullname="Balazs Lengyel">
            <organization/>
          </author>
          <author initials="J" surname="Sterne" fullname="Jason Sterne">
            <organization/>
          </author>
          <author initials="K" surname="D'Souza" fullname="Kevin D'Souza">
            <organization/>
          </author>
          <date month="July" day="13" year="2020"/>
          <abstract>
            <t>This document specifies a scheme and guidelines for applying a modified set of semantic versioning rules to revisions of YANG modules.  Additionally, this document defines a revision-label for this modified semver scheme.</t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-netmod-yang-semver-01"/>
        <format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-netmod-yang-semver-01.txt"/>
      </reference>
      <reference anchor="I-D.ietf-netmod-yang-schema-comparison" xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-netmod-yang-schema-comparison.xml">
        <front>
          <title>YANG Schema Comparison</title>
          <author initials="R" surname="Wilton" fullname="Robert Wilton">
            <organization/>
          </author>
          <date month="March" day="17" year="2020"/>
          <abstract>
            <t>This document specifies an algorithm for comparing two revisions of a YANG schema to determine the scope of changes, and a list of changes, between the revisions.  The output of the algorithm can be used to help select an appropriate revision-label or YANG semantic version number for a new revision.  This document defines a YANG extension that provides YANG annotations to help the tool accurately determine the scope of changes between two revisions.</t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-netmod-yang-schema-comparison-00"/>
        <format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-netmod-yang-schema-comparison-00.txt"/>
      </reference>
    </references>
    <?rfc needLines="100"?>
  </back>
</rfc>
