Re: [core] Dynlink observation attributes

Christian Amsüss <christian@amsuess.com> Tue, 09 April 2019 11:18 UTC

Return-Path: <christian@amsuess.com>
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 551D612077B for <core@ietfa.amsl.com>; Tue, 9 Apr 2019 04:18:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] 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 pAzYNupBZaMp for <core@ietfa.amsl.com>; Tue, 9 Apr 2019 04:18:01 -0700 (PDT)
Received: from prometheus.amsuess.com (alt.prometheus.amsuess.com [IPv6:2a01:4f8:190:3064::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 284D1120778 for <core@ietf.org>; Tue, 9 Apr 2019 04:18:01 -0700 (PDT)
Received: from poseidon-mailhub.amsuess.com (095129206250.cust.akis.net [95.129.206.250]) by prometheus.amsuess.com (Postfix) with ESMTPS id 5C2E343819; Tue, 9 Apr 2019 13:17:58 +0200 (CEST)
Received: from poseidon-mailbox.amsuess.com (hermes.amsuess.com [10.13.13.254]) by poseidon-mailhub.amsuess.com (Postfix) with ESMTP id A854E26; Tue, 9 Apr 2019 13:17:56 +0200 (CEST)
Received: from hephaistos.amsuess.com (unknown [IPv6:2a02:b18:c13b:8010:8877:7422:b795:852a]) by poseidon-mailbox.amsuess.com (Postfix) with ESMTPSA id 5174574; Tue, 9 Apr 2019 13:17:56 +0200 (CEST)
Received: (nullmailer pid 11512 invoked by uid 1000); Tue, 09 Apr 2019 11:17:48 -0000
Date: Tue, 9 Apr 2019 13:17:48 +0200
From: Christian =?iso-8859-1?Q?Ams=FCss?= <christian@amsuess.com>
To: Michael Koster <michael.koster=40smartthings.com@dmarc.ietf.org>
Cc: Bill Silverajan <bilhanan.silverajan@tut.fi>, "jintao.zhu@huawei.com" <jintao.zhu@huawei.com>, core@ietf.org
Message-ID: <20190409111747.GC15632@hephaistos.amsuess.com>
References: <20180926163552.GA18946@hephaistos.amsuess.com> <F9E67E99-9F20-4A4E-822B-8B12900A8173@smartthings.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GZVR6ND4mMseVXL/"
Content-Disposition: inline
In-Reply-To: <F9E67E99-9F20-4A4E-822B-8B12900A8173@smartthings.com>
User-Agent: Mutt/1.10.1 (2018-07-13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/OluqU6XKd-TZDNPDW8AU3CUzCUo>
Subject: Re: [core] Dynlink observation attributes
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
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: Tue, 09 Apr 2019 11:18:05 -0000

Hello Michael,

On Tue, Nov 06, 2018 at 12:05:57AM -0800, Michael Koster wrote:
> I am convinced that we need to support observe attributes as query
> parameters to an observe request, and include them in the request
> caching. This makes sense as an application pattern and as a
> sub-pattern for dynlinks (below).

Glad you agree.

> The modified URI may be thought of as a newly defined resource that
> exposes a coarser grained dynamic representation of the same variable
> indicated by the other URI parameters. I haven't fully thought through
> the caching issue with etags and lifetimes, but it seems like there
> will be ony one set of parameters feeding any given cached resource.
> The notifications should be cacheable.

Maybe even a bit better: I think that a proxy that has learned (eg. by
having seen interface type information earlier) that a resource supports
query attributes[1] could, when receiving a second observation on the
same "resource" with different filters, pick a more generic one and
serve the more specific ones after applying its own filtering.

[1]: I think it'd make sense to define an interface type for that, for
otherwise no client can be sure that /t?pmin=5 is actually a view on /t
and not something completely different.

> On that, I believe that the use of target attributes in a dynlink is
> quite reasonable if we consider that the target of the link is always
> the source of the transfer when rel=boundto, and that we always use
> the observe mechanism as an architectural model => they are always
> observe attributes, and they apply to the target of the link which is
> hte source of the transfer.

It also makes it very hard to move those links over to the semantic web
world for reasoning, as those target attributes are per-link and not
per-target.

If there's a statement like

<coap://sensor/temp?st=2>;rel=boundto;anchor="/monitor"

then that can be processed on easily in RDF or any other information
model that does not carry information per-link in the way we had
sketched for JSON-LD enrichted links-json during IETF96 in Berlin.

If the statement is

<coap://sensor/temp>;rel=boundto;st=2;anchor="/monitor"

then all semantic-web style processing needs to be aware of all those
attributes, and can't wrap the information in a set of statements that
includes `/monitor is boundto coap://sensor/temp` as the step
information can't hook onto that statement.

(Also, having the parameters in the target makes the binding site easier
to implement, as it won't have to do URI fiddling but just takes a URI
and observes it).

> The "native" case is simply an optimization and not an architecture
> permutation. A practical implementation may re-use the observe
> mechanism for local transers. 
>
> Note also that the "bind" attribute is not strictly needed if we apply
> these other constraints, as you point out. We may always assume
> observe as an architectural model. This can be generalized to allow
> the link to be stored anywhere that a client function can be
> implemented, especially useful if we don't want to modify existing
> servers. 

I'm not saying it is very special, I'm more saying that GET/observe and
PUT are not.

> Not sure if we need polling but if we do, it's probably not the same
> relation as "boundto". The transfer would likely be from source to
> target like rel=polls, as in "target polls context". Only one
> attribute of poll interval could be supported, and of course the
> others could be modeled on observers of the target resource after the
> polling, using the algorithm. 

The binding site may not have control over whether what actually happens
is polling or observation (and thus the distinction is of limited use);
per RFC7641 Section 5, intermediaries could make the same observation
polling-based over one hop and actually observing on the next one.

> In the draft we can describe the observe attribute first, then
> describe the use in dynlinks, then describe a link table example
> implementation. I think a lot of the confusion can be alleviated this
> way, and we can focus on preferred patterns.

That's certainly a structure that will help, even now that both
components stay in the same document.

> Note that using a dynlink makes the observe parameters visible and
> gives the observe relationship an affordance.
> 
> Does this all make sense?

The affordance part does not, possibly because I've heard the term only
in the context of high-level usefullness. As I understand the term, he
affordance would be informing a heating valve of a room temperature, and
that affordance can be implemented in the CoRE ecosystem by placing a
dynlink.

> Does this make sense? I could write up a rough strawman draft with the
> changes.

I'd be happy to read that.

Best regards
Christian

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom