Re: [core] WG Last Call on draft-ietf-core-conditional-attributes

Klaus Hartke <hartke@projectcool.de> Thu, 12 January 2023 16:49 UTC

Return-Path: <hartke@projectcool.de>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 50D61C1524AA for <core@ietfa.amsl.com>; Thu, 12 Jan 2023 08:49:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.899
X-Spam-Level:
X-Spam-Status: No, score=-6.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jMvx-gmaolVt for <core@ietfa.amsl.com>; Thu, 12 Jan 2023 08:49:09 -0800 (PST)
Received: from wp382.webpack.hosteurope.de (wp382.webpack.hosteurope.de [80.237.133.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CCF2CC1516EA for <core@ietf.org>; Thu, 12 Jan 2023 08:49:02 -0800 (PST)
Received: from mail-vs1-f43.google.com ([209.85.217.43]); authenticated by wp382.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1pG0l9-0000CV-Vv; Thu, 12 Jan 2023 17:49:00 +0100
Received: by mail-vs1-f43.google.com with SMTP id q125so7895832vsb.0 for <core@ietf.org>; Thu, 12 Jan 2023 08:48:59 -0800 (PST)
X-Gm-Message-State: AFqh2kpaFK0O286tlnRX9EdU23TNWZn3LXHwQ+mM4/oVLD0xXVv1KZlt dcDCJqBXE6MHKxDACD/FVDpLxFY0FexuP2qaUXw=
X-Google-Smtp-Source: AMrXdXs6ch2Fwyh1U4xJ2JVg1hOnBCpLPT2DpPYb6Yx/j7UzRnjLuQ2VJG7aRir9DSqpTHJD74DRCpXDsnnkwBPXYow=
X-Received: by 2002:a05:6102:508a:b0:3ce:a5a8:1f22 with SMTP id bl10-20020a056102508a00b003cea5a81f22mr5797950vsb.28.1673542139035; Thu, 12 Jan 2023 08:48:59 -0800 (PST)
MIME-Version: 1.0
References: <5a8317ff-c7ff-ffda-da15-94bb04700451@ri.se>
In-Reply-To: <5a8317ff-c7ff-ffda-da15-94bb04700451@ri.se>
From: Klaus Hartke <hartke@projectcool.de>
Date: Thu, 12 Jan 2023 17:48:23 +0100
X-Gmail-Original-Message-ID: <CAAzbHvaqrM6v+Ls+MfVENAhxSWNdJbRFFbfeu+7-jT-uGFdwEg@mail.gmail.com>
Message-ID: <CAAzbHvaqrM6v+Ls+MfVENAhxSWNdJbRFFbfeu+7-jT-uGFdwEg@mail.gmail.com>
To: "core@ietf.org WG (core@ietf.org)" <core@ietf.org>
Content-Type: text/plain; charset="UTF-8"
X-bounce-key: webpack.hosteurope.de; hartke@projectcool.de; 1673542142; 47125a5b;
X-HE-SMSGID: 1pG0l9-0000CV-Vv
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/O8ZTPOAve3xljuZ6HwXR0yKZ8R8>
Subject: Re: [core] WG Last Call on draft-ietf-core-conditional-attributes
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Jan 2023 16:49:11 -0000

Hi all,

here is my review of draft-ietf-core-conditional-attributes-05.

The draft presents a protocol extension of "Observing Resources in
CoAP" [RFC7641].  RFC7641 is itself a protocol extension of CoAP
[RFC7252], which enables a CoAP client to retrieve the state of a
resource at a CoAP server (in the form of a resource state
representation) and to keep this retrieved state in sync with the
actual state at the server. The semantics of this mechanism are pretty
much the same as polling the source, but behaves more efficiently by
using a notification mechanism under the hood where the server chooses
the best strategy under the principle of eventual consistency ("If the
resource does not undergo a new change in state, eventually all
registered observers will have a current representation of the latest
resource state.")

According to itself, "Conditional Attributes for Constrained RESTful
Environments" [draft-ietf-core-conditional-attributes-05] aims to give
clients more fine-grained control over how the server generates
notifications. To make it short, this aim is fundamentally at odds
with how RFC7641 works: The notification mechanism in RFC7641 is a
protocol detail that operates under the hood to provide the
functionality of keeping the retrieved resource state in sync with
actual resource state. The Conditional Attributes defined by the draft
interfere with the generation of notifications, so that this
functionality is in its generality no longer given: The client no
longer receives a representation of the actual resource state through
the notifications.

I therefore believe that this draft should not become an RFC in its
current form.

However, I think that the draft actually just got the formulation of
its aim wrong. Rather than interfering with under what conditions and
in what way the server generates notifications, the draft should
define how the server updates resource state and how the client can
influence this.

A simple good way is resource state projection. For example, if the
state is a numeric value, it is possible to project a new state from
the resource state using e.g. the min or max function. This new state
can then be observed by the client. And the best way for the client to
let the server project the resource state in this way is to
parameterize the resource with a query string. A possible Conditional
Attribute could therefore be "max=X". This makes the observed resource
state the result of the calculation max(X,Y) where X is the query string
value and Y is the actual resource state.

Another way is that the server doesn't even change the state of the
resource unless certain condition(s) are met. For example, whenever
the server wants to change the state of a resource with a numeric
value, it compares the new value to the old one, and it skips changing
state if the difference doesn't exceed a threshold. This threshold
value can also be specified by a client using a query string. This
results in exactly the same behavior as some of the existing
attributes, just not in terms of sending notifications but changing
resource state!

Overall I think it would be straightforward to redefine almost all
attributes in one of these two ways. An exception is an attribute like
pmax, which makes a server send notifications that it wouldn't have to
send with RFC7641. Such a change in protocol cannot be achieved by
changing the way resource states are updated. Instead, the draft
should describe it for what it is: a protocol extension. And for
protocol extensions, we use options in CoAP.

Best regards,
Klaus