Re: [netmod] Common etag, timestamp on all interfaces (draft-lindblad-netconf-transaction-id)

Andy Bierman <andy@yumaworks.com> Thu, 24 March 2022 22:57 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9305C3A0D6F for <netmod@ietfa.amsl.com>; Thu, 24 Mar 2022 15:57:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20210112.gappssmtp.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 UfQPTUxP4F_2 for <netmod@ietfa.amsl.com>; Thu, 24 Mar 2022 15:57:07 -0700 (PDT)
Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5DCF03A0D35 for <netmod@ietf.org>; Thu, 24 Mar 2022 15:57:07 -0700 (PDT)
Received: by mail-yb1-xb36.google.com with SMTP id o5so11090487ybe.2 for <netmod@ietf.org>; Thu, 24 Mar 2022 15:57:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OUU8L+3tLmOLZAkUciB2M/XtZ26MFUx2lW59DPozVZ0=; b=OeTk9pOO+ZnzbU2oTEACBCzCXohlvLG31vwFu786LHaCFyKgOhwz6rXGqMZ8KJCmBi QKJZ9bFq2BmPvteWvqD1uLUzlHOLQhGuvmXuxI89OLj0aDaoiUpEiQXLHqNU1Yd+nyGk RUBgEK6MKX+vsx4GNYUNj/RLKIwQkrKo5dT9heveoWas4MbSXA+mVlDugz28U6Z72mDs PzzJIgFcngTFottih39QWkcYxTYtS3uzqp9plSinwbJP1NMOe0g7dmpVU9bhAZPAtXdm LwzJ0LjlHa1GnF/tw2NLeCXVU6qmuVV55OUfpPaCZ/niL3TgmsRUjHzNJS05aSRchCMZ Z04A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OUU8L+3tLmOLZAkUciB2M/XtZ26MFUx2lW59DPozVZ0=; b=j2xC0DeD1qpfCpFbb1YlBSOtHDmtYA+0C5ab2a6EjB9vppQGlaVPce/QvO7+P9MJyE pRf5Cw1GuiCpTARqnlfI7BbxVAxZMkyrtmHyBs7L3XT1i+iKtEQZQLReTLZcLzbgjxOq MVR0SV/2yCmCzw7CPqV+p2gtpv86YJiMhsVZC28vBsBjmraRHsnTjlHZEaPO7tIpkoOD MXvmPD/wN5sAHMYwf7t7VHuJQMfW2LFQ5+kt8sZ24izX6fcSRX+k7Wcun3HSK1rSZxFZ 5TFRP6K56ryr0eP9y5uLwapEYd2kDoif53Wnd0jP8zBGPs/tw4XnZ0v835VmH0g/OI5G XGqg==
X-Gm-Message-State: AOAM530XIWFLVFG6pHzj3To2KO36dGjd+oHzqecevzoR8UfShvuQla5y qfdYdkwAenOrPsgKHEzbS2spRndQHUv26UPBC+wDAQ==
X-Google-Smtp-Source: ABdhPJw7DK3fN53wvXLktnKVnWD4+eEmOAnWHAdGxXAfSnbkWSKik8hYJ+sLr1KTl8rxMMml4yp+aiI7MJJz6nl5enQ=
X-Received: by 2002:a5b:842:0:b0:633:75b6:4129 with SMTP id v2-20020a5b0842000000b0063375b64129mr7369795ybq.64.1648162626037; Thu, 24 Mar 2022 15:57:06 -0700 (PDT)
MIME-Version: 1.0
References: <VI1PR0701MB2351D399AB78445A66E16DD1F0189@VI1PR0701MB2351.eurprd07.prod.outlook.com> <0100017fb906d433-172359f0-01a8-4a82-8e25-8079bdafef76-000000@email.amazonses.com> <VI1PR0701MB2351A58EB0EC5973DAD7454EF0189@VI1PR0701MB2351.eurprd07.prod.outlook.com> <CABCOCHSBHUy4gdQ9vnxMEKGkB4azv5Hjw0shiorVV2-WW_Unrw@mail.gmail.com> <F9E14193-2EC9-41AE-8788-1EA115CC2F20@tail-f.com> <VI1PR0701MB23519A8D0F38BEB559EEB1B5F0199@VI1PR0701MB2351.eurprd07.prod.outlook.com>
In-Reply-To: <VI1PR0701MB23519A8D0F38BEB559EEB1B5F0199@VI1PR0701MB2351.eurprd07.prod.outlook.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Thu, 24 Mar 2022 15:56:55 -0700
Message-ID: <CABCOCHQk8kg+jr-NBydqJpZN068=oDq7j5EurstNN2LJSv8wCw@mail.gmail.com>
To: =?UTF-8?Q?Bal=C3=A1zs_Lengyel?= <balazs.lengyel@ericsson.com>
Cc: Jan Lindblad <janl@tail-f.com>, Kent Watsen <kent@watsen.net>, "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000db803005dafec32e"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/IuouT_mvx5hktda_87IN72YEMtI>
Subject: Re: [netmod] Common etag, timestamp on all interfaces (draft-lindblad-netconf-transaction-id)
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 24 Mar 2022 22:57:13 -0000

