<?xml version="1.0" encoding="us-ascii"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.3.24 -->



<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3688 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml">
<!ENTITY RFC6020 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6020.xml">
<!ENTITY RFC6241 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC6242 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6242.xml">
<!ENTITY RFC6243 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6243.xml">
<!ENTITY RFC6991 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6991.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8342 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8342.xml">
<!ENTITY RFC8340 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8340.xml">
]>


<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>




<rfc ipr="trust200902" docName="draft-liu-netconf-ext-obtain-ds-diff-00" category="std">

  <front>
    <title abbrev='Get Datastore Differences'>NETCONF Extension for Datastore Differences</title>

    <author initials="D." surname="Liu" fullname="Daiying Liu" role="editor">
      <organization>Ericsson</organization>
      <address>
        <email>harold.liu@ericsson.com</email>
      </address>
    </author>
    <author initials="R." surname="Liu" fullname="Renwang Liu">
      <organization>Ericsson</organization>
      <address>
        <email>renwang.liu@ericsson.com</email>
      </address>
    </author>

    <date year="2022" month="February" day="21"/>

    <area>General</area>
    <workgroup>Network Working Group</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>

<t>This document defines a "datastore-diff" RPC that returns the differences between two datastores in an XML-based format.</t>

    </abstract>


  </front>

  <middle>






<section anchor="sec1" title="Introduction">

<t>NETCONF defines how to obtain startup (<xref target="RFC6241"/>, section 8.7), candidate (<xref target="RFC6241"/>, section 8.3)
and running datastores to provide the ability to check the validity of the configuration before committing (<xref target="RFC6241"/>, section 8.3.4.1).</t>

<t>However, such an approach can be non-optimal because the increment of configuration change cannot be directly obtained so as to
all configuration change checks need to be manually compared.
Therefore, this method is not very efficient and error-prone in many cases.
The consequence of configuration error directly affects the service even if the wrong configuration is corrected quickly, it is unacceptable.</t>

<t>This document defines how to directly retrieve the differences between datastores by adding "datastore-diff" RPC to improve  NETCONF usability and serviceability.</t>

</section>





<section anchor="sec2" title="Requirements Language">

<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in <xref target="RFC2119"/> <xref target="RFC8174"/>.</t>

</section>


<section anchor="sec3" title="Extend NETCONF operation">

<t>The newly defined "datastore-diff" RPC accept input parameters to indicate source and target datastore, as described in <xref target="parameters-sec32"/>.</t>








<section anchor="model-tree-diagram-sec31" title="Model Tree Diagram">

<t>The following figure illustrates the "ietf-netconf-ds-diff" module tree diagram <xref target="RFC8340"/>:</t>

<figure title="Model Tree Diagram" anchor="xml_happy_1"><artwork><![CDATA[
module: ietf-netconf-ds-diff
rpcs:
   +---x datastore-diff    
      +---w input     
      |  +---w target
      |  |  +---w (config-target)
      |  |     +--:(candidate)
      |  |     |  +---w candidate?   empty
      |  |     +--:(running)
      |  |     |  +---w running?     empty
      |  |     +--:(startup)
      |  |        +---w startup?     empty
      |  +---w source
      |     +---w (config-source)
      |        +--:(candidate)
      |        |  +---w candidate?   empty
      |        +--:(running)
      |        |  +---w running?     empty
      |        +--:(startup)
      |           +---w startup?     empty
      +--ro output    
         +--ro data
]]></artwork></figure>

</section>






<section anchor="parameters-sec32" title="Parameters">

<t>/datastore-diff/target:</t>

<t>Name of the target datastore to be compared, can be either of startup, candidate and running.</t>

<t>/datastore-diff/source:</t>

<t>Name of the source datastore to be compared, can be either of startup, candidate and running.</t>

<t>Positive Response:</t>

<t>If the Network Element (NE) can satisfy the request, it sends an rpc-reply element containing a "data" element with 
the difference of requested datastores.</t>

<t>The compared output will use the XML-based data encoding for the differences, refer to Appendix A.</t>

<t>Negative Response:</t>

<t>An rpc-error element is included in the rpc-reply if the request cannot be completed for any reason.</t>

</section>
</section>


<section anchor="sec4" title="Yang Model for Get Datastores Differences">

<t>The "ietf-netconf-ds-diff" module has normative references to <xref target="RFC6241"/>, <xref target="RFC6243"/>, <xref target="RFC6991"/>, <xref target="RFC8342"/>.</t>

