Internet-Draft Get Datastore Differences February 2022
Liu & Liu Expires 25 August 2022 [Page]
Network Working Group
Intended Status:
Standards Track
D. Liu, Ed.
R. Liu

NETCONF Extension for Datastore Differences


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

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on 25 August 2022.

1. Introduction

NETCONF defines how to obtain startup ([RFC6241], section 8.7), candidate ([RFC6241], section 8.3) and running datastores to provide the ability to check the validity of the configuration before committing ([RFC6241], section

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.

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

2. Requirements Language

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 [RFC2119] [RFC8174].

3. Extend NETCONF operation

The newly defined "datastore-diff" RPC accept input parameters to indicate source and target datastore, as described in Section 3.2.

3.1. Model Tree Diagram

The following figure illustrates the "ietf-netconf-ds-diff" module tree diagram [RFC8340]:

module: ietf-netconf-ds-diff
   +---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
Figure 1: Model Tree Diagram

3.2. Parameters


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


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

Positive Response:

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.

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

Negative Response:

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

4. Yang Model for Get Datastores Differences

The "ietf-netconf-ds-diff" module has normative references to [RFC6241], [RFC6243], [RFC6991], [RFC8342].

<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;

       "IETF NETCONF (Network Configuration) Working Group";

         "WG Web:   <>
          WG List:  <>";

       "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

        This version of this YANG module is part of RFC XXXX
        (; see the RFC
        itself for full legal notices.

        The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
        '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 {
         "Initial revision.";
         "RFC XXXX: NETCONF Extension to Support Obtaining
          Datastore Differences";

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

       input {
         container target {
             "Target datastore to be compared.";

           choice config-target {
             mandatory true;
              "The configuration target to compare the differences.";

             leaf candidate {
               type empty;
                 "The candidate configuration is the target.";
             leaf running {
               type empty;
                 "The running configuration is the target.";
             leaf startup {
               type empty;
                 "The startup configuration is the target.";

         container source {
             "Source datastore to be compared.";

           choice config-source {
             mandatory true;
              "The configuration source to compare the differences.";

             leaf candidate {
               type empty;
                 "The candidate configuration is the source.";
             leaf running {
               type empty;
                 "The running configuration is the source.";
             leaf startup {
               type empty;
                 "The startup configuration is the source.";

       output {
         anyxml data {
            "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.";

Figure 2: YANG Model Definition

5. Security Considerations

This document extends the base operations for NETCONF [RFC6241] that are naturally protected by mandatory-to-implement secure transport Secure Shell (SSH) [RFC6242].

So there is no security problem or potential risk.

6. IANA Considerations

6.1. The "IETF XML" Registry

This document registers one URI in the "ns" subregistry of the IETF XML Registry [RFC3688] maintained at

Following the format in [RFC3688] to request following registration:

URI: urn:ietf:params:xml:ns:yang:ietf-netconf-ds-diff

Registrant Contact: The IESG.

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

6.2. The "YANG Module Names" Registry

This document registers one YANG module in the YANG Module Names registry [RFC6020] maintained at

Following the format defined in [RFC6020], the following registration is requested:

name: ietf-netconf-ds-diff

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

7. Acknowledgements

The authors would like to thank Scott Mansfield for his reviews and feedback.

8. References

8.1. Normative References

Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <>.
Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, , <>.
Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10.17487/RFC6020, , <>.
Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, , <>.
Wasserman, M., "Using the NETCONF Protocol over Secure Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, , <>.
Bierman, A. and B. Lengyel, "With-defaults Capability for NETCONF", RFC 6243, DOI 10.17487/RFC6243, , <>.
Schoenwaelder, J., Ed., "Common YANG Data Types", RFC 6991, DOI 10.17487/RFC6991, , <>.
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <>.
Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., and R. Wilton, "Network Management Datastore Architecture (NMDA)", RFC 8342, DOI 10.17487/RFC8342, , <>.

8.2. Informative References

Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", BCP 215, RFC 8340, DOI 10.17487/RFC8340, , <>.

Appendix A. Appendix A. Examples

<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
  <datastore-diff xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-ds-diff">
Figure 3: Query RPC Definition
    <rpc-reply message-id="49"
        <interfaces xmlns=""
          <interface nc:operation="create">
Figure 4: Reply Data

Authors' Addresses

Daiying Liu (editor)
Renwang Liu