Internet-Draft | Get Datastore Differences | February 2022 |
Liu & Liu | Expires 25 August 2022 | [Page] |
This document defines a "datastore-diff" RPC that returns the differences between two datastores in an XML-based format.¶
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 https://datatracker.ietf.org/drafts/current/.¶
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.¶
Copyright (c) 2022 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
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 8.3.4.1).¶
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.¶
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].¶
The newly defined "datastore-diff" RPC accept input parameters to indicate source and target datastore, as described in Section 3.2.¶
The following figure illustrates the "ietf-netconf-ds-diff" module tree diagram [RFC8340]:¶
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
/datastore-diff/target:¶
Name of the target datastore to be compared, can be either of startup, candidate and running.¶
/datastore-diff/source:¶
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.¶
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; 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>
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.¶
This document registers one URI in the "ns" subregistry of the IETF XML Registry [RFC3688] maintained at https://www.iana.org/assignments/xml-registry/xml-registry.xhtml#ns.¶
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.¶
This document registers one YANG module in the YANG Module Names registry [RFC6020] maintained at https://www.iana.org/assignments/yang-parameters/yang-parameters.xhtml.¶
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¶
The authors would like to thank Scott Mansfield for his reviews and feedback.¶
<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>
<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>