<figure title="YANG Model Definition" anchor="xml_happy_2"><artwork><![CDATA[
<CODE BEGINS> file "ietf-netconf-ds-diff.yang"

   module ietf-netconf-ds-diff {
     yang-version 1.1;
     namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-ds-diff";
     prefix dsdiff;

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

     contact
         "WG Web:   <http://tools.ietf.org/wg/netconf/>
          WG List:  <mailto:netconf@ietf.org>";

     description
       "This module defines 'datastore-diff' rpc to
       support obtaining datastore differences.

        Copyright (c) 2021 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 Simplified
        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 2021-11-29 {
       description
         "Initial revision.";
       reference
         "RFC XXXX: NETCONF Extension to Support Obtaining
          Datastore Differences";
     }

     rpc datastore-diff {
       description
         "Get datastore differences.";

       input {
         container target {
           description
             "Target datastore to be compared.";
      
           choice config-target {
             mandatory true;
             description
              "The configuration target to compare the differences.";
      
             leaf candidate {
               type empty;
               description
                 "The candidate configuration is the target.";
             }
             leaf running {
               type empty;
               description
                 "The running configuration is the target.";
             }
             leaf startup {
               type empty;
               description
                 "The startup configuration is the target.";
             }
           }
         }
      
         container source {
           description
             "Source datastore to be compared.";
      
           choice config-source {
             mandatory true;
             description
              "The configuration source to compare the differences.";
      
             leaf candidate {
               type empty;
               description
                 "The candidate configuration is the source.";
             }
             leaf running {
               type empty;
               description
                 "The running configuration is the source.";
             }
             leaf startup {
               type empty;
               description
                 "The startup configuration is the source.";
             }
           }
         }
       }

       output {
         anyxml data {
           description
            "Copy of the datastore differences subset that matched
            the filter criteria (if any).  An empty data container
            indicates that the request did not produce any results.";
         }
       }
     }
   }

<CODE ENDS>
]]></artwork></figure>

</section>










<section anchor="sec5" title="Security Considerations">

<t>This document extends the base operations for NETCONF <xref target="RFC6241"/> that are naturally protected by mandatory-to-implement secure transport Secure Shell (SSH) <xref target="RFC6242"/>.</t>

<t>So there is no security problem or potential risk.</t>

</section>


<section anchor="sec6" title="IANA Considerations">

<section anchor="the-ietf-xml-registry-sec61" title="The &quot;IETF XML&quot; Registry">

<t>This document registers one URI in the "ns" subregistry of the IETF
XML Registry <xref target="RFC3688"/> maintained at
https://www.iana.org/assignments/xml-registry/xml-registry.xhtml#ns.</t>

<t>Following the format in <xref target="RFC3688"/> to request following registration:</t>

<t>URI: urn:ietf:params:xml:ns:yang:ietf-netconf-ds-diff</t>

<t>Registrant Contact: The IESG.</t>

<t>XML: N/A, the requested URI is an XML namespace.</t>

</section>

<section anchor="the-yang-module-names-registry-sec62" title="The &quot;YANG Module Names&quot; Registry">

<t>This document registers one YANG module in the YANG Module Names
registry <xref target="RFC6020"/> maintained at https://www.iana.org/assignments/yang-parameters/yang-parameters.xhtml.</t>

<t>Following the format defined in <xref target="RFC6020"/>, the following registration is requested:</t>

<t>name: ietf-netconf-ds-diff</t>

<t>namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-ds-diff
prefix: dsdiff
RFC: XXXX</t>

</section>
</section>

<section anchor="ack-sec7" title="Acknowledgements">

<t>The authors would like to thank Scott Mansfield for his reviews and feedback.</t>

</section>

  </middle>

  <back>

    <references title='Normative References'>

&RFC2119;
&RFC3688;
&RFC6020;
&RFC6241;
&RFC6242;
&RFC6243;
&RFC6991;
&RFC8174;
&RFC8342;


    </references>

    <references title='Informative References'>

&RFC8340;


    </references>





<section anchor="sec7" title="Appendix A. Examples">

<figure title="Query RPC Definition" anchor="xml_happy_3"><artwork><![CDATA[
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
             message-id="49">
  <datastore-diff xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-ds-diff">
    <source>
      <candidate/>
    </source>
    <target>
      <running/>
    </target>
  </datastore-diff>
</rpc>
]]></artwork></figure>

<figure title="Reply Data" anchor="xml_happy_4"><artwork><![CDATA[
    <rpc-reply message-id="49"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <data>
        <interfaces xmlns="http://openconfig.net/yang/interfaces"
                 xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
          <interface nc:operation="create">
            <name>management</name>
            <config>
              <name>management</name>
              <type>ianaift:ethernetCsmacd</type>
              <mtu>1500</mtu>
              <enabled>true</enabled>
            </config>
            <ethernet>
              <config>
                <port-speed>SPEED_1GB</port-speed>
              </config>
            </ethernet>
          </interface>
        </interfaces>
      </data>
    </rpc-reply>
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