Re: [Netconf] Does <discard-changes> do the same thing as <copy-config>-ing 'running' to 'candidate'?

Ariel Otilibili Anieli <otilibil@eurecom.fr> Fri, 25 May 2018 13:27 UTC

Return-Path: <otilibil@eurecom.fr>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F355612DA41 for <netconf@ietfa.amsl.com>; Fri, 25 May 2018 06:27:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ca4xlur1LcUT for <netconf@ietfa.amsl.com>; Fri, 25 May 2018 06:27:03 -0700 (PDT)
Received: from smtp2.eurecom.fr (smtp2.eurecom.fr [193.55.113.211]) by ietfa.amsl.com (Postfix) with ESMTP id B6CB812DA6B for <netconf@ietf.org>; Fri, 25 May 2018 06:27:01 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.49,440,1520895600"; d="scan'208";a="8122254"
Received: from thorgal.eurecom.fr ([10.3.2.220]) by drago2i.eurecom.fr with ESMTP; 25 May 2018 15:27:00 +0200
Received: (from apache@localhost) by thorgal.eurecom.fr (8.14.4+Sun/8.14.4/Submit) id w4PDR0rK011310; Fri, 25 May 2018 15:27:00 +0200 (CEST)
X-Authentication-Warning: thorgal.eurecom.fr: apache set sender to otilibil@eurecom.fr using -f
Received: from reverse.completel.net (reverse.completel.net [92.103.89.82]) by webmail.eurecom.fr (Horde MIME library) with HTTP; Fri, 25 May 2018 15:27:00 +0200
Message-ID: <20180525152700.nu2nrswv8k4os4g4@webmail.eurecom.fr>
Date: Fri, 25 May 2018 15:27:00 +0200
From: Ariel Otilibili Anieli <otilibil@eurecom.fr>
To: Attila Vangel <vangel.attila@gmail.com>
Cc: netconf@ietf.org
References: <CAGSQd2-_S+5-ZmzbPB10DBch7ns8M=X8w5-0H4j+7TRk7USJpA@mail.gmail.com> <20180525122148.jz296uxlw0w4448w@webmail.eurecom.fr> <CAGSQd2_i+KWiU2gqKq8qBPKWO1DZ_nu13b3-nQYDb1qT43OPZQ@mail.gmail.com>
In-Reply-To: <CAGSQd2_i+KWiU2gqKq8qBPKWO1DZ_nu13b3-nQYDb1qT43OPZQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; DelSp="Yes"; format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
User-Agent: Internet Messaging Program (IMP) H3 (4.1.4)
X-Originating-IP: 92.103.89.82
X-Remote-Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/Mh-Crk-NYpoTBUWNeQrahHEYKRI>
Subject: Re: [Netconf] Does <discard-changes> do the same thing as <copy-config>-ing 'running' to 'candidate'?
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 25 May 2018 13:27:16 -0000

Hi Attila,

Below my comments.

Regards,
Ariel

Quoting Attila Vangel <vangel.attila@gmail.com>:

> Hi Ariel,
>
> Thanks for the quick turnaround! See my comment below.
>
> On Fri, May 25, 2018 at 12:21 PM, Ariel Otilibili Anieli <
> otilibil@eurecom.fr> wrote:
>
>> Hi Attila,
>>
>> Comments below.
>>
>> Regards,
>> Ariel
>>
>> Quoting Attila Vangel <vangel.attila@gmail.com>:
>>
>> Hi,
>>>
>>> N00b question on netconf. Could somebody please clarify?
>>>
>>> 1. Does <discard-changes> (
>>> https://tools.ietf.org/html/rfc6241#section-8.3.4.2) have totally the
>>> same
>>> effect as <copy-config>-ing 'running' to 'candidate'?
>>>
>> No.
>>
>>>
>>> "This operation discards any uncommitted changes by resetting the
>>>    candidate configuration with the content of the running
>>>    configuration."
>>>
>>> If so, was it introduced as a shorter alternative of copying?
>>> If not, what is the difference between them?
>>>
>> <copy-config> copies the content of a datastore to another, whatever it
>> is; <discard-changes> discards the changes made on the 'candidate'
>> datastore.
>>
>
> In this case the description for <discard-changes> is incorrect in RFC,
> because it states: "resetting the
>    candidate configuration with the content of the running
>    configuration" (see above). So looks like this is a bug in the RFC.
It depends on what 'candidate' contained before edition. Let's say  
'candidate' contains B; 'running' has A. When editing, I changed B in  
B'. At that moment, if I have sent no <commit>, and I  
<discard-changes>, then 'running' stays A, 'candidate'  becomes A  
(though it contained B'). This is how I understand Section 8.3.4.2 of  
RFC 6241.
> Anyway, I get the point now.
>
> Attila
>
>
>>
>>> 2. I got confused because I watched a tutorial on youtube which used both
>>> commands, first <discard-changes> before locking any config datastores,
>>> and
>>> <copy-config>-ing 'running' to 'candidate' after locking these datastores.
>>> (The assumption in this example is that the device supports 'candidate'.)
>>>
>> I suppose they wanted to edit 'candidate' from 'running', that's why they
>> <copy-config> before edition.
>>
>>>
>>> 3. For the first time I was puzzled why to do <discard-changes> before
>>> doing any locking, but then I read in the RFC that lock would fail if
>>> 'candidate' was "dirty" (https://tools.ietf.org/html/rfc6241#section-7.5
>>> ):
>>>
>>> A lock MUST NOT be granted if any of the following conditions is
>>>       true:
>>>
>>>       *  A lock is already held by any NETCONF session or another
>>>          entity.
>>>
>>>       *  The target configuration is <candidate>, it has already been
>>>          modified, and these changes have not been committed or rolled
>>>          back.
>>>
>>>       <...>
>>>
>>> Another thing on <lock>
'candidate' behaves the same way with <lock> and <unlock> (See,  
https://tools.ietf.org/html/rfc6241#section-8.3.5.2): Supposing  
'candidate' contains B, that I have changed in B', at the release with  
<unlock>, 'candidate' reverts to B, if no <commit> I have made.
>>
>>> But still I am not sure about 1. If these commands do the same thing,
>>> using
>>> <copy-config> in this tutorial was just for showcasing doing it yet
>>> another
>>> way in 2.?
>>>
>>> (I was not sure whether to share the link for the tutorial, maybe it
>>> would look like as advertising the company/author who did the
>>> tutorial.)
>>>
>>> Best regards,
>>> Attila
>>>
>>>
>>
>>
>> ------------------------------------------------------------
>> -------------------
>> This message was sent using EURECOM Webmail: http://webmail.eurecom.fr
>>
>>
>



-------------------------------------------------------------------------------
This message was sent using EURECOM Webmail: http://webmail.eurecom.fr