<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced.
     An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC6241 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC7950 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7950.xml">
<!ENTITY RFC7149 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7149.xml">
<!ENTITY RFC7426 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7426.xml">
<!ENTITY RFC8299 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8299.xml">
<!ENTITY RFC8309 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8309.xml">
<!ENTITY RFC8340 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8340.xml">
<!ENTITY RFC8453 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8453.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8345 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8345.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-ietf-netmod-system-config-06"
     ipr="trust200902" submissionType="IETF" updates="8342,6241,8526,8040">
  <front>
    <title abbrev="System-defined Configuration">System-defined
    Configuration</title>

    <author fullname="Qiufang Ma" initials="Q." role="editor" surname="Ma">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <city>Nanjing</city>

          <region>Jiangsu</region>

          <code>210012</code>

          <country>China</country>
        </postal>

        <email>maqiufang1@huawei.com</email>
      </address>
    </author>

    <author fullname="Qin Wu" initials="Q." surname="Wu">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <city>Nanjing</city>

          <region>Jiangsu</region>

          <code>210012</code>

          <country>China</country>
        </postal>

        <email>bill.wu@huawei.com</email>
      </address>
    </author>

    <author fullname="Chong Feng" initials="C." surname="Feng">
      <organization/>

      <address>
        <email>fengchongllly@gmail.com</email>
      </address>
    </author>

    <date year="2024"/>

    <area>ops</area>

    <workgroup>NETMOD</workgroup>

    <keyword>system config</keyword>

    <abstract>
      <t>This document defines how a management client and server handle
      YANG-modeled configuration data that is instantiated by the server
      itself. The system-defined configuration can be referenced (e.g.,
      leafref) by configuration explicitly created by a client.</t>

      <t>The Network Management Datastore Architecture (NMDA) defined in RFC
      8342 is updated with a read-only conventional configuration datastore
      called "system" to expose system-defined configuration.</t>

      <t>This document updates RFC 8342, RFC 6241, RFC 8526 and RFC 8040.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>The Network Management Datastore Architecture (NMDA) <xref
      target="RFC8342"/> defines system configuration as the configuration
      that is supplied by the device itself and appears in &lt;operational&gt;
      when it is in use (Figure 2 in <xref target="RFC8342"/>).</t>

      <t>However, there is a desire to enable a server to better structure and
      expose the system configuration. NETCONF/RESTCONF clients can benefit
      from a standard mechanism to retrieve what system configuration is
      available on a server.</t>

      <t>Some servers allow clients to reference a system-defined node which
      is not present in the datastore. The absence of the system configuration
      in the datastore can render the datastore invalid from the perspective
      of a client or offline tools (e.g., missing leafref targets). This
      document describes several approaches to bring the datastore to a valid
      state and satisfy referential integrity constraints.</t>

      <t>Some servers allow the descendant nodes of system-defined
      configuration to be configured or modified. For example, the system
      configuration may contain an almost empty physical interface, while the
      client needs to be able to add, modify, or remove a number of descendant
      nodes. Some descendant nodes may not be modifiable (e.g., the interface
      "type" set by the system).</t>

      <t>This document updates the Network Management Datastore Architecture
      (NMDA) defined in <xref target="RFC8342"/> with a read-only conventional
      configuration datastore called "system" to expose system-defined
      configuration.</t>

      <t>As an alternative to clients explicitly copying referenced
      system-defined configuration so that the datastore is valid, a
      "resolve-system" parameter is defined to allow the server to copy
      referenced system nodes automatically. This solution enables clients to
      reference nodes defined in &lt;system&gt;, override system-provided
      values, and configure descendant nodes of system-defined
      configuration.</t>

      <t>If a system-defined node is referenced, it refers to one of the
      following cases throughout this document:<list style="symbols">
          <t>It is present in a leafref "path" statement and referred as the
          leafref value</t>

          <t>It is used as an "instance-identifier" type value</t>

          <t>It is present in an XPath expression of "when" or "must"
          constraints</t>

          <t>It is defined to satisfy the "mandatory" constraints</t>

          <t>It is defined to exactly satisfy the "min-element"
          constraints</t>
        </list></t>

      <t>Conformance to this document requires the NMDA servers to implement
      the "ietf-system-datastore" YANG module (<xref
      target="system-datastore"/>).</t>

      <section anchor="terminology" title="Terminology">
        <t>This document assumes that the reader is familiar with the contents
        of <xref target="RFC6241"/>, <xref target="RFC7950"/>, <xref
        target="RFC8342"/>, <xref target="RFC8407"/>, and <xref
        target="RFC8525"/> and uses terminologies from those documents.</t>

        <t>The following terms are defined in this document:<list
            style="hanging">
            <t hangText="System configuration: ">Configuration that is
            provided by the system itself. System configuration is present in
            the system configuration datastore (regardless of whether it is
            applied or referenced). It is a different and separate concept
            from factory default configuration defined in <xref
            target="RFC8808"/> (which represents a preset initial
            configuration that is used to initialize the configuration of a
            server).<vspace blankLines="1"/></t>

            <t hangText="System configuration datastore: ">A configuration
            datastore holding configuration provided by the system itself.
            This datastore is referred to as "&lt;system&gt;".</t>
          </list>This document redefines the term "conventional configuration
        datastore" in <xref section="3" sectionFormat="of" target="RFC8342"/>
        to add "system" to the list of conventional configuration
        datastores:<list style="hanging">
            <t hangText="Conventional configuration datastore: ">One of the
            following set of configuration datastores: &lt;running&gt;,
            &lt;startup&gt;, &lt;candidate&gt;, &lt;system&gt;, and
            &lt;intended&gt;. These datastores share a common datastore
            schema, and protocol operations allow copying data between these
            datastores. The term "conventional" is chosen as a generic
            umbrella term for these datastores. <vspace blankLines="1"/></t>
          </list></t>
      </section>

      <section title="Requirements Language">
        <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 target="RFC8174"/> when, and only
        when, they appear in all capitals, as shown here.</t>
      </section>

      <section title="Updates to RFC 8342">
        <t>This document updates <xref format="none" target="RFC8342">RFC
        8342</xref> to define a configuration datastore called "system" to
        hold system configuration (<xref target="system-ds-def"/>), it also
        redefines the term "conventional configuration datastore" from <xref
        target="RFC8342"/> to add "system" to the list of conventional
        configuration datastores.</t>

        <t>Configuration in &lt;running&gt; is merged with &lt;system&gt; to
        create the contents of &lt;intended&gt; after the configuration
        transformations to &lt;running&gt; (e.g., template expansion, removal
        of inactive configuration defined in <xref target="RFC8342"/>) have
        been performed (<xref target="conceptual-model"/>).</t>

        <t>The definition of "intended" origin metadata annotation identity is
        also updated (<xref target="origin"/>).</t>
      </section>

      <section title="Updates to RFC 6241 and RFC 8526">
        <t>This document updates <xref format="none" target="RFC6241">RFC
        6241</xref> to augment the NETCONF &lt;edit-config&gt;,
        &lt;copy-config&gt;, &lt;validate&gt;, and &lt;commit&gt; operations
        with an additional input parameter named "resolve-system", as
        specified in <xref target="resolve-system"/>.</t>

        <t>This document also updates <xref format="none" target="RFC8526">RFC
        8526</xref> to augment the NETCONF &lt;edit-data&gt; operation with
        the "resolve-system" parameter, as specified in <xref
        target="resolve-system"/>.</t>
      </section>

      <section title="Updates to RFC 8040">
        <t>This document extends sections <xref section="4.8"
        sectionFormat="bare" target="RFC8040"/> and <xref section="9.1.1"
        sectionFormat="bare" target="RFC8040"/> in <xref target="RFC8040"/> to
        add a new query parameter "resolve-system" and corresponding query
        parameter capability URI (<xref target="RESTCONF-resolve"/>).</t>
      </section>
    </section>

    <section anchor="categories" title="Kinds of System Configuration">
      <t>This document defines two types of system configuration:
      configuration that is generated in &lt;system&gt; immediately when the
      device boots and configuration that is generated in &lt;system&gt; only
      when specific conditions being met on a device, they are described in
      <xref target="immediate"/> and <xref target="conditional"/>,
      respectively.</t>

      <section anchor="immediate" title="Immediately-Present">
        <t>Immediately-present refers to system configuration which is
        generated in &lt;system&gt; when the device is powered on,
        irrespective of physical resource present or not, a special
        functionality enabled or not. An example of immediately-present system
        configuration is an always-existing loopback interface.</t>
      </section>

      <section anchor="conditional" title="Conditionally-Present">
        <t>Conditionally-present refers to system configuration which is
        generated in &lt;system&gt; based on specific conditions being met in
        a system. For example, if a physical resource is present (e.g., an
        interface card is inserted), the system automatically detects it and
        loads associated configuration; when the physical resource is not
        present (an interface card is removed), the system configuration will
        be automatically cleared. Another example is when a special
        functionality is enabled, e.g., when a license or feature is enabled,
        specific configuration may be created by the system.</t>
      </section>
    </section>

    <section anchor="system-ds-def"
             title="The System Configuration Datastore (&lt;system&gt;)">
      <t>Following guidelines for defining datastores in the <xref section="A"
      sectionFormat="of" target="RFC8342"/>, this document introduces a new
      datastore resource named "system" that represents the system
      configuration. NMDA servers compliant with this document MUST implement
      a system configuration datastore, and they SHOULD also implement
      &lt;intended&gt;.</t>

      <t><list style="symbols">
          <t>Name: "system"</t>

          <t>YANG modules: all</t>

          <t>YANG nodes: all "config true" data nodes up to the root of the
          tree, generated by the system</t>

          <t>Management operations: The datastore can be read using network
          management protocols such as NETCONF and RESTCONF, but its contents
          cannot be changed by manage operations via NETCONF and RESTCONF
          protocols.</t>

          <t>Origin: This document does not define any new origin identity.
          The "system" origin Metadata Annotation <xref target="RFC7952"/> is
          used to indicate the origin of a data item in system (<xref
          target="origin"/>).</t>

          <t>Protocols: YANG-driven management protocols, such as NETCONF and
          RESTCONF.</t>

          <t>Defining YANG module: "ietf-system-datastore" (<xref
          target="system-datastore"/>).</t>
        </list></t>

      <t>The system configuration datastore doesn't persist across
      reboots.</t>
    </section>

    <section title="Static Characteristics of &lt;system&gt;">
      <section title="Read-only to Clients">
        <t>The system datastore is read-only (i.e., edits towards
        &lt;system&gt; directly MUST be denied), though the client may be
        allowed to override the value of a system-initialized node (see <xref
        target="modifying"/>).</t>
      </section>

      <section title="May Change via Software Upgrades or Resource Changes">
        <t>The contents of &lt;system&gt; MAY change dynamically under various
        conditions, such as license change, software upgrade, and
        system-controlled resources change (see <xref target="conditional"/>).
        The updates of system configuration may be obtained through YANG
        notifications (e.g., on-change notification) <xref
        target="RFC6470"/><xref target="RFC8639"/><xref
        target="RFC8641"/>.</t>

        <t>Generally speaking, any update of &lt;system&gt; should not cause
        the automatic update of &lt;running&gt; to not surprise clients with
        unexpected changes. In particular, the behavior of system data
        migration during software upgrade is outside the scope of this
        document. That said, here are some examples of how a server might
        handle this scenario ensuring &lt;running&gt; remains accurate:<list
            style="symbols">
            <t>Servers migrate system configuration update in
            &lt;running&gt;.</t>

            <t>Servers reject the operation to change system configuration
            (e.g., software upgrade fails) and needs the client to update the
            configuration in &lt;running&gt; as a prerequisite. Servers are
            recommended to include some hints in error responses to help
            clients understand how &lt;running&gt; should be updated.</t>
          </list></t>
      </section>

      <section title="No Impact to &lt;operational&gt;">
        <t>This work intends to have no impact to &lt;operational&gt; and does
        not define any new origin identity beyond <xref section="5.3.4"
        sectionFormat="of" target="RFC8342"/>. The existence of &lt;system&gt;
        enables a subset of those system generated nodes to be defined like
        configuration, i.e., made visible to clients in order for being
        referenced or configurable prior to present in &lt;operational&gt;.
        "config false" nodes are out of scope, hence existing "config false"
        nodes are not impacted by this work.</t>
      </section>
    </section>

    <section title="Dynamic Behaviors">
      <section anchor="conceptual-model"
               title="Conceptual Model of Datastores">
        <t>Clients MAY reference nodes defined in &lt;system&gt;, override
        system-provided values, and configure descendant nodes of
        system-defined configuration in &lt;running&gt;.</t>

        <t>To ensure the validity of &lt;intended&gt;, configuration in
        &lt;running&gt; is merged with &lt;system&gt; to become
        &lt;intended&gt;, in which process, configuration appearing in
        &lt;running&gt; takes precedence over the same node in &lt;system&gt;.
        If &lt;running&gt; includes configuration that requires further
        transformation (e.g., template expansion, removal of inactive
        configuration defined in <xref target="RFC8342"/>) before it can be
        applied, configuration transformations MUST be performed before
        &lt;running&gt; is merged with &lt;system&gt;.</t>

        <t>Whenever configuration in &lt;system&gt; changes, the server MUST
        also immediately update and validate &lt;intended&gt;.</t>

        <t>As a result, Figure 2 in <xref section="5" sectionFormat="of"
        target="RFC8342"/> is updated with the below conceptual model of
        datastores which incorporates the system configuration
        datastore.<figure title="Architectural Model of Datastores">
            <artwork>               +-------------+                 +-----------+
               | &lt;candidate&gt; |                 | &lt;startup&gt; |
               |  (ct, rw)   |&lt;---+      +----&gt;| (ct, rw)  |
               +-------------+    |      |     +-----------+
                      |           |      |           |
+-----------+         |        +-----------+         |
| &lt;system&gt;  |         +-------&gt;| &lt;running&gt; |&lt;--------+
| (ct, ro)  |                  | (ct, rw)  |
+-----------+                  +-----------+
     |                              | // configuration transformations,
     |                              | // e.g., removal of nodes marked
     |           // merge           | // as "inactive", expansion of
     +--------------+---------------+ // templates
                    |
                    |
                    v
              +------------+
              | &lt;intended&gt; |  // subject to validation
              | (ct, ro)   |
              +------------+
                     |       // changes applied, subject to
                     |       // local factors, e.g., missing
                     |       // resources, delays
 dynamic             |
 configuration       |   +-------- learned configuration
 datastores -----+   |   +-------- default configuration
                 |   |   |
                 v   v   v
             +---------------+
             | &lt;operational&gt; | &lt;-- system state
             | (ct + cf, ro) |
             +---------------+

ct = config true; cf = config false
rw = read-write; ro = read-only
boxes denote named datastores</artwork>
          </figure></t>

        <t>Configuration in &lt;system&gt; is non-deletable to clients, even
        though a client may delete a copied system node from &lt;running&gt;.
        If system initializes a value for a particular leaf which is
        overridden by the client with a different value in &lt;running&gt;,
        the client may delete it in &lt;running&gt;, in which case
        system-initialized value defined in &lt;system&gt; may still be in use
        and appear in &lt;operational&gt;.</t>

        <section anchor="origin" title="Origin Metadata Annotation">
          <t>This document does not define any new origin identity when
          &lt;system&gt; interacts with &lt;intended&gt; and flows into
          &lt;operational&gt;.</t>

          <t>The "intended" identity of origin value defined in <xref
          target="RFC8342"/> to represent the origin of configuration provided
          by &lt;intended&gt;, this document updates its definition as origin
          source of configuration explicitly provided by &lt;running&gt;, and
          allows a subset of configuration in &lt;intended&gt; that flows from
          &lt;system&gt; yet is not configured or overridden explicitly in
          &lt;running&gt; to use "system" as its origin value.</t>

          <t>Configuration copied from &lt;system&gt; into &lt;running&gt; has
          its origin value reported as "intended" when it flows into
          &lt;operational&gt;.</t>
        </section>
      </section>

      <section title="Explicit Declaration of System Configuration">
        <t>It is possible for a client to explicitly declare system
        configuration nodes with the same values as in &lt;system&gt;, by
        configuring a node (list/leaf-list entry, leaf, etc.) in the target
        datastore (e.g., &lt;candidate&gt; and &lt;running&gt;) that matches
        the same node and value in &lt;system&gt;.</t>

        <t>The explicit declaration of system-defined nodes can be useful, for
        example, when the client does not support the "resolve-system"
        parameter but needs the datastore to be referentially complete. The
        client can explicitly copy the list entries (with at least the keys)
        that are referenced elsewhere in the datastore. The client does not
        necessarily need to declare all the contents of the list entry (i.e.
        the descendant nodes), only the parts that are required to make the
        datastore appear valid.</t>
      </section>

      <section anchor="resolve-system"
               title="Servers Auto-configuring Referenced System Configuration (&quot;resolve-system&quot; parameter)">
        <t>This document defines a new parameter "resolve-system" to the input
        for some of the NETCONF and RESTCONF operations. Clients that are
        aware of the "resolve-system" parameter MAY use this parameter to
        avoid the requirement to provide a referentially complete
        configuration.</t>

        <t>The "resolve-system" parameter is optional and has no value. If it
        is present, and the server supports this capability, the server MUST
        copy referenced system nodes into the target datastore (e.g.,
        &lt;candidate&gt; and &lt;running&gt;) where it is missing from
        without the client doing the copy/paste explicitly, to resolve any
        references not resolved by the client. If any child node of the copied
        configuration has its value being set by the system that is not the
        schema default value, it MUST also be copied into the target datastore
        (<xref target="defaults"/>). The copy operation MUST NOT overwrite any
        explicit configuration in &lt;running&gt;. The server copies the
        referenced system-defined nodes only when triggered by the
        "resolve-system" parameter. Legacy clients don't see any changes in
        the server behaviors.</t>

        <t>The server may automatically configure the list entries (with at
        least the keys) that are referenced elsewhere by the clients.
        Similarly, not all the contents of the list entry (i.e., the
        descendant nodes) are necessarily copied by the server - only the
        parts that are required to make configuration valid.</t>

        <t>There is no distinction between the configuration automatically
        configured by the server and the one explicitly declared by the
        client, e.g., a read back of the datastore (e.g., NETCONF
        &lt;get&gt;/&lt;get-config&gt;/&lt;get-data&gt; operation, or RESTCONF
        GET method) returns automatically configured nodes.</t>

        <t>Note that even though an auto-configured node is allowed to be
        deleted from the target datastore by the client, the system may
        automatically recreate the deleted node to make configuration valid,
        when a "resolve-system" parameter is carried. It is also possible that
        the operation request (e.g., &lt;edit-config&gt;) may not succeed due
        to incomplete referential integrity.</t>

        <t>Support for the "resolve-system" parameter is OPTIONAL. Servers not
        supporting NMDA <xref target="RFC8342"/> MAY also implement this
        parameter without implementing the system configuration datastore,
        which would only eliminate the ability to retrieve the system
        configuration via protocol operations. If a server implements
        &lt;system&gt;, referenced system configuration is copied from
        &lt;system&gt; into the target datastore when the "resolve-system"
        parameter is used; otherwise it is an implementation decision where to
        copy referenced system configuration.</t>

        <section anchor="NETCONF-resolve"
                 title="NETCONF Support for &quot;resolve-system&quot; Parameter">
          <t>This document defines a NETCONF protocol capability to indicate
          support for this parameter. NETCONF server that supports
          "resolve-system" parameter MUST advertise the following capability
          identifier:<figure>
              <artwork>urn:ietf:params:netconf:capability:resolve-system:1.0</artwork>
            </figure></t>
        </section>

        <section anchor="RESTCONF-resolve"
                 title="RESTCONF Support for &quot;resolve-system&quot; Parameter">
          <section title="Query Parameter">
            <t>The "resolve-system" parameter may be present in the request
            URI of some RESTCONF operations as shown in <xref
            target="RESTCONF-fig"/>. This parameter is only allowed with no
            values carried. If this parameter has any unexpected value, then a
            "400 Bad Request" status-line is returned.<figure
                anchor="RESTCONF-fig"
                title="RESTCONF &quot;resolve-system&quot; Query Parameter">
                <artwork>+----------------+---------+-----------------------------------------+
