Re: [core] /.well-known/core and multicast addresses

Jim Schaad <ietf@augustcellars.com> Wed, 12 December 2018 22:54 UTC

Return-Path: <ietf@augustcellars.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 BFAE4130F24 for <core@ietfa.amsl.com>; Wed, 12 Dec 2018 14:54:55 -0800 (PST)
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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] 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 msHG0IYPNfIi for <core@ietfa.amsl.com>; Wed, 12 Dec 2018 14:54:53 -0800 (PST)
Received: from mail2.augustcellars.com (augustcellars.com [50.45.239.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C42781312B9 for <core@ietf.org>; Wed, 12 Dec 2018 14:54:52 -0800 (PST)
Received: from Jude (50.252.25.182) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 12 Dec 2018 14:49:21 -0800
From: Jim Schaad <ietf@augustcellars.com>
To: 'Christian Amsüss' <christian@amsuess.com>
CC: core@ietf.org
References: <004301d48ded$8487b9c0$8d972d40$@augustcellars.com> <20181212204344.GA665@hephaistos.amsuess.com>
In-Reply-To: <20181212204344.GA665@hephaistos.amsuess.com>
Date: Wed, 12 Dec 2018 14:54:18 -0800
Message-ID: <04f001d4926d$9eac0070$dc040150$@augustcellars.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQKvYJd64JVfgBoXic1Peu5LlKMP+QGj0uT4o7j0zLA=
Content-Language: en-us
X-Originating-IP: [50.252.25.182]
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/M4n6oKEZMmOC-QAeG4aJISdvfjY>
Subject: Re: [core] /.well-known/core and multicast addresses
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: Wed, 12 Dec 2018 22:54:56 -0000


> -----Original Message-----
> From: Christian Amsüss <christian@amsuess.com>
> Sent: Wednesday, December 12, 2018 12:44 PM
> To: Jim Schaad <ietf@augustcellars.com>
> Cc: core@ietf.org
> Subject: Re: [core] /.well-known/core and multicast addresses
> 
> On Thu, Dec 06, 2018 at 09:27:14PM -0800, Jim Schaad wrote:
> > I am unsure how to get to the correct answer in this case.
> >
> > I do a multicast get to /.well-known/core The response comes back on a
> > unicast address with relative URIs and without an anchor.
> > I resolve the relative URI against ???
> 
> You resolve against (in RFC6690 link format: the origin of) the URI of the
> requested resource, which in the CoAP case is constructed from the request
> Uri-* options (RFC7252 section 6.5), but with the IP literal of the
multicast
> request as per section 8.2 (last paragraph before 8.2.1; "and any links
> embedded in the representation").
> 
> (I wouldn't have known the exact reference either, had I not outlined it
at [1]).

I was rather afraid that this was the case.  So just to be specific because
this is the context that I ran across the issue.

As a client I am looking for an RD to register with.  So I send the request:

Req: GET coap://[MCD1]/.well-known/core?rt=core.rd*

I get back one or more responses with the following links:

Res: 2.05 Content
</rd>;rt="core.rd";ct=40,
</rd-lookup/ep>;rt="core.rd-lookup-ep";ct=40,
</rd-lookup/res>;rt="core.rd-lookup-res";ct=40,

(Note this is an example that is copied straight out of the RD draft.)

I am now going to register myself by sending a registration request:

  Req: POST coap://[MCD1] /rd?ep=node1
   Content-Format: 40
   Payload:
   </sensors/temp>;ct=41;rt="temperature-c";if="sensor";
         anchor="coap://spurious.example.com:5683",
   </sensors/light>;ct=41;rt="light-lux";if="sensor"


As a response I could get:

1.  Zero or more success responses, and 
2.  Zero or more failure responses

Since multicast is defined as not needing to return any error messages (such
as a 4.01 Unauthorized).  I am going to assume that nobody would say that
the server has nothing "useful to respond (e.g., if it only has an empty
payload or an error response)" given that while there is no payload there is
a returned location path.

Life could be really interesting if, for example, the get on
/.well-known/core is supported as a multicast request but none of the RD
functionality is.  I would kind of expect that this would generally be the
case, but can see cases where the this would not be the case.  It is the way
that I had planned to implement.

If there was a rule that only resources available on the query address were
returned then that would defeat the purpose of doing the query to find a RD
service.  On the other hand if the RD does not recognize that it needs to do
return fully resolved href fields in this case there would also seem to be a
problem.  I am unaware of any such text for /.well-known/core but that does
not mean that it does not exist.

Jim

> 
> Best regards
> Christian
> 
> [1]:
https://tools.ietf.org/html/draft-ietf-core-resource-directory-17#appendix-
> B.1.1
> 
> --
> To use raw power is to make yourself infinitely vulnerable to greater
powers.
>   -- Bene Gesserit axiom