On Thu, Mar 24, 2022 at 1:52 PM Balázs Lengyel <balazs.lengyel@ericsson.com>
wrote:

> Hello Jan,
>
> I don’t see a specific need for timestamps, so I can accept your arguments
> against it. Just add a sentence about it somewhere into the draft. It can
> be an appendix.
>
>
>

OK with me.
A timestamp could be added in the future if it is really important enough.

In fact, it would be a good idea to break from ETag completely, because
that is tied
to the representation, which is not what is needed here.

We call a "transaction-id" a "config-id" once it is applied to a datastore.
The internal uint64 ID is global, not per datastore.
The "config-id" attribute is added to the <config> element in certain cases.
(It is useful to expose the config-id in <get-config>, NV-store, etc)



Common/Uniform ETAGs for multiple interfaces is only important if you
> actually use multiple interfaces. That actually happens when
> troubleshooters use a big OSS system to do most of the work, but also use a
> thin client or the CLI to check a few things during the process. So yes
> uniform Etags are important.
>

I would say universal transaction-ids (same in each protocol) is a SHOULD,
not a MUST.


> Regards Balazs
>

Andy


>
>
> *From:* Jan Lindblad <janl@tail-f.com>
> *Sent:* Thursday, 24 March, 2022 21:38
> *To:* Andy Bierman <andy@yumaworks.com>om>; Balázs Lengyel <
> balazs.lengyel@ericsson.com>gt;; Kent Watsen <kent@watsen.net>
> *Cc:* netmod@ietf.org
> *Subject:* Re: [netmod] Common etag, timestamp on all interfaces
> (draft-lindblad-netconf-transaction-id)
>
>
>
> Andy, Balazs, Kent,
>
>
>
> Thanks for your very good questions. Comments inline.
>
> I assume that the etag defined in your I-D is the same as the one defined
> in Restconf. Does or should your draft include a statement like:
>
> “The etag values maintained by the server are protocol/interface
> independent. If requested the same etag values will be visible on all
> interface including Restconf, Netconf, CLI etc.”
>
>
>
> While it makes sense that a server would use the same values across
> protocols, I'm unsure if it's needed and, if we do, if we could state it in
> a NETCONF-specific draft.
>
> BALAZS2: I see it as a VERY important advantage of the whole
> YANG/Netconf/Restconf ecosystem that the separate protocols (practically
> including the CLI and possibly a gui too) are just views of the same
> central configuration datastore. So IMO this is important and should be
> stated.
>
> As an implementor, I think it makes great sense to use the same
> underlaying mechanism for all mgmt interfaces.
>
>
>
> I could imagine some implementors planning to lean on the wire
> representation to compute hashes over the data as their ETag
> implementation. That would not be possible under this requirement, but
> ruling out that particular idea would not be problematic, imo.
>
>
>
> Long ago, I pondered this question for a while, but then I wasn't able to
> think of a use case where a client would benefit from a guarantee that all
> interfaces have common ETags, so I left it out in order to not produce a
> CLR. I'm not against adding this requirement if we can think of a
> reasonable reason why. Adding a requirement for CLI+GUI sounds hard in
> practice, though.
>
> I strongly support this approach.
>
> It applies to the entire server API, including notifications.
>
> E.g., a client should be able to reuse code for processing NETCONF
> notifications,
>
> even if the protocol is RESTCONF or the new YANG-Push over UDP.
>
>
>
> The RESTCONF mechanisms adapted from HTTP should be extended to be
>
> protocol-independent.  Our goal should be code to the YANG models, NOT the
> protocols.
>
>
>
> Yes, I certainly like that.
>
> Restconf also includes timestamps. What was your reason to exclude them
> from your I-D ? IMHO if the server maintains timestamps they would be
> protocol/interface independent just as etags, so the task is to make them
> available on Netconf too (and maybe the CLI).
>
> I agree and have mentioned before.  LastModified either needs to be added,
> or justified why not added, to get my adoption support.
>
> I'm not against having Last-Modified in there. In fact, it was in the
> draft initially. Here's the justification why I removed it :-)
>
>
>
> + When I started the cost/benefit analysis for what I proposed, I soon
> found that it's not unimportant how many and how large ETag attributes are
> added to the payload. Having two mechanisms (i.e. both ETag and
> Last-Modified) doing pretty much the same thing started to look expensive
> in performance.
>
> + Since it's essential that the time stamp would have to be the same on
> all touched elements, all the components/subsystems/subagents involved
> would still have to be fed the exact time from the central management agent.
>
> + Then there's one or two more things with If-Unmodified-Since that I
> discuss below.
>
>
>
> I agree. They both need to be supported in RESTCONF.
>
>
>
> RESTCONF has a SHOULD for the (single) datastore root level and MAY for
> the deeper levels.
>
>
>
> A timestamp can be applied to multiple servers, unlike the ETag values.
>
>
>
> I don't think this analysis is correct. A client connecting with 15
> servers in a network wide transaction would surely receive several
> differing timestamps. The times may be fairly close if NTP is running fine,
> latency is low, network and cpu load is even and the servers are running
> similar code, but they will rarely all be the same even with the low 1s
> Last-Modified resolution. If you allow clients to set the ETag in the
> request (which is trivial to allow), then the tags could be exactly the
> same across all servers (and known to the client before the request is even
> sent to the servers, allowing request pipelining).
>
>
>
> Typical usage is for the client to track its own polling timestamps,
>
> and use If-Modified-Since to retrieve data only if needed.
>
> The same timestamp can also be used with If-Unmodified-Since for edits.
>
>
>
> If-Unmodified-Since is what set me going with this whole draft, so
> obviously I value that mechanism highly. The fact that it works with
> timestamps worries me a bit, however.
>
>
>
> First, the resolution is pretty low, 1s. It is quite possible that a
> server could process more than one edit/POST in the same second, in which
> case this mechanism might indicate no change has taken place when in fact
> it has.
>
>
>
> Secondly, while the idea with timestamps and "unmodified since" is very
> convenient, it's also quite brittle. If a client ever sends an edit request
> to a server without using the If-Unmodified-Since, it may miss an update
> made by another client. The ETag mechanism does not have that issue.
>
>
>
> If this isn't obvious, here's an example:
>
> 1. Client A sends an edit to the server If-Unmodified-Since t0.
> Successful. Receives a Last-Modified timestamp t1.
>
> 2. Client B sends a an edit to the server. Last-Modified timestamp on
> server is now t2.
>
> 3. Client A sends an edit to the server without If-Unmodified-Since. It
> just sets one tiny little leaf off in one corner. Successful. Received a
> Last-Modified timestamp t3.
>
> 4. Client A sends an edit to the server If-Unmodified-Since t3.
> Successful, but clobbers Client B's edit, leading to a misconfiguration,
> which opens a security hole.
>
>
>
> This is because the If-Unmodified-Since uses less than or equal in its
> test. The ETag mechanism is not susceptible to this issue, as it uses an
> equality test.
>
>
>
> Best Regards,
>
> /jan
>
>
>