| Name           | Methods | Description                             |
+----------------+---------+-----------------------------------------+
|resolve-system  | POST,   | resolve any references not resolved by  |
|                | PUT     | the client and copy referenced          |
|                | PATCH   | system configuration into &lt;running&gt;     |
|                |         | automatically. This parameter can be    |
|                |         | given in any order.                     |
+----------------+---------+-----------------------------------------+</artwork>
              </figure></t>

            <section title="Query Parameter URI">
              <t>To enable a RESTCONF client to discover if the
              "resolve-system" query parameter is supported by the server, the
              following capability URI is defined, which is advertised by the
              server if supported, using the "ietf-restconf-monitoring" module
              defined in <xref target="RFC8040"/>:<figure>
                  <artwork>urn:ietf:params:restconf:capability:resolve-system:1.0</artwork>
                </figure></t>
            </section>
          </section>
        </section>
      </section>

      <section anchor="modifying"
               title="Modifying (Overriding) System Configuration">
        <t>In some cases, a server may allow some parts of system
        configuration to be modified. Modification of system configuration is
        achieved by the client writing configuration to &lt;running&gt; that
        overrides the system configuration. Configurations defined in
        &lt;running&gt; take precedence over system configuration nodes in
        &lt;system&gt; if the server allows the nodes to be modified.</t>

        <t>For instance, descendant nodes in a system-defined list entry may
        be modifiable or not, even if some system configuration has been
        copied into &lt;running&gt; earlier. If a system node is
        non-modifiable, then writing a different value for that node MUST
        return an error during a &lt;edit-config&gt;, &lt;validate&gt; or
        &lt;commit&gt; operation, depending on the target datastore. The
        immutability of system configuration is defined in <xref
        target="I-D.ietf-netmod-immutable-flag"/>.</t>
      </section>

      <section title="Examples">
        <t>This section presents some sample data models and corresponding
        contents of various datastores with different dynamical behaviors
        above. The XML snippets are used only for examples.</t>

        <section anchor="automatical"
                 title="Server Configuring of &lt;running&gt; Automatically">
          <t>In this subsection, the following fictional module is used:</t>

          <t><figure>
              <artwork><![CDATA[
module example-application {
  yang-version 1.1;
  namespace "urn:example:application";
  prefix "app";
           
  import ietf-inet-types {
    prefix "inet";
  }
  container applications {
    list application {
      key "name";
      leaf name {
        type string;
      }
      leaf protocol {
        type enumeration {
          enum tcp;
          enum udp;
        }
      }
      leaf destination-port {
        type inet:port-number;
      }
    }
  }
}  
              ]]></artwork>
            </figure></t>

          <t>The server may predefine some applications as a convenience for
          clients. The system-instantiated application entries may be present
          in &lt;system&gt; as follows:</t>

          <figure>
              <artwork><![CDATA[
<applications xmlns="urn:example:application">  
  <application> 
    <name>ftp</name>  
    <protocol>tcp</protocol>  
    <destination-port>21</destination-port> 
  </application>  
  <application> 
    <name>tftp</name>  
    <protocol>udp</protocol>  
    <destination-port>69</destination-port> 
  </application>  
  <application> 
    <name>smtp</name>  
    <protocol>tcp</protocol>  
    <destination-port>25</destination-port> 
  </application> 
</applications>
              ]]></artwork>
          </figure>

          <t>The client may also define its customized applications. Suppose
          the configuration of applications is present in &lt;running&gt; as
          follows:<figure>
              <artwork><![CDATA[
<applications xmlns="urn:example:application">  
  <application> 
    <name>my-app-1</name>  
    <protocol>tcp</protocol>  
    <destination-port>2345</destination-port> 
  </application>  
  <application> 
    <name>my-app-2</name>  
    <protocol>udp</protocol>  
    <destination-port>69</destination-port> 
  </application> 
</applications>
              ]]></artwork>
            </figure></t>

          <t>A fictional ACL YANG module is used as follows, which defines a
          leafref for the leaf-list "application" data node to refer to an
          existing application name.<figure>
              <artwork><![CDATA[
module example-acl {
  yang-version 1.1;
  namespace "urn:example:acl";
  prefix "acl";

  import example-application {
    prefix "app";
  }

  import ietf-inet-types {
    prefix "inet";
  }

  container acl {
    list acl-rule {
      key "name";
      leaf name {
        type string;
      }
      container matches {
        choice l3 {
          container ipv4 {
            leaf src-address {
              type inet:ipv4-prefix;
            }
            leaf dst-address {
              type inet:ipv4-prefix;
            }
          }
        }
        choice applications {
          leaf-list application {
            type leafref {
            path "/app:applications/app:application/app:name";
            }
          }
        }
      }
      leaf packet-action {
        type enumeration {
          enum forward;
          enum drop;
          enum redirect;
        }
      }
    }
  }
}
              ]]></artwork>
            </figure></t>

          <t>If a client configures an ACL rule referencing system provided
          applications which are not present in &lt;running&gt;, the client
          may issue an &lt;edit-config&gt; operation with the parameter
          "resolve-system" to the NETCONF server as follows:<figure>
              <artwork><![CDATA[
<rpc message-id="101"
     xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <acl xmlns="urn:example:acl">
        <acl-rule>
          <name>allow-access-to-ftp-tftp</name>
          <matches>
            <ipv4>
              <src-address>198.51.100.0/24</src-address>
              <dst-address>192.0.2.0/24</dst-address>
            </ipv4>
            <application>ftp</application>
            <application>tftp</application>
            <application>my-app-1</application>
          </matches>
          <packet-action>forward</packet-action>
        </acl-rule>
      </acl>
    </config>
    <resolve-system/>
  </edit-config>
</rpc>

              ]]></artwork>
            </figure></t>

          <t>The following gives the configuration of applications in
          &lt;running&gt; which is returned in the response to a follow-up
          retrieval operation:<figure>
              <artwork><![CDATA[
<applications xmlns="urn:example:application">  
  <application> 
    <name>my-app-1</name>  
    <protocol>tcp</protocol>  
    <destination-port>2345</destination-port> 
  </application>  
  <application> 
    <name>my-app-2</name>  
    <protocol>udp</protocol>  
    <destination-port>69</destination-port> 
  </application>  
  <application> 
    <name>ftp</name> 
  </application>  
  <application> 
    <name>tftp</name> 
  </application> 
</applications>

              ]]></artwork>
            </figure></t>

          <t>And the configuration of applications is present in
          &lt;operational&gt; as follows:<figure>
              <artwork><![CDATA[
<applications xmlns="urn:example:application" 
              xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin" 
              or:origin="or:intended">
  <application>
    <name>my-app-1</name>
    <protocol>tcp</protocol>
    <destination-port>2345</destination-port>
  </application>
  <application>
    <name>my-app-2</name>
    <protocol>udp</protocol>
    <destination-port>69</destination-port>
  </application>
  <application>
    <name>ftp</name>
    <protocol or:origin="or:system">tcp</protocol>
    <destination-port or:origin="or:system">21</destination-port>
  </application>
  <application>
    <name>tftp</name>
    <protocol or:origin="or:system">udp</protocol>
    <destination-port or:origin="or:system">69</destination-port>
  </application>
</applications>
              ]]></artwork>
            </figure>Since the configuration of application "smtp" is not
          referenced by the client, some implementation may consider it not to
          be "in use", hence it is omitted from &lt;operational&gt; but only
          present in &lt;system&gt;.</t>
        </section>

        <section title="Declaring a System-defined Node in &lt;running&gt; Explicitly">
          <t>It's also possible for a client to explicitly declare the
          system-defined configurations that are referenced instead of using
          the "resolve-system" parameter. For instance, in the above example,
          the client MAY also explicitly configure the following system
          defined applications "ftp" and "tftp" only with the list key
          "name":<figure>
              <artwork><![CDATA[
<applications xmlns="urn:example:application">  
  <application> 
    <name>ftp</name> 
  </application>  
  <application> 
    <name>tftp</name> 
  </application> 
</applications>
              ]]></artwork>
            </figure></t>

          <t>And the configuration of ACL rules referencing application "ftp"
          and "tftp" are as follows:<figure>
              <artwork><![CDATA[
<acl xmlns="urn:example:acl">
  <acl-rule>
    <name>allow-access-to-ftp-tftp</name>
    <matches>
      <ipv4>
        <src-address>198.51.100.0/24</src-address>
        <dst-address>192.0.2.0/24</dst-address>
      </ipv4>
      <application>ftp</application>
      <application>tftp</application>
      <application>my-app-1</application>
    </matches>
    <packet-action>forward</packet-action>
  </acl-rule>
</acl>
              ]]></artwork>
            </figure></t>

          <t>Once the data is written to &lt;running&gt;, it makes no
          difference whether it is explicitly declared by the client or
          automatically copied by the server. The configuration for
          applications in &lt;running&gt; and &lt;operational&gt; would be
          identical to the ones in <xref target="automatical"/>.</t>
        </section>

        <section title="Modifying a System-instantiated Leaf's Value">
          <t>This subsection uses the following fictional interface YANG
          module:<figure>
              <artwork><![CDATA[
module example-interface {
  yang-version 1.1;
  namespace "urn:example:interface";
  prefix "exif";

  import ietf-inet-types {
    prefix "inet";
  }
  
  container interfaces {
    list interface {
      key name;
      leaf name {
        type string;
      }
      leaf description {
        type string;
      }
      leaf mtu {
        type uint32;
      }
      leaf-list ip-address {
        type inet:ip-address;
      }
    }
  }
}

              ]]></artwork>
            </figure></t>

          <t>Suppose the system provides a loopback interface (named "lo0")
          with a MTU value "65536", a default IPv4 address of "127.0.0.1", and
          a default IPv6 address of "::1". The configuration of "lo0"
          interface is present in &lt;system&gt; as follows:<figure>
              <artwork><![CDATA[
<interfaces xmlns="urn:example:interface">
  <interface>
    <name>lo0</name>
    <mtu>65536</mtu>
    <ip-address>127.0.0.1</ip-address>
    <ip-address>::1</ip-address>
  </interface>
</interfaces>
              ]]></artwork>
            </figure></t>

          <t>A client modifies the value of MTU to 9216 and adds the following
          configuration into &lt;running&gt;:</t>

          <figure>
              <artwork><![CDATA[
<interfaces xmlns="urn:example:interface">
  <interface>
    <name>lo0</name>
    <mtu>9216</mtu>
  </interface>
</interfaces>
              ]]></artwork>
          </figure>

          <t>Then the configuration of interfaces is present in
          &lt;operational&gt; as follows:<figure>
              <artwork><![CDATA[
<interfaces xmlns="urn:example:interface" 
            xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin" 
            or:origin="or:intended">
  <interface>
    <name>lo0</name>
    <mtu>65535</mtu>
    <ip-address or:origin="or:system">127.0.0.1</ip-address>
    <ip-address or:origin="or:system">::1</ip-address>
  </interface>
</interfaces>
              ]]></artwork>
            </figure></t>
        </section>

        <section title="Configuring Descendant Nodes of a System-defined Node">
          <t>In the above example, image the client further configures the
          description node of a "lo0" interface in &lt;running&gt; as
          follows:</t>

          <figure>
              <artwork><![CDATA[
<interfaces xmlns="urn:example:interface">  
  <interface> 
    <name>lo0</name>  
    <description>loopback</description> 
  </interface> 
</interfaces>
              ]]></artwork>
          </figure>

          <t>The configuration of interface "lo0" is present in
          &lt;operational&gt; as follows:<figure>
              <artwork><![CDATA[
<interfaces xmlns="urn:example:interface" 
            xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin" 
            or:origin="or:intended">
  <interface>
    <name>lo0</name>
    <description>loopback</description>
    <mtu>65535</mtu>
    <ip-address or:origin="or:system">127.0.0.1</ip-address>
    <ip-address or:origin="or:system">::1</ip-address>
  </interface>
</interfaces>
              ]]></artwork>
            </figure></t>
        </section>
      </section>
    </section>

    <section anchor="defaults" title="Default Interactions">
      <t>&lt;system&gt; should not contain the configuration using the schema
      default value, either specified in the "default" statement or described
      in the "description" statement.</t>

      <t>Any value provided by the system that is not the schema default value
      MUST be contained in &lt;system&gt;. If system provides a value that is
      not the schema default value, and the node is not explicitly set by the
      client, it MUST be copied into the target datastore when its closest
      ancestor node needs to be copied to satisfy referential integrity
      constraints.</t>
    </section>

    <section title="Relation to Other Datastores">
      <section title="The &quot;factory-default&quot; Datastore">
        <t>Any deletable system-provided configuration that is populated as
        part of &lt;running&gt; by the system at boot up, without being part
        of the contents of a &lt;startup&gt; datastore, must be defined in
        &lt;factory-default&gt; <xref target="RFC8808"/>, which is used to
        initialize &lt;running&gt; when the device is first-time powered on or
        reset to its factory default condition.</t>

        <t>The &lt;factory-reset&gt; RPC operation can reset &lt;system&gt; to
        its factory default contents.</t>
      </section>

      <section title="The &quot;candidate&quot; Datastore">
        <t>If the device supports the :candidate or :private-candidate <xref
        target="I-D.ietf-netconf-privcand"/> capability, a client may edit the
        candidate or private-candidate datastore without expecting it to be
        valid until a &lt;commit&gt; or &lt;validate&gt; operation takes
        place. The client may use the "resolve-system" parameter in one of the
        following situations: <list style="symbols">
            <t>The client makes an edit (e.g., NETCONF
            &lt;edit-config&gt;/&lt;edit-data&gt;, or RESTCONF edit operation)
            to the candidate/private-candidate datastore. This is possible,
            though may not be required.</t>

            <t>The client issues a &lt;validate&gt; operation.</t>

            <t>The client issues a &lt;commit&gt; operation.</t>
          </list></t>

        <t>In particular, <xref target="I-D.ietf-netconf-privcand"/> defines
        the concept of conflict, the server's copy referenced system nodes
        triggered by "resolve-system" parameter might conflict with the
        contents of &lt;running&gt;, the conflict resolution is no different
        than the resolution of conflict caused by configuration explicitly
        provided by the client.</t>
      </section>
    </section>

    <section anchor="system-datastore"
             title="The &quot;ietf-system-datastore&quot; Module">
      <section title="Data Model Overview">
        <t>This YANG module defines a new YANG identity named "system" that
        uses the "ds:datastore" identity defined in [RFC8342]. A client can
        discover the system configuration datastore support on the server by
        reading the YANG library information from the operational state
        datastore.</t>

        <t>The system datastore is defined as a conventional configuration
        datastore and shares a common datastore schema with other conventional
        datastores.</t>

        <t>The following diagram illustrates the relationship amongst the
        "identity" statements defined in the "ietf-system-datastore" and
        "ietf-datastores" YANG modules: <figure>
            <artwork>Identities:
    +--- datastore
    |  +--- conventional
    |  |  +--- running
    |  |  +--- candidate
    |  |  +--- startup
    |  |  +--- system
    |  |  +--- intended
    |  +--- dynamic
    |  +--- operational</artwork>
          </figure>The diagram above uses syntax that is similar to but not
        defined in <xref target="RFC8340"/>.</t>
      </section>

      <section title="Example Usage">
        <t>This section gives an example of data retrieval from
        &lt;system&gt;. The fictional YANG module used following are from
        Appendix C.2 of [RFC8342].</t>

        <figure>
          <artwork>container bgp {
  leaf local-as {
    type uint32;
  }
  leaf peer-as {
    type uint32;
  }
  list peer {
    key name;
    leaf name {
      type inet:ip-address;
    }
    leaf local-as {
      type uint32;
      description
        "... Defaults to ../local-as.";
    }
    leaf peer-as {
      type uint32;
      description
        "... Defaults to ../peer-as.";
    }
    leaf local-port {
      type inet:port;
    }
    leaf remote-port {
      type inet:port;
      default 179;
    }
    leaf state {
      config false;
      type enumeration {
        enum init;
        enum established;
        enum closing;
      }
    }
  }
}</artwork>
        </figure>

        <t>All the messages are presented in a protocol-independent manner.
        JSON is used to not imply a preferred encoding in this document.</t>

        <t>Suppose the following BGP peer configuration is added to
        &lt;running&gt;:</t>

        <figure>
          <artwork>{
    "bgp": {
        "local-as": "64501", 
        "peer-as": "64502", 
        "peer": {
            "name": "2001:db8::2:3",
            "local-as": "64501",
            "peer-as": "64502"
        }
    }
}</artwork>
        </figure>

        <t>The local port and remote port are used when the BGP peer
        connection is established. Since both are not supplied explicitly in
        &lt;running&gt; and &lt;intended&gt;, the default value for
        "bgp/peer/remote-port" is used, and there is no default statement for
        "bgp/peer/local-port", the system will select a value for it. So the
        contents of &lt;system&gt; are shown as follows:</t>

        <figure>
          <artwork>{
    "bgp": {
        "peer": {
            "name": "2001:db8::2:3",
            "local-port": "60794"
        }
    }
}</artwork>
        </figure>
      </section>

      <section title="YANG Module">
        <figure>
          <preamble>&lt;CODE BEGINS&gt; file
          "ietf-system-datastore@2024-05-31.yang"</preamble>

              <artwork><![CDATA[
module ietf-system-datastore {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-system-datastore";
  prefix sysds;

  import ietf-datastores {
    prefix ds;
    reference
      "RFC 8342: Network Management Datastore Architecture(NMDA)";
  }

  organization
    "IETF NETDOD (Network Modeling) Working Group";
  contact
    "WG Web:   https://datatracker.ietf.org/wg/netmod/
     WG List:  NETMOD WG list <mailto:netmod@ietf.org>
     
     Author: Qiufang Ma
             <mailto:maqiufang1@huawei.com>
     Author: Qin Wu
             <mailto:bill.wu@huawei.com>
     Author: Chong Feng
             <mailto:fengchongllly@gmail.com>";
  description
    "This module defines a new YANG identity that uses the
     ds:datastore identity defined in [RFC8342].

     Copyright (c) 2024 IETF Trust and the persons identified
     as authors of the code. All rights reserved.

     Redistribution and use in source and binary forms, with
     or without modification, is permitted pursuant to, and
     subject to the license terms contained in, the Revised
     BSD License set forth in Section 4.c of the IETF Trust's
     Legal Provisions Relating to IETF Documents
     (https://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX
     (https://www.rfc-editor.org/info/rfcXXXX); see the RFC
     itself for full legal notices.

     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 (RFC 2119)
     (RFC 8174) when, and only when, they appear in all
     capitals, as shown here.";

  revision 2024-05-31 {
    description
      "Initial version.";
    reference
      "RFC XXXX: System-defined Configuration";
  }

  identity system {
    base ds:conventional;
    description
      "This read-only datastore contains the configuration
       provided by the system itself.";
  }
}
]]></artwork>

          <postamble>&lt;CODE ENDS&gt;</postamble>
        </figure>
      </section>
    </section>

    <section title="The &quot;ietf-netconf-resolve-system&quot; Module">
      <t>This YANG module is optional to implement.</t>

      <section title="Data Model Overview">
        <t>The following tree diagram <xref target="RFC8340"/> illustrates the
        "ietf-netconf-resolve-system" module:</t>

        <figure>
          <artwork>module: ietf-netconf-resolve-system
  augment /nc:edit-config/nc:input:
    +---w resolve-system?   empty
  augment /nc:copy-config/nc:input:
    +---w resolve-system?   empty
  augment /nc:validate/nc:input:
    +---w resolve-system?   empty
  augment /nc:commit/nc:input:
    +---w resolve-system?   empty
  augment /ncds:edit-data/ncds:input:
    +---w resolve-system?   empty</artwork>
        </figure>
      </section>

      <section title="Example Usage">
        <t>Please refer to <xref target="automatical"/> for example usage of
        the "resolve-system" parameter.</t>
      </section>

      <section title="YANG Module">
        <t>This module imports modules "ietf-netconf" and "ietf-netconf-nmda",
        defined in <xref target="RFC6241"/> and <xref target="RFC8526"/>,
        respectively.</t>

        <figure>
          <preamble>&lt;CODE BEGINS&gt; file
          "ietf-netconf-resolve-system@2024-05-31.yang"</preamble>

              <artwork><![CDATA[
module ietf-netconf-resolve-system {
  yang-version 1.1;
  namespace
    "urn:ietf:params:xml:ns:yang:ietf-netconf-resolve-system";
  prefix ncrs;

  import ietf-netconf {
    prefix nc;
    reference
      "RFC 6241: Network Configuration Protocol (NETCONF)";
  }
  import ietf-netconf-nmda {
    prefix ncds;
    reference
      "RFC 8526: NETCONF Extensions to Support the Network
       Management Datastore Architecture";
  }

  organization
    "IETF NETMOD (Network Modeling) Working Group";
  contact
    "WG Web:   <https://datatracker.ietf.org/wg/netmod/>
     WG List:  <mailto:netmod@ietf.org>

     Author: Qiufang Ma
             <mailto:maqiufang1@huawei.com>
     Author: Qin Wu
             <mailto:bill.wu@huawei.com>
     Author: Chong Feng
             <mailto:fengchongllly@gmail.com>";
  description
    "This module defines an extension to the NETCONF protocol
     that allows the NETCONF client to control whether the server
     is allowed to copy referenced system configuration
     automatically without the client doing so explicitly.

      Copyright (c) 2024 IETF Trust and the persons identified
      as authors of the code. All rights reserved.

      Redistribution and use in source and binary forms, with
      or without modification, is permitted pursuant to, and
      subject to the license terms contained in, the Revised
      BSD License set forth in Section 4.c of the IETF Trust's
      Legal Provisions Relating to IETF Documents
      (https://trustee.ietf.org/license-info).

      This version of this YANG module is part of RFC XXXX
      (https://www.rfc-editor.org/info/rfcXXXX); see the RFC
      itself for full legal notices.

      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 (RFC 2119)
      (RFC 8174) when, and only when, they appear in all
      capitals, as shown here.";

  revision 2024-05-31 {
    description
      "Initial version.";
    reference
      "RFC XXXX: System-defined Configuration";
  }

  grouping resolve-system-grouping {
    description
      "Define the resolve-system parameter grouping.";
    leaf resolve-system {
      type empty;
      description
        "When present, the server MUST copy referenced system
         configuration into the target configuration datastore
         where it is missing from without the client doing the
         copy/paste explicitly.";
    }
  }

  augment "/nc:edit-config/nc:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <edit-config> operation.";
    uses resolve-system-grouping;
  }

  augment "/nc:copy-config/nc:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <copy-config> operation.";
    uses resolve-system-grouping;
  }
  augment "/nc:validate/nc:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <validate> operation.";
    uses resolve-system-grouping;
  }
  augment "/nc:commit/nc:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <commit> operation.";
    uses resolve-system-grouping;
  }
  augment "/ncds:edit-data/ncds:input" {
    description
      "Adds the 'resolve-system' parameter to the input of the
       NETCONF <edit-data> operation.";
    uses resolve-system-grouping;
  }
}

]]></artwork>

          <postamble>&lt;CODE ENDS&gt;</postamble>
        </figure>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <section title="The &quot;IETF XML&quot; Registry">
        <t>This document registers two XML namespace URNs in the 'IETF XML
        registry', following the format defined in <xref
        target="RFC3688"/>.</t>

        <figure>
          <artwork>   URI: urn:ietf:params:xml:ns:yang:ietf-system-datastore
   Registrant Contact: The IESG.
   XML: N/A, the requested URIs are XML namespaces.

   URI: urn:ietf:params:xml:ns:yang:ietf-netconf-resolve-system
   Registrant Contact: The IESG.
   XML: N/A, the requested URIs are XML namespaces.</artwork>
        </figure>
      </section>

      <section title="The &quot;YANG Module Names&quot; Registry">
        <t>This document registers two module names in the 'YANG Module Names'
        registry, defined in <xref target="RFC6020"/>.</t>

        <figure>
          <artwork>      name: ietf-system-datastore
      prefix: sys
      namespace: urn:ietf:params:xml:ns:yang:ietf-system-datatstore
      maintained by IANA: N
      RFC: XXXX // RFC Ed.: replace XXXX and remove this comment


      name: ietf-netconf-resolve-system
      prefix: ncrs
      namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-resolve-system
      maintained by IANA: N
      RFC: XXXX // RFC Ed.: replace XXXX and remove this comment</artwork>
        </figure>
      </section>

      <section title="NETCONF Capability URN Registry">
        <t>This document registers the following capability identifier URN in
        the 'Network Configuration Protocol (NETCONF) Capability URNs'
        registry:<figure>
            <artwork>urn:ietf:params:netconf:capability:resolve-system:1.0</artwork>
          </figure></t>
      </section>

      <section title="RESTCONF Capability URN Registry">
        <t>This document registers a capability in the 'RESTCONF Capability
        URNs' registry [RFC8040]:<figure>
            <artwork>Index            Capability Identifier
