Re: [core] protocol-negotiation and web linking

Martin Thomson <martin.thomson@gmail.com> Mon, 26 February 2018 02:25 UTC

Return-Path: <martin.thomson@gmail.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 3ECEC1243F3; Sun, 25 Feb 2018 18:25:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 NqgyYDBao7Rc; Sun, 25 Feb 2018 18:25:28 -0800 (PST)
Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com [IPv6:2607:f8b0:4003:c06::233]) (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 2B2CD120713; Sun, 25 Feb 2018 18:25:28 -0800 (PST)
Received: by mail-oi0-x233.google.com with SMTP id c83so9606079oib.1; Sun, 25 Feb 2018 18:25:28 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tELK1iZ+irKROTHc6Ddc/b3zLMbpg3W/4Si85y7LpMw=; b=i8EKXFcAlydpOLRqerFWBg3tml/IPioj54bRVhidnemCuc+qp+k34oCHosjxGXnhTr eVlJVc1U1DiTPIVrJvANKhjRErBTEj+e4byLWDNkbp0+hERkQ9qb3WBVPylqC/mB54eK DQpE5xGofvYOqC7EzINKbAyzYAnT7BboC25HGRfvToercnKTvfyo9mAbUHIv++1L5arb qjMwLFX+LEdRTtiQre9kkVOQVnbZazfxZoTLmABPXmiaH/f2UdhIIqEI16LT7YFdYSOx ZVRDr7DcYVdAckBJDfS2jcPHdlGyUpUMcdoua2wlpQgiKV8ZRLSdFOLgNAnLkqmIQjmh VDwQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tELK1iZ+irKROTHc6Ddc/b3zLMbpg3W/4Si85y7LpMw=; b=jfwgXNuqfNOLr/e4YrCPod2jTgXIhsBWAneGaxRphJO+XOC9sbEgtS51dtLHTP6EYn OoBjyXe9W/KDaB/A1XUYmt+GCCn5tVyOvwChSQzVWrtl3rrbN0aSXIqkUBEGZ3/Z/AqH O/XRNiA8q53J/Eo5xd2uIy8qxggDHNhDLKbl2E4xU1tfEOn5/p9YlySgs6Wspq2y78mI vEz9wschhAluz+Ghblms6YlCQ2UcbNeq+DmNTSHwnWnsxirPguQofsiuItSDFso/wRq8 ywiZieqYKSp8TH+X9L0HnRu0Y+lNSqK4J7moC40z69V1uwsJCFN9EanODKYd5mV/9/DG qDdw==
X-Gm-Message-State: APf1xPDRqf2Xbmo1HSuB87O0DKGCJyqZAFl6nwVG+S7J4V37ofSxE+ba hXTbWT+ZQR/hcVXXkEwiT24efMxgiEKZajq9jpIV5Q==
X-Google-Smtp-Source: AG47ELtFX9yXDAeEpszegBev95W9RYosbDVkCtgNLQdO+qi/nIHOqe24npIJSAqVfcoibqXekCpm/WgkKemJbpOZlu8=
X-Received: by 10.202.94.196 with SMTP id s187mr5466438oib.144.1519611927332; Sun, 25 Feb 2018 18:25:27 -0800 (PST)
MIME-Version: 1.0
Received: by 10.157.16.85 with HTTP; Sun, 25 Feb 2018 18:25:27 -0800 (PST)
In-Reply-To: <20180224114026.GA4265@hephaistos.amsuess.com>
References: <20180223150833.GA26617@hephaistos.amsuess.com> <20180224114026.GA4265@hephaistos.amsuess.com>
From: Martin Thomson <martin.thomson@gmail.com>
Date: Mon, 26 Feb 2018 13:25:27 +1100
Message-ID: <CABkgnnXWK+aL+jbSqxe=N=vWv8NU+QmGs0XNtYA3_wQR2BkreA@mail.gmail.com>
To: Christian Amsüss <c.amsuess@energyharvesting.at>
Cc: draft-silverajan-core-coap-protocol-negotiation@ietf.org, Core WG mailing list <core@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/b-fca3jcIH-SNc0PJQKZFTGZ1pQ>
Subject: Re: [core] protocol-negotiation and web linking
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.22
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: Mon, 26 Feb 2018 02:25:30 -0000

Just a tourist, but can someone explain why this design needs to be so
fundamentally different to RFC 7838?

Making the means by which a resource is identified differ based on the
means of interaction is something we have tried hard to avoid in HTTP.
Or maybe this is the key point of divergence between HTTP and COAP and
any attempt to address this is a lost cause.

On Sat, Feb 24, 2018 at 10:40 PM, Christian Amsüss
<c.amsuess@energyharvesting.at> wrote:
> Hello Bill and Mert,
>
> during the review of protocol-negotiation, I came up with an idea that
> is too far off from the document to go directly into a review. It might
> be an overdose of web-linking talking here, so feel free to dismiss it
> if need be, but maybe there are ideas in it that can help bring on p-n.
>
> Let me start with examples and then explain what they should mean:
>
> | Req: GET coap://node1/.well-known/core
> | Res: 2.05 Content, Payload:
> | <>;alt-base="coap+tcp://node1",
> | </sensor/temp>;if="core.s"
>
> or when registering at the RD:
>
> | Req: POST /rd?ep=node1&con=coap://node1
> | <>;alt-base="coap+tcp://node1",
> | </sensor/temp>;if="core.s"
> | Res: 2.01 Created, Location: /reg/1234
>
> The endpoint registering at the RD could update the alt-base value(s) of
> the link like it would update any other link it manages. (Admittedly,
> that part of RD got postponed; might look like PATCH /reg/1234, Payload
> {"1": {"href": "", "alt-base": ["coap+tcp://node1:1234"]}} in some
> upcoming JSON link patch format).
>
> Resource lookups would stay the same. Asking a server directly for
> alternative transports could be done with GET
> /.well-known/core?alt-base=* or /.well-known/core?alt-base=coap+ws://*.
> This would be a dedicated request rather than piggy-backing onto any
> existing one with a new option, but we're doing the same with any of the
> other resource metadata as well, and a .well-known/core discovery is
> often the first step in interaction anyway.
>
> One way to give the protocol negotiation meaning to this would be only
> two normative sentences:
>
> | An "alt-base" attribute on a link means that representations of the link
> | target are equally valid if the attribute's value were assigned as Base
> | URI of the encapsulating entity (RFC3986 Section 5.1.2) for the purpose
> | of resolving relative references in the document. URIs obtained from the
> | representation using any alt-base value are all related to the URI
> | obtained from the same reference without considering the alt-base
> | attribute by the "alternative" relation (and therefore to each other, as
> | that relation is transitive).
>
> (I've picked the "alternative" relation here; see my review comments on
> the `ol` attribute. If no link relation is deemed suitable and you stay
> with `ol`, the second sentence would need to say that they are
> "equivalent for all REST operations supported by their protocols".)
>
>
> The approach of transmitting the URI data in link attributes is
> motivated by the RD's desire to not be anything more than a cache of
> what can be discovered using .well-known/core discovery.
>
>
> The explanation of being an "alternative Base URI" rather than a generic
> alternative transport could be a middle ground between saying that only
> a single URI is available somewhere else and saying that everything on
> this address is available there: It only makes statements about the
> links in the presented document. This would allow groups of resources to
> state their equivalences.
>
>
> The approach suggested here has some drawbacks: It is a bit more verbose
> in terms of transmitted bytes, and requires constrained nodes to
> synthesize variable data into payload that we usually take pride in
> being able to assemble at build time. If there is interest in the
> approach at all, I think we can overcome those.
>
>
> Best regards
> Christian
>
> --
> To use raw power is to make yourself infinitely vulnerable to greater powers.
>   -- Bene Gesserit axiom
>
> _______________________________________________
> core mailing list
> core@ietf.org
> https://www.ietf.org/mailman/listinfo/core
>