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

Robert Wilton <rwilton@cisco.com> Fri, 25 May 2018 13:49 UTC

Return-Path: <rwilton@cisco.com>
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 3B69112DA0C for <netconf@ietfa.amsl.com>; Fri, 25 May 2018 06:49:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.51
X-Spam-Level:
X-Spam-Status: No, score=-14.51 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com
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 Hl6tgaalKA0u for <netconf@ietfa.amsl.com>; Fri, 25 May 2018 06:49:50 -0700 (PDT)
Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5998F126D05 for <netconf@ietf.org>; Fri, 25 May 2018 06:49:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=16167; q=dns/txt; s=iport; t=1527256190; x=1528465790; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to; bh=p41YuqTljHPaju/7bck9IB/3BdCGlzme92z0AnDiL4I=; b=OcxrKIZzidjqM3BLWEfp4p11F6K0IOHFO82nioFTCKnCfqoE6We/FVpl 9qLMbhkNLf5drscAnvOG64hbd5M+3ibYI64DMZRYhvqqCJhF95WRjnig9 c0zbTOIDMNFBJBGSGCBQnBf6yuHxA9ssfnL3xzcOPsmkrS5THtrFm28Vh E=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0BqAwCHEwhb/xbLJq1XBBkBAQEBAQEBAQEBAQEHAQEBAQGDGYENfSiDd4hjjV0pgQ+CIIRlhEiCdoZuCxgBCoQDRgKCMDcVAQIBAQEBAQECbBwMhSgBAQEBAgEBASFLCwULCQIYIwQDAgIhBh8RBg0GAgEBgx4CgWcDDQgPjGibQ4IcH4Q5gjENgSuBfIoKP4EzgjQ1gk8XKwEBAgGBRwyDCoJUAocqGolchxMsCYVshXFpghEGgTs+gzGCPSKEfYloSoEjhS6BVyImgSwzGggbFTuCQwmBZzAXEWkBCIQAg1aFPz4wAQEBjnABAQ
X-IronPort-AV: E=Sophos;i="5.49,440,1520899200"; d="scan'208,217";a="4094908"
Received: from aer-iport-nat.cisco.com (HELO aer-core-4.cisco.com) ([173.38.203.22]) by aer-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 May 2018 13:49:48 +0000
Received: from [10.63.23.83] (dhcp-ensft1-uk-vla370-10-63-23-83.cisco.com [10.63.23.83]) by aer-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id w4PDnlXE015612; Fri, 25 May 2018 13:49:48 GMT
To: Attila Vangel <vangel.attila@gmail.com>
Cc: Ariel Otilibili Anieli <otilibil@eurecom.fr>, 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>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <44facb91-7ae6-a75b-dafa-8b5bb43f944c@cisco.com>
Date: Fri, 25 May 2018 14:49:47 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <CAGSQd2_i+KWiU2gqKq8qBPKWO1DZ_nu13b3-nQYDb1qT43OPZQ@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------DC26BD478D653C2F3F568447"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/YYabkmnu-LcVoYCqf7YGlvnObtc>
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:49:53 -0000

Hi Attila,

On 25/05/2018 13:01, Attila Vangel wrote:
> 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 <mailto:otilibil@eurecom.fr>> wrote:
>
>     Hi Attila,
>
>     Comments below.
>
>     Regards,
>     Ariel
>
>     Quoting Attila Vangel <vangel.attila@gmail.com
>     <mailto: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
>         <https://tools.ietf.org/html/rfc6241#section-8.3.4.2>) have
>         totally the same
>         effect as <copy-config>-ing 'running' to 'candidate'?
>
In terms of the contents of the candidate datastore then I would say yes 
the operations are the same.

However, if the server is tracking config commits, then it could store 
different associated meta data for the two operations.

>     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. 
> Anyway, I get the point now.
I don't think that RFC is wrong.

Is is just that <candidate> normally starts with a copy of <running>.
Then the client modifies the contents of <candidate>, and finally it 
gets committed to <running>, at which point both datastores then have 
the same contents again.

So the <discard-changes> is effectively removing any pending changes in 
candidate, which is equivalent to reverting the contents back to 
<running>, and would also be equivalent to doing <copy> from <running> 
to <candidate>, if that is supported by the server.

So I think <discard-changes> is really just syntactic sugar.

Thanks,
Rob


>
> 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
>         <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>
>
>         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
>
>
>
>
> _______________________________________________
> Netconf mailing list
> Netconf@ietf.org
> https://www.ietf.org/mailman/listinfo/netconf