-----------------------------------------------------------------------
:resolve-system  urn:ietf:params:restconf:capability:resolve-system:1.0</artwork>
          </figure></t>
      </section>
    </section>

    <section anchor="scecurity" title="Security Considerations">
      <section title="Regarding the &quot;ietf-system-datastore&quot; YANG Module">
        <t>The YANG module defined in this document extends the base
        operations for NETCONF <xref target="RFC6241"/> and RESTCONF <xref
        target="RFC8040"/>. The lowest NETCONF layer is the secure transport
        layer, and the mandatory-to-implement secure transport is Secure Shell
        (SSH) <xref target="RFC6242"/>. The lowest RESTCONF layer is HTTPS,
        and the mandatory-to-implement secure transport is TLS <xref
        target="RFC8446"/>.</t>

        <t>The Network Configuration Access Control Model (NACM) <xref
        target="RFC8341"/> provides the means to restrict access for
        particular NETCONF users to a preconfigured subset of all available
        NETCONF protocol operations and content.</t>
      </section>

      <section title="Regarding the &quot;ietf-netconf-resolve-system&quot; YANG Module">
        <t>The YANG module defined in this document extends the base
        operations for NETCONF <xref target="RFC6241"/> and <xref
        target="RFC8526"/>. The lowest NETCONF layer is the secure transport
        layer, and the mandatory-to-implement secure transport is Secure Shell
        (SSH) <xref target="RFC6242"/>. The lowest RESTCONF layer is HTTPS,
        and the mandatory-to-implement secure transport is TLS <xref
        target="RFC8446"/>.</t>

        <t>The Network Configuration Access Control Model (NACM) <xref
        target="RFC8341"/> provides the means to restrict access for
        particular NETCONF users to a preconfigured subset of all available
        NETCONF protocol operations and content.</t>

        <t>The security considerations for the base NETCONF protocol
        operations (see Section 9 of <xref target="RFC6241"/> apply to the new
        extended RPC operations defined in this document. There is not any
        beyond the potential performance impacts of implementing the
        "resolve-system" parameter, which may mean employing some form of rate
        limiting or adapting the rate threshold might be a good idea to avoid
        DoS attacks.</t>
      </section>
    </section>
  </middle>

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

      <?rfc include="reference.RFC.6241.xml"?>

      <?rfc include="reference.RFC.6470.xml"?>

      <?rfc include="reference.RFC.7950.xml"?>

      <?rfc include="reference.RFC.8040.xml"?>

      <?rfc include="reference.RFC.8341.xml"?>

      <?rfc include="reference.RFC.8342.xml"?>

      <?rfc include="reference.RFC.8526.xml"?>

      <?rfc include="reference.RFC.8639.xml"?>

      <?rfc include="reference.RFC.8641.xml"?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.3688.xml"?>

      <?rfc include="reference.RFC.6020.xml"?>

      <?rfc include="reference.RFC.6242.xml"?>

      <?rfc include="reference.RFC.7952.xml"?>

      <?rfc include="reference.RFC.8174.xml"?>

      <?rfc include="reference.RFC.8340.xml"?>

      <?rfc include="reference.RFC.8407.xml"?>

      <?rfc include="reference.RFC.8446.xml"?>

      <?rfc include="reference.RFC.8525.xml"?>

      <?rfc include="reference.RFC.8808.xml"?>

      <xi:include href="https://datatracker.ietf.org/doc/bibxml3/reference.I-D.ietf-netmod-immutable-flag.xml"
                  xmlns:xi="http://www.w3.org/2001/XInclude"/>

      <xi:include href="https://datatracker.ietf.org/doc/bibxml3/reference.I-D.ietf-netconf-privcand.xml"
                  xmlns:xi="http://www.w3.org/2001/XInclude"/>
    </references>

    <section title="Key Use Cases">
      <t>Following provides three use cases related to how &lt;system&gt;
      interacts with other datastores (e.g., &lt;running&gt;,
      &lt;intended&gt;, and &lt;operational&gt;). The simple interface data
      model defined in <xref section="C.3" sectionFormat="of"
      target="RFC8342"/> is used. For each use case, corresponding sample
      configuration in &lt;running&gt;, &lt;system&gt;, &lt;intended&gt; and
      &lt;operational&gt; are shown. The XML snippets are used only for
      illustration purposes.</t>

      <section title="Device Powers On">
        <t>When the device is powered on, suppose the system provides a
        loopback interface (named "lo0") which is not explicitly configured in
        &lt;running&gt;. Thus, no configuration for interfaces appears in
        &lt;running&gt;;</t>

        <t>And the contents of &lt;system&gt; are:</t>

        <figure>
          <artwork>&lt;interfaces&gt; 
  &lt;interface&gt; 
    &lt;name&gt;lo0&lt;/name&gt;  
    &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;  
    &lt;ip-address&gt;::1&lt;/ip-address&gt; 
  &lt;/interface&gt; 
&lt;/interfaces&gt;</artwork>
        </figure>

        <t>In this case, the configuration of loopback interface is only
        present in &lt;system&gt;, the exact configuration also shows up in
        &lt;intended&gt;. The contents of &lt;intended&gt; appear as
        follows:</t>

        <figure>
          <artwork>&lt;interfaces&gt; 
  &lt;interface&gt; 
    &lt;name&gt;lo0&lt;/name&gt;  
    &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;  
    &lt;ip-address&gt;::1&lt;/ip-address&gt; 
  &lt;/interface&gt; 
&lt;/interfaces&gt;</artwork>
        </figure>

        <t>And &lt;operational&gt; will show the system-provided loopback
        interface:</t>

        <figure>
          <artwork>&lt;interfaces xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin"
            or:origin="or:system"&gt;
  &lt;interface&gt;
    &lt;name&gt;lo0&lt;/name&gt;
    &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;
    &lt;ip-address&gt;::1&lt;/ip-address&gt;
  &lt;/interface&gt;
&lt;/interfaces&gt;  </artwork>
        </figure>
      </section>

      <section title="Client Commits Configuration">
        <t>If a client creates an interface "et-0/0/0" but the interface does
        not physically exist at this point, what is in &lt;running&gt; appears
        as follows:</t>

        <figure>
          <artwork>&lt;interfaces&gt; 
  &lt;interface&gt; 
    &lt;name&gt;et-0/0/0&lt;/name&gt;  
    &lt;description&gt;Test interface&lt;/description&gt; 
  &lt;/interface&gt; 
&lt;/interfaces&gt;</artwork>
        </figure>

        <t>And the contents of &lt;system&gt; keep unchanged since the
        interface is not physically present:</t>

        <figure>
          <artwork>&lt;interfaces&gt; 
  &lt;interface&gt; 
    &lt;name&gt;lo0&lt;/name&gt;  
    &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;  
    &lt;ip-address&gt;::1&lt;/ip-address&gt; 
  &lt;/interface&gt; 
&lt;/interfaces&gt;</artwork>
        </figure>

        <t>The contents of &lt;intended&gt; represent the merged data of
        &lt;system&gt; and &lt;running&gt;:</t>

        <figure>
          <artwork>&lt;interfaces&gt; 
  &lt;interface&gt; 
    &lt;name&gt;lo0&lt;/name&gt;  
    &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;  
    &lt;ip-address&gt;::1&lt;/ip-address&gt; 
  &lt;/interface&gt;  
  &lt;interface&gt; 
    &lt;name&gt;et-0/0/0&lt;/name&gt;  
    &lt;description&gt;Test interface&lt;/description&gt; 
  &lt;/interface&gt; 
&lt;/interfaces&gt;</artwork>
        </figure>

        <t>Since the interface named "eth-0/0/0" does not exist, the
        associated configuration is not present in &lt;operational&gt;, which
        appears as follows:</t>

        <figure>
          <artwork>&lt;interfaces xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin"
            or:origin="or:intended"&gt;
  &lt;interface or:origin="or:system"&gt;
    &lt;name&gt;lo0&lt;/name&gt;
    &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;
    &lt;ip-address&gt;::1&lt;/ip-address&gt;
  &lt;/interface&gt;
&lt;/interfaces&gt;              </artwork>
        </figure>
      </section>

      <section title="Operator Installs Card into a Chassis">
        <t>When the interface is installed by the operator, the system will
        detect it and generate the associated configuration in &lt;system&gt;.
        The contents of &lt;running&gt; keep unchanged:</t>

        <figure>
          <artwork>&lt;interfaces&gt; 
  &lt;interface&gt; 
    &lt;name&gt;et-0/0/0&lt;/name&gt;  
    &lt;description&gt;Test interface&lt;/description&gt; 
  &lt;/interface&gt; 
&lt;/interfaces&gt;</artwork>
        </figure>

        <t>And &lt;system&gt; might appear as follows:</t>

        <figure>
          <artwork>&lt;interfaces&gt; 
  &lt;interface&gt; 
    &lt;name&gt;lo0&lt;/name&gt;  
    &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;  
    &lt;ip-address&gt;::1&lt;/ip-address&gt; 
  &lt;/interface&gt;  
  &lt;interface&gt; 
    &lt;name&gt;et-0/0/0&lt;/name&gt;  
    &lt;mtu&gt;1500&lt;/mtu&gt; 
  &lt;/interface&gt; 
&lt;/interfaces&gt;</artwork>
        </figure>

        <t>Then &lt;intended&gt; contains the merged configuration of
        &lt;system&gt; and &lt;running&gt;:</t>

        <figure>
          <artwork>&lt;interfaces&gt; 
  &lt;interface&gt; 
    &lt;name&gt;lo0&lt;/name&gt;  
    &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;  
    &lt;ip-address&gt;::1&lt;/ip-address&gt; 
  &lt;/interface&gt;  
  &lt;interface&gt; 
    &lt;name&gt;et-0/0/0&lt;/name&gt;  
    &lt;description&gt;Test interface&lt;/description&gt;  
    &lt;mtu&gt;1500&lt;/mtu&gt; 
  &lt;/interface&gt; 
&lt;/interfaces&gt;</artwork>
        </figure>

        <t>And the contents of &lt;operational&gt; appear as follows:</t>

        <figure>
          <artwork>&lt;interfaces xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin"
            or:origin="or:intended"&gt;
  &lt;interface or:origin="or:system"&gt;
    &lt;name&gt;lo0&lt;/name&gt;
    &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;
    &lt;ip-address&gt;::1&lt;/ip-address&gt;
  &lt;/interface&gt;
  &lt;interface&gt;
    &lt;name&gt;et-0/0/0&lt;/name&gt;
    &lt;description&gt;Test interface&lt;/description&gt;
    &lt;mtu or:origin="or:system"&gt;1500&lt;/mtu&gt;
  &lt;/interface&gt;
&lt;/interfaces&gt;            </artwork>
        </figure>
      </section>
    </section>

    <section title="Changes between Revisions">
      <t>v05 - v06<list style="symbols">
          <t>remove inactive-until-referenced system config</t>

          <t>add a new section (sec.6) to clarify the interplay bewteen system
          config and defaults </t>

          <t>add a new section (sec.7) to clarify relation to other
          datastores, which includes &lt;factory-default&gt; and
          &lt;candidate&gt;/&lt;priv-candidate&gt;</t>

          <t>leave the merge behavior of &lt;system&gt; and &lt;running&gt;
          unspecified</t>

          <t>augment &lt;validate&gt; and &lt;commit&gt; PRC operation to
          support "resolve-system" parameter</t>

          <t>editorial updates</t>
        </list></t>

      <t>v04 - v05<list style="symbols">
          <t>Explicitly state that system configuration copied from
          &lt;system&gt; into &lt;running&gt; have its origin value being
          reported as "intended" and update the examples accordingly to
          reflect it</t>

          <t>Update the definition of "intended" origin identity in 8342 to
          allow a subset of configuration in &lt;intended&gt; to use "system"
          as origin value</t>

          <t>State server behaviors of migrating updated system data into
          &lt;running&gt; is beyond the scope of this document, and give a
          couple of implementation examples</t>

          <t>Remove the related statement which mandates referenced system
          configuration must be copied into &lt;running&gt;</t>

          <t>Refine usage examples (e.g., fix validation errors, remove
          redundancy)</t>
        </list></t>

      <t>v03 - v04<list style="symbols">
          <t>Add some implementation consideration for "resolve-system"
          parameter</t>

          <t>Define a NETCONF capability identifier for "resolve-system"
          parameter so that the client can discover if it is supported by the
          server.</t>

          <t>state servers may upgrade copied system configuration in
          &lt;running&gt; as well during device upgrade or licensing
          change.</t>
        </list></t>

      <t>v02 - v03<list style="symbols">
          <t>remove the merge mechanism related comments, as discussed in
          https://github.com/netconf-wg/netconf-next/issues/19</t>

          <t>Editorial changes</t>
        </list></t>

      <t>v01 - v02<list style="symbols">
          <t>Define referenced system configuration</t>

          <t>better clarify "resolve-system" parameter</t>

          <t>update Figure 2 in NMDA RFC</t>

          <t>Editorial changes</t>
        </list></t>

      <t>v00 - v01<list style="symbols">
          <t>Clarify why client's explicit copy is not preferred but cannot be
          avoided if resolve-system parameter is not defined</t>

          <t>Clarify active system configuration</t>

          <t>Update the timing when the server's auto copy should be enforced
          if a resolve-system parameter is used</t>

          <t>Editorial changes</t>
        </list></t>
    </section>

    <section anchor="Acknowledgements" numbered="no" title="Acknowledgements">
      <t>The authors would like to thank for following for discussions and
      providing input to this document: Balazs Lengyel, Robert Wilton, Juergen
      Schoenwaelder, Andy Bierman, Martin Bjorklund, Mohamed Boucadair,
      Alexander Clemm, and Timothy Carey.</t>
    </section>

    <section numbered="no" title="Contributors">
      <figure>
        <artwork>      
Kent Watsen
Watsen Networks
Email: kent+ietf@watsen.net

Jan Lindblad
Cisco Systems
Email: jlindbla@cisco.com

Chongfeng Xie
China Telecom
Beijing
China
Email: xiechf@chinatelecom.cn

Jason Sterne
Nokia
Email: jason.sterne@nokia.com</artwork>
      </figure>
    </section>
  </back>
</rfc>
