<?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-ma-netconf-with-system-01"
     ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN"
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the
         full title is longer than 39 characters -->

    <title abbrev="System Configuration Data Handling">With System Capability
    for NETCONF</title>

    <author fullname="Feng Chong" initials="C." surname="Feng">
      <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>frank.fengchong@huawei.com</email>
      </address>
    </author>

    <author fullname="Qiufang Ma" initials="Q." 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>

    <date year="2020"/>

    <!-- Meta-data Declarations -->

    <area>ops</area>

    <workgroup>NETCONF</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.
         If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>With System NETCONF</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>The NETCONF protocol [RFC6241] defines ways to read configuration and
      state data from a NETCONF server. In some cases, a client-configured
      data item refers to a non-existent system generated data item (e.g.,the
      auto-create interfaces ("eth1") is not yet present). In many situations,
      the system configured data item doesn't need to be know to the client
      and client-configured data item will automatically be removed from the
      operational state datastore and thus only appear in the intended
      datastore if client-configured data item doesn't exist. In other
      situations system configured data item needs to be known and overriden
      by the client. Not all server implementations treat the system
      configuration data in the same way. This document defines a
      capability-based extension to the NETCONF protocol that allows the
      NETCONF client to identify how system configuration are processed by the
      server, and also defines a new mechanism for client control of server
      processing of system configuration data.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="Introduction" title="Introduction">
      <t>The NETCONF protocol [RFC6241] defines ways to read configuration and
      state data from a NETCONF server.</t>

      <t>In some cases, a client-configured data item refers to a nonexistent
      system generated data item (e.g.,the auto-create interfaces ("eth1") is
      not yet present). <list style="symbols">
          <t>In many situations, the system configured data item doesn't need
          to be known to the client and client-configured data item will
          automatically be removed from the operational state datastore and
          thus only appear in the intended datastore if client-configured data
          item doesn't exist.</t>

          <t>In other situations system configured data item needs to be known
          and overriden by the client. Without system configuration datastore,
          the duplicated system configured data item in the system
          configuration need to be created and overriden by the client each
          time there is a system configured data item being referenced.</t>
        </list>Therefore not all server implementations treat the system
      configuration data in the same way.</t>

      <t>This document defines a capability-based extension to the NETCONF
      protocol that allows the NETCONF client to identify how system
      configuration are processed by the server, and also defines new
      mechanism for client control of server processing of system
      configuration data.</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 as follows:<list
            style="hanging">
            <t hangText="System configuration: ">Configuration that is
            supplied by the device itself [RFC8342]. <vspace
            blankLines="1"/></t>

            <t
            hangText="Logical resource dependent system configuration:">When
            the device is powered on, the pre-provisioned configuration will
            be activated and provided, irrespective of physical resource
            present or not, sometimes the pre-provisioned configuration will
            be provided unconditionally(e.g., loop back interface activation),
            sometimes not, e.g., only provided when a special functionality is
            enabled. <vspace blankLines="1"/></t>

            <t
            hangText="Physical resource dependent system configuration:">When
            the device is powered on and the physical resource is present
            (e.g., insert interface card), the system will automatically
            detect it and load pre-provisioned configuration; when the
            physical resource is not present( remove interface card), the
            system configuration will be automatically cleared. <vspace
            blankLines="1"/></t>

            <t hangText="System configuration datastore: ">A configuration
            datastore holding the complete system configuration of the device.
            This datastore is referred to as "&lt;system&gt;".</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="System Configuration Data Handling">
        <t>The system configuration data handling behavior used by a server
        will impact NETCONF protocol operations in two ways:<list
            style="symbols">
            <t>Data retrieval: A server is normally allowed to exclude data
            nodes which it considers to contain the system configuration data.
            The actual nodes omitted depends on the system configuration data
            handling behavior used by the server.</t>

            <t>Create and delete operations: The &lt;edit-config&gt;
            'operation' attribute can be used to create and/or delete specific
            data nodes. These operations depend on whether the target node
            currently exists or not. The server's system configuration data
            handling behavior will determine whether the requested node
            currently exists in the configuration datastore or not.</t>
          </list></t>
      </section>
    </section>

    <!-- Possibly a 'Contributors' section ... -->

    <section title="System Configuration Datastore">
      <t>Following guidelines for defining Datastores in the appendix A of
      [RFC8342], this document introduces a new datastore resource named
      'system' that represents the pre-provisioned configuration or physical
      resource dependent configuration.</t>

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

          <t>YANG modules: all</t>

          <t>YANG nodes: all "config true" data nodes</t>

          <t>Management operations: The content of the datastore is set by the
          server in an implementation dependent manner. The content can not be
          changed by management operations via NETCONF, RESTCONF,the CLI etc
          unless specialized, dedicated operations are provided. The datastore
          can be read using the standard NETCONF/RESTCONF protocol
          operations.</t>

          <t>Origin: This document does not define any new origin identity
          when it interacts with &lt;operational&gt; datastore. The system
          origin Metadata Annotation is used to indicate the origin of a data
          item.</t>

          <t>Protocols: RESTCONF, NETCONF and other management protocol.</t>

          <t>Defining YANG module: "ietf-netconf-with-system".</t>
        </list></t>

      <t>The datastore content is usually defined by the device vendor. It is
      static at most of time and MAY change e.g., depending on external
      factors like HW available or during device upgrade. &lt;system&gt; does
      not persist across reboots. It will be automatically loaded when the
      device is powered on or the physical resource is present.</t>

      <section title="Life Cycle of the system configuration">
        <t>When the device is powered on, unconditional logical resource
        dependent system configuration will be generated and loaded into
        &lt;system&gt; automatically by the device operating system.
        Conditional logical resource dependent system configuration is only
        provided when a special functionality is enabled.</t>

        <t>When the device is powered on and the physical resource is inserted
        into the device, physical resource dependent system configuration will
        be automatically loaded into &lt;system&gt;;</t>

        <t>When the physical resource is removed from the device, the physical
        resource dependent system configuration will be automatically removed
        from &lt;system&gt;;</t>
      </section>
    </section>

    <section anchor="basic"
             title="System Configuration data handling Basic Modes">
      <t>Not all server implementations treat system configuration data in the
      same way. Instead of forcing a single implementation strategy, this
      document allows a server to advertise a particular style of system
      configuration data handling, and the client can adjust accordingly.</t>

      <t>NETCONF servers report system configuration data in different ways.
      This document specifies two standard defaults handling basic modes that
      a server implementor may choose from:<list style="symbols">
          <t>report-all</t>

          <t>explicit</t>
        </list></t>

      <t>A server that uses the 'report-all' basic mode MUST automatically
      <list style="symbols">
          <t>Update &lt;running&gt; with the system configuration, after the
          "system" configuration has been altered as a consequence of a plug
          and play operation or device powering on operation. However the
          configurations in &lt;running&gt; can not be removed automatically
          when configuration data nodes in &lt;system&gt; is deleted since
          those configurations in &lt;running&gt; are likely to have already
          been modified or referenced.</t>

          <t>The system configuration doesn't need to be explicitly set by the
          client first before the system configuration needs to be updated
          with client set configuration or referenced by client set
          configuration.</t>
        </list></t>

      <t>A server that uses the 'explicit' basic mode <list>
          <t>MUST not update &lt;running&gt; with the system
          configuration,</t>

          <t>The system configuration MUST be explicitly set by the client
          first before the system configuration needs to be updated with
          client set configuration or referenced by client set
          configuration.</t>
        </list></t>

      <section title="'report-all' Initialization During Reboot">
        <t>At boot time, the device loads the saved system configuration into
        &lt;running&gt; together with saved startup configuration via 'merge'
        protocol operation. To save a new system configuration, data is copied
        to &lt;system&gt; via either implicit or explicit protocol
        operations.</t>

        <t>The contents of &lt;system&gt; don't have to be persist across
        reboots. At each boot time, the device generates system configurations
        (e.g., unconditional logical resource dependent system configuration
        and physical resource dependent system configuration) and saves into
        &lt;system&gt;. Then the device loads the saved startup configuration
        into &lt;running&gt;. The device may generate conditional logical
        resource dependent system configuration at the time of loading
        &lt;startup&gt;. Lastly, the device loads &lt;system&gt; into
        &lt;running&gt;. If there exists any conflict, the configuration in
        the &lt;running&gt; should succeed. </t>
      </section>

      <section title="'report-all' &lt;edit-config&gt; Behavior">
        <t>The server MUST consider every data node to exist, even those set
        by the server. <list style="symbols">
            <t>A valid 'create' operation attribute for a data node that is
            loaded from &lt;system&gt; and explicitly set by the server MUST
            fail with a 'data-exists' error-tag;</t>

            <t>A valid 'delete' operation attribute for a data node that is
            loaded from &lt;system&gt; and explicitly set by the server MUST
            succeed. The deleted system configuration MUST be reloaded into
            &lt;running&gt; immediately if the system configuration is still
            present in the &lt;system&gt;;</t>

            <t>A valid 'merge' operation attribute for a data node that is
            loaded from &lt;system&gt; and explicitly set by the server MUST
            succeed.</t>
          </list></t>
      </section>

      <section title="'explicit' &lt;edit-config&gt; Behavior">
        <t>The server considers any data node that is explicitly set data to
        exist. <list style="symbols">
            <t>A valid 'create' operation attribute for a data node that is
            explicitly set by the server MUST succeed since the system
            configuration data is not present in the &lt;running&gt;
            configuration datastore.</t>

            <t>A valid 'merge' operation attribute for a data node that is
            explicitly set by the server MUST succeed even though the name of
            data node in &lt;system&gt; is same as name of data node
            explicitly set by the client.</t>

            <t>A valid 'delete' operation attribute for a data node that is
            explicitly set by the client MUST succeed even though the name of
            data node in &lt;system&gt; is same as name of data node
            explicitly set by the client. A valid 'delete' operation attribute
            for a data node that is not explicitly set by the client MUST fail
            since system configuration is not loaded into &lt;running&gt;.</t>
          </list></t>
      </section>
    </section>

    <section title="Retrieval of System Configuration Data">
      <t>When data is retrieved from a server using the 'report-all' basic
      mode, and the &lt;with-system&gt; parameter is not present, all data
      nodes MUST be reported including data nodes considered to be system
      configuration data by the server.</t>

      <t>If the 'report-all' basic mode is used by the server and the
      &lt;with-system&gt; parameter supported by the server is set to a value
      equal to 'report-all', all data nodes MUST be reported, including any
      data nodes considered to be system configuration data by the server.</t>

      <t>If the 'report-all' basic mode is used by the server and the
      &lt;with-system&gt; parameter supported by the server is set to a value
      equal to 'report-all-tagged', all data nodes MUST be reported, including
      any data nodes considered to be system configuration data by the server.
      Explicitly set data by the server will be tagged if the system
      configuration is applied.</t>

      <t>When data is retrieved from a server using the 'explicit' basic mode,
      and the &lt;with-system&gt; parameter is not present, data nodes
      modified explicitly by the client MUST be reported.</t>

      <t>If the 'explicit' basic mode is used by the server and the
      &lt;with-system&gt; parameter supported by the server is set to a value
      equal to 'explicit', data nodes MUST also be reported if explicitly
      modified by the client.</t>

      <t>When data is retrieved from a server using the &lt;with-system&gt;
      parameter with a value equal to 'trim' , data nodes MUST be reported if
      considered to be not consistent with system configuration data by the
      server. Data node MUST NOT be reported if explicitly modified by the
      client.</t>
    </section>

    <section title="With System Capability">
      <section title="Overview">
        <t>The :with-system capability indicates which system-data-handling
        basic mode is supported by the server. These basic modes allow a
        NETCONF client to control whether system configuration data is
        returned by the server. Sending of system configuration data is
        controlled for each individual operation separately.</t>

        <t>A NETCONF server implementing the :with-system capability: <list
            style="symbols">
            <t>MUST indicate its basic mode behavior by including the
            'basic-mode' parameter in the capability URI;</t>

            <t>MUST support the YANG module defined in <xref target="module"/>
            for the system configuration data handling mode indicated by the
            'basic-mode' parameter.</t>

            <t>SHOULD support the YANG module in <xref target="module"/> for
            the system configuration data handling mode identified by the
            'report-all' or 'report-all-tagged' enumeration value.</t>

            <t>If the 'report-all-tagged' system data handling mode is
            supported, then the 'origin' metadata attribute MUST be
            supported.</t>

            <t>MAY support the YANG module in <xref target="module"/> for
            additional system data handling modes.</t>
          </list></t>
      </section>

      <section anchor="cap" title="Capability Identifier">
        <t>urn:ietf:params:netconf:capability:with-system:1.0</t>

        <t>The identifier MUST have a parameter: "basic-mode". This indicates
        how the server will treat system configuration data, as defined in
        <xref target="basic"/>. The allowed values of this parameter are
        'report-all', and 'explicit', as defined in <xref
        target="basic"/>.</t>

        <t>The identifier MAY have another parameter: "also-supported". This
        parameter indicates which additional enumeration values (besides the
        basic-mode enumeration), the server will accept for the
        &lt;with-system&gt; parameter in <xref target="basic"/>. The value of
        the parameter is a comma separated list of one or more modes that are
        supported beside the mode indicated in the 'basic-mode' parameter.
        Possible modes are 'report-all', 'report-all-tagged','trim' and
        'explicit', as defined in <xref target="basic"/>.</t>

        <t>urn:ietf:params:netconf:capability:with-system:1.0?basic-mode=explicit&amp;also-supported=report-all,report-all-tagged</t>
      </section>

      <section title="Modifications to Existing Operations ">
        <section title="&lt;get&gt; and &lt;get-config&gt; Operations">
          <t>A new &lt;with-system&gt; XML element is added to the input for
          the &lt;get&gt;, &lt;get-config&gt; and &lt;copy-config&gt;
          operations. If the &lt;with-system&gt; element is present, it
          controls the reporting of system configuration data. The server MUST
          return system configuration data in the NETCONF &lt;rpc-reply&gt;
          messages according to the value of this element, if the server
          supports the specified retrieval mode
          (i.e.,report-all/report-all-tagged).</t>

          <t>This parameter only controls these specified retrieval
          operations, and does not impact any other operations or the
          non-volatile storage of configuration data.</t>

          <t>The &lt;with-system&gt; element is defined in the XML namespace
          for the ietf-netconf-with-system.yang module in <xref
          target="module"/>, not the XML namespace for the &lt;get&gt;,
          &lt;get-config&gt; and &lt;copy-config&gt; operations.</t>

          <t>If the &lt;with-system&gt; element is not present, the server
          MUST follow its basic mode behavior as indicated by the :with-system
          capability identifier's 'basic-mode' parameter, defined in <xref
          target="cap"/>.</t>

          <t>The &lt;get&gt; and &lt;get-config&gt; operations support a
          separate filtering mechanism, using the &lt;filter&gt; parameter.
          The system configuration data filtering is conceptually done before
          the &lt;filter&gt; parameter is processed. For example, if the
          &lt;with-system&gt; parameter is equal to 'report-all', then the
          &lt;filter&gt; parameter is conceptually applied to all data nodes
          and all system configuration data.</t>
        </section>

        <section title="&lt;edit-config&gt; Operation  ">
          <t>The &lt;edit-config&gt; operation has several editing modes. The
          'create', and 'delete' editing operations are affected by the system
          configuration data handling basic mode. The other enumeration values
          for the NETCONF operation attribute are not affected.</t>

          <t>If the operation attribute contains the value 'create', and the
          data node already exists in the target configuration datastore, then
          the server MUST return an &lt;rpc-error&gt; response with a
          'invalid-value' error-tag.</t>

          <t>If the client sets a data node that is explicitly set by the
          server, the server MUST accept the request if it is valid. The
          server MUST keep or discard the new value based on its system
          configuration data handling basic mode.</t>
        </section>
      </section>
    </section>

    <section anchor="module"
             title="YANG Module for the &lt;with-system&gt; Parameter ">
      <t>The following YANG module defines the addition of the with-system
      element to the &lt;get&gt;, &lt;get-config&gt;, and &lt;copy-config&gt;
      operations. The YANG language is defined in [RFC6020]. The above
      operations are defined in YANG in [RFC6241]. Every NETCONF server which
      supports the :with-system capability MUST implement this YANG
      module.</t>

      <figure>
        <artwork> &lt;CODE BEGINS&gt; file="ietf-netconf-with-system@2019-12-31.yang"
 module ietf-netconf-with-system {
    namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-with-system";
    prefix ncws;
    import ietf-netconf { prefix nc; }

    organization
     "IETF NETCONF (Network Configuration Protocol) Working Group";

    contact
     "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
      WG List:  &lt;mailto:netconf@ietf.org&gt;
      WG Chair: 
      Editor: 
                                                 ";
    description
     "This module defines an extension to the NETCONF protocol
      that allows the NETCONF client to control how system configuration 
      data are handled by the server in particular NETCONF operations.

      Copyright (c) 2010 IETF Trust and the persons identified as
      the document authors.  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 Simplified BSD License
      set forth in Section 4.c of the IETF Trust's Legal Provisions
      Relating to IETF Documents
      (http://trustee.ietf.org/license-info).

      This version of this YANG module is part of RFC XXXX; see
      the RFC itself for full legal notices.";
    // RFC Ed.: replace XXXX with actual RFC number and remove this note

    revision 2019-12-31 {
      description
        "Initial version.";
      reference
       "RFC XXXX: With-system capability for NETCONF";
    }

    typedef with-system-mode {
       description
         "Possible modes to report system configuration data.";
       reference
          "RFC XXXX; section 3.";
          // RFC Ed.: replace XXXX with actual
          // RFC number and remove this note

       type enumeration {
          enum report-all {
              description
                "All system configuration data is reported.";
              reference
                "RFC XXXX; section 3.1";
                // RFC Ed.: replace XXXX with actual
                // RFC number and remove this note

          }
          enum report-all-tagged {
              description
                "All system configuration data is reported.
                 Any nodes considered to be system configuration
                 data will contain a 'origin' XML attribute,
                 set to 'system'.";
              reference
                "RFC XXXX; section 3.4";
                // RFC Ed.: replace XXXX with actual
                // RFC number and remove this note
          }
          enum trim {
              description
                "Values are not reported if they contain the system 
                configuration data.";
              reference
                "RFC XXXX; section 3.2";
                // RFC Ed.: replace XXXX with actual
                // RFC number and remove this note

          }
          enum explicit {
              description
                "Report values that contain the definition of
                 explicitly set data.";
              reference
                "RFC XXXX; section 3.3";
                // RFC Ed.: replace XXXX with actual
                // RFC number and remove this note
          }
      }
    }

    grouping with-system-parameters {
      description
        "Contains the &lt;with-system&gt; parameter for control
         of system configuration data in NETCONF retrieval 
         operations.";

      leaf with-system {
        description
          "The explicit system configuration data processing 
           mode requested.";
        reference
          "RFC XXXX; section 4.6.1";
          // RFC Ed.: replace XXXX with actual
          // RFC number and remove this note

        type with-system-mode;
      }
    }

    // extending the get-config operation
    augment /nc:get-config/nc:input {
        description
          "Adds the &lt;with-system&gt; parameter to the
           input of the NETCONF &lt;get-config&gt; operation.";
        reference
          "RFC XXXX; section 4.6.1";
          // RFC Ed.: replace XXXX with actual
          // RFC number and remove this note

        uses with-system-parameters;
    }

    // extending the get operation
    augment /nc:get/nc:input {
        description
          "Adds the &lt;with-system&gt; parameter to
           the input of the NETCONF &lt;get&gt; operation.";
        reference
          "RFC XXXX; section 4.6.1";
          // RFC Ed.: replace XXXX with actual
          // RFC number and remove this note

        uses with-system-parameters;
    }
 }
 &lt;CODE ENDS&gt;</artwork>
      </figure>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document registers the following capability identifier URN in
      the 'Network Configuration Protocol Capability URNs registry':<figure>
          <artwork>urn:ietf:params:netconf:capability:with-system:1.0</artwork>
        </figure></t>

      <t>This document registers two XML namespace URNs in the 'IETF XML
      registry', following the format defined in [RFC3688].<figure>
          <artwork>      URI: urn:ietf:params:xml:ns:netconf:system:1.0
      URI: urn:ietf:params:xml:ns:yang:ietf-netconf-with-system

   Registrant Contact: The NETCONF WG of the IETF.

   XML: N/A, the requested URIs are XML namespaces.</artwork>
        </figure></t>

      <t>This document registers one module name in the 'YANG Module Names'
      registry, defined in [RFC6020] .<figure>
          <artwork>      name: ietf-netconf-with-system
      prefix: ncws
      namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-with-system
      RFC: XXXX // RFC Ed.: replace XXXX and remove this comment</artwork>
        </figure></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements"/>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->

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

    <references title="Informative References">
      <!-- Here we use entities that we defined at the beginning. -->

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

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

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

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

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

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

      <!-- A reference written by by an organization not a person. -->
    </references>

    <section title="Usage Examples">
      <section title="Example YANG Module">
        <t>The following YANG module defines an example interfaces table to
        demonstrate how the &lt;with-system&gt; parameter behaves for a
        specific data model.</t>

        <figure>
          <artwork>     container interfaces {
       list interface {
         key name;
         leaf name {
           type string;
         }
         leaf description {
           type string;
         }
         leaf-list ip-address {
           type inet:ip-address;
         }
       }
     }</artwork>
        </figure>
      </section>

      <section title="Example Data Set">
        <t>The following data element shows the conceptual contents of the
        example server for the protocol operation examples in the next
        section. This includes all the configuration data nodes and system
        configuration leafs.</t>

        <figure>
          <artwork>   &lt;data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
     &lt;interfaces xmlns="http://example.com/ns/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;lo1&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;
         &lt;ip-address&gt;::2&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo2&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;
         &lt;ip-address&gt;::3&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo3&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;
     &lt;/data&gt;</artwork>
        </figure>

        <t>In this example, the 'ip-address' field for each interface entry is
        set in the following manner:</t>

        <figure>
          <artwork>+---------+----------+-------+
| name    |ip-address| set by|
+---------+----------+-------+
| lo0     |127.0.0.1 | server|
| lo0     |  ::1     | server|
| lo1     |127.0.0.1 | server|
| lo1     |  ::2     | client|
| lo2     |127.0.0.1 | server|
| lo2     |  ::3     | client|
| lo3     |127.0.0.1 | server|
| lo3     |  ::1     | server|
+---------+----------+-------+</artwork>
        </figure>
      </section>

      <section title="Protocol Operation Examples">
        <t>The following examples show some &lt;get&gt; operations using the
        'with- system' element. The data model used for these examples is
        defined in Appendix A.1.</t>

        <t>The client is retrieving all the data nodes within the 'interfaces'
        object, filtered with the &lt;with-system&gt; parameter.</t>

        <section title="&lt;with-system&gt; = 'report-all' ">
          <t>The behavior of the &lt;with-system&gt; parameter handling for
          the value 'report-all' is demonstrated in this example.</t>

          <figure>
            <artwork>    &lt;rpc message-id="101"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get&gt;
        &lt;filter type="subtree"&gt;
          &lt;interfaces xmlns="http://example.com/ns/interfaces"/&gt;
        &lt;/filter&gt;
        &lt;with-system
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-system"&gt;
          report-all
        &lt;/with-system&gt;
      &lt;/get&gt;
    &lt;/rpc&gt;

    &lt;rpc-reply message-id="101"
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
   &lt;data&gt;
     &lt;interfaces xmlns="http://example.com/ns/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;lo1&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;
         &lt;ip-address&gt;::2&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo2&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;
         &lt;ip-address&gt;::3&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo3&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;
   &lt;/data&gt;
   &lt;/rpc-reply&gt;</artwork>
          </figure>
        </section>

        <section title="&lt;with-system&gt; = 'report-all-tagged' ">
          <t>The behavior of the &lt;with-system&gt; parameter handling for
          the value 'report-all-tagged' is demonstrated in this example. A
          'tagged' data node is an element that contains the 'origin' XML
          attribute, set to 'system'.</t>

          <t>The actual data nodes tagged by the server depend on the system
          configuration data handling basic mode used by the server. Only the
          data nodes that are considered to be system configuration data will
          be tagged.</t>

          <t>In this example, the server's basic mode is 'explicit', then only
          data nodes that are not explicitly set data are tagged. If the
          server's basic mode is 'report-all', then no data nodes are
          tagged.</t>

          <figure>
            <artwork>    &lt;rpc message-id="102"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get&gt;
        &lt;filter type="subtree"&gt;
          &lt;interfaces xmlns="http://example.com/ns/interfaces"/&gt;
        &lt;/filter&gt;
        &lt;with-system
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-system"&gt;
          report-all-tagged
        &lt;/with-system&gt;
      &lt;/get&gt;
    &lt;/rpc&gt;</artwork>
          </figure>

          <figure>
            <artwork>
    &lt;rpc-reply message-id="102"
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
               xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin"&gt;
   &lt;data&gt;
     &lt;interfaces xmlns="http://example.com/ns/interfaces"&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;lo1&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address or:origin="or:system"&gt;127.0.0.1&lt;/ip-address&gt;
         &lt;ip-address&gt;::2&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo2&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address or:origin="or:system"&gt;127.0.0.1&lt;/ip-address&gt;
         &lt;ip-address&gt;::3&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface or:origin="or:system"&gt;
         &lt;name&gt;lo3&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;
   &lt;/data&gt;
   &lt;/rpc-reply&gt;</artwork>
          </figure>
        </section>

        <section title="&lt;with-system&gt; = 'explicit' ">
          <t>The behavior of the &lt;with-system&gt; parameter handling for
          the value 'explicit' is demonstrated in this example.</t>

          <figure>
            <artwork>    &lt;rpc message-id="103"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get&gt;
        &lt;filter type="subtree"&gt;
          &lt;interfaces xmlns="http://example.com/ns/interfaces"/&gt;
        &lt;/filter&gt;
        &lt;with-system
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-system"&gt;
          explicit
        &lt;/with-system&gt;
      &lt;/get&gt;
    &lt;/rpc&gt;</artwork>
          </figure>

          <figure>
            <artwork>    &lt;rpc-reply message-id="101"
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
   &lt;data&gt;
     &lt;interfaces xmlns="http://example.com/ns/interfaces"&gt;
       &lt;interface&gt;
         &lt;name&gt;lo0&lt;/name&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo1&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address&gt;::2&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo2&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address&gt;::3&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo3&lt;/name&gt;
       &lt;/interface&gt;
     &lt;/interfaces&gt;
   &lt;/data&gt;
  &lt;/rpc-reply&gt;</artwork>
          </figure>
        </section>

        <section title="&lt;with-system&gt; = 'trim' ">
          <t>The behavior of the &lt;with-system&gt; parameter handling for
          the value 'trim' is demonstrated in this example.</t>

          <figure>
            <artwork>    &lt;rpc message-id="104"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
      &lt;get&gt;
        &lt;filter type="subtree"&gt;
          &lt;interfaces xmlns="http://example.com/ns/interfaces"/&gt;
        &lt;/filter&gt;
        &lt;with-system
         xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-system"&gt;
          trim
        &lt;/with-system&gt;
      &lt;/get&gt;
    &lt;/rpc&gt;

    &lt;rpc-reply message-id="101"
               xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
   &lt;data&gt;
     &lt;interfaces xmlns="http://example.com/ns/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;lo1&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo2&lt;/name&gt;
         &lt;description&gt;loopback&lt;/description&gt;
         &lt;ip-address&gt;127.0.0.1&lt;/ip-address&gt;
       &lt;/interface&gt;
       &lt;interface&gt;
         &lt;name&gt;lo3&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;
   &lt;/data&gt;
   &lt;/rpc-reply&gt;</artwork>
          </figure>
        </section>
      </section>
    </section>

    <!-- Change Log
v00 2019-12-12  Authors   Initial version
 -->
  </back>
</rfc>
