Re: [core] Unnecessary "anchor" attributes in draft-ietf-core-resource-directory-25 ?

Esko Dijk <esko.dijk@iotconsultancy.nl> Wed, 21 October 2020 13:21 UTC

Return-Path: <esko.dijk@iotconsultancy.nl>
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 CC3823A0FDF for <core@ietfa.amsl.com>; Wed, 21 Oct 2020 06:21:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.101
X-Spam-Level:
X-Spam-Status: No, score=-2.101 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=iotconsultancy.nl
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 5NAbjRgNoUQy for <core@ietfa.amsl.com>; Wed, 21 Oct 2020 06:21:47 -0700 (PDT)
Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2139.outbound.protection.outlook.com [40.107.21.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C3AEE3A0FFA for <core@ietf.org>; Wed, 21 Oct 2020 06:21:46 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SrZXwoixxQYCei1lbCttTAjhnjgQLEQ5vxnWy46IlxSPXUHy6HvVVUgovxV1nF6RM+rrwxLlSQpjLeHEbD9OVKyiWoXfrDvT/AISIMDKqmHqZAaAInXYZoRq1gON7v/uQkJrCinvFB7kho0XBncEVnFHb3rwmBvgjf+9RzNxH3oZc13MJ+1Q75nuxG9VIgNjC88TTC816/7neeEE8FPwlbjYwKZ5KUkzU7IrUaxyGFChYhtv7L7ahQExaytPiC1RD4lNhrSWNskcEZMkghejoHKVBA/occF1vBCMIj3q5mgP/OtRml/2gU4RRu2gsChkT1dFHGOzxJLptyISwGWlBw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mMS7+6KeCKvVznRJm72Vzri1PzVcesisXlIfp48gVe8=; b=J239PJLlHQQMGRk4WVmvD0rRiJl+vJeTSmza4IcfwsEbDp/fgXk+OKUTQw40e0QVEJjzFZeC91ZVbxbsKcS7EdBBamV7O1T3PcnZDnPpWPBk9biFWPp5kTRM6+bsytdlcYgDCCHqoTPmFzqiM5HlH30TsHyOcpYG1dpa2m6BO3cUBR/PmpJTZILyb0p71rvZLBX0xz4ZHKYRxYIJklEAwdfMvs7DXXfn1N7jUBNyLb5eed157tkRr+QnVmm7U4OR0VxRRRDqZCQky9xR6dIfNA1Z2qatxLQGV0JGOaZ7puCPz+dlMtFjCHLYf5tF+EKoEDVMUFbbpk6OcF41mq2d0g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=iotconsultancy.nl; dmarc=pass action=none header.from=iotconsultancy.nl; dkim=pass header.d=iotconsultancy.nl; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iotconsultancy.nl; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mMS7+6KeCKvVznRJm72Vzri1PzVcesisXlIfp48gVe8=; b=yq1LHVpLU6FudDomKg8CbwUSLe9Ago9yP7xam53MTJGDGticXnrCjv0oG4mZEYjj5dXYDbHUNPagFyw2qASReRrgZvEpjArHR6KqeiK913di1R/4T0rpFk8zb8Kks3Zjxwk+gTjTwNv8/Cm6suW2gKdlJXUrlATKlD1RGdI+7Mw=
Received: from AM8P190MB0979.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:1d3::8) by AM0P190MB0579.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:19e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Wed, 21 Oct 2020 13:21:42 +0000
Received: from AM8P190MB0979.EURP190.PROD.OUTLOOK.COM ([fe80::b0bf:bd8a:de8f:55fa]) by AM8P190MB0979.EURP190.PROD.OUTLOOK.COM ([fe80::b0bf:bd8a:de8f:55fa%5]) with mapi id 15.20.3499.018; Wed, 21 Oct 2020 13:21:42 +0000
From: Esko Dijk <esko.dijk@iotconsultancy.nl>
To: Christian Amsüss <christian@amsuess.com>
CC: "core@ietf.org" <core@ietf.org>
Thread-Topic: [core] Unnecessary "anchor" attributes in draft-ietf-core-resource-directory-25 ?
Thread-Index: AdagiZ7ddTpjV6VySOOkvoVV5WS9KQGQp6uAAC9rtEAABSmPAAABpo/AAAGlLiA=
Date: Wed, 21 Oct 2020 13:21:42 +0000
Message-ID: <AM8P190MB097924775B30B12A7C4EFD17FD1C0@AM8P190MB0979.EURP190.PROD.OUTLOOK.COM>
References: <AM8P190MB09798CB94C780DBB8DD718CBFD070@AM8P190MB0979.EURP190.PROD.OUTLOOK.COM> <20201020103159.GA311699@hephaistos.amsuess.com> <AM8P190MB0979BE1707EF27FDF6AAD2CFFD1C0@AM8P190MB0979.EURP190.PROD.OUTLOOK.COM> <20201021113736.GC303030@hephaistos.amsuess.com> <AM8P190MB09790D140ABDE73680E652CCFD1C0@AM8P190MB0979.EURP190.PROD.OUTLOOK.COM>
In-Reply-To: <AM8P190MB09790D140ABDE73680E652CCFD1C0@AM8P190MB0979.EURP190.PROD.OUTLOOK.COM>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: amsuess.com; dkim=none (message not signed) header.d=none;amsuess.com; dmarc=none action=none header.from=iotconsultancy.nl;
x-originating-ip: [2001:1c02:3103:f000:d030:cc1b:a030:56f7]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: b9c3a48c-8ab2-485d-e032-08d875c44047
x-ms-traffictypediagnostic: AM0P190MB0579:
x-microsoft-antispam-prvs: <AM0P190MB0579B72C466681EF4BAF2762FD1C0@AM0P190MB0579.EURP190.PROD.OUTLOOK.COM>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: JzphE0dWM122iPiQllow9FRN6viwFx4rEEXqCi2KrQLgXhCEW1PWUH2QBiq+hu/U02fsDzN7s3g3PWB6rylcJKS0AuCv4+AWEpCvH8Pff8tvLyg/5PP11uI4n7sxne914DBRDjIEmDxGskHkQxJdIGO9+/jIYw4ptZu9jBCWZNDSMxfXPKB8znj/dl00ceYxJc8mPXmLduVIyico+kGc3YYIZ9YPPaIz5q+mmhhw4mt5LDdNOcE34F1eGNRve+3WHFKtRVN4OeaHKMMn1viISB2jAnhzFtI+nVw3a/pWtFxeTAQlTlLGkIg8P3pEQeDDY4mq5bfSoAeSsv6Wdxc2kXuT5Bolq9D1raGPqmrFjl9QjeQ3DzmnEqMk0EvyyxitrQKtnsER9gaoNmh+CuB6OA==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8P190MB0979.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(376002)(346002)(39830400003)(136003)(396003)(366004)(7696005)(55016002)(478600001)(66476007)(6506007)(66946007)(66446008)(966005)(44832011)(66574015)(52536014)(76116006)(64756008)(66556008)(71200400001)(53546011)(9686003)(4326008)(6916009)(5660300002)(316002)(2940100002)(8936002)(86362001)(33656002)(8676002)(2906002)(83380400001)(186003); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: 0vQxWQBj0nVkDFbpbxM9PONGcHT4vYtce5jTrJMvPJPKyc/4g9VPyeX6MYrzzSnG2M+cWtYiyXDcjAYqfjcLjRb6clE4LQuKumW0+gAPCKxxwGGHWixYdGmqCcs+r1N/OJn+wh4d1Q+aIVJi+dOLPERHGlRvOHTwZfGYbtaT6n31u1MrcM5yNuCtBd5NcCl+WZZ/E0rgzdUXmtKfuaCK4FpVi/GzQ4spWEueSlWCv4UfF2By+RV20Y9Wybp2aThL9HoHJ8iC1ssHz2CV7wGtVMa1c8mKbUviE8ucnYFvydFG9EP4SR21cWY0gdMf77mBPvfT3EFCn/w2NUmWn73ef3ZU1eLPthSX4BBUHFK6ogrydKKeusk5YrfCypw5tiyQ0qN7LrKmJSQKLR8Ex8qMxp1fQ/CrqcGww7XocDjriYdz10ttFRpRqJ7/VKlEW0cFOrMv5s7NZIUlViIaA61QJsLi5zwNd9ylYAy2PfMIZgtZFgMwjVEczoW7blyQ6hMtuzL4gxnm6D668Lq1crm8GAm4TtRUeZX3a3o+/Jzh+ySQ9++0mlK/llZFScMXlF0h2viZTMS6MhpyW7YkkGL7bkm6bd0/laBIJCvoXuxpZAfROf9bBJ3ajCXJs0m7H66v600rKVf7VYUVHEF8HuUt6v/xKkrl6rUiIx6wSZFNX+k8AnjpbxyTrKAGWz8vcfqFTvBKtbbunj8UiTAv/vH9nA==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: iotconsultancy.nl
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM8P190MB0979.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: b9c3a48c-8ab2-485d-e032-08d875c44047
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2020 13:21:42.4182 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 58bbf628-15d2-46bc-820b-863b6774d44b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 69YE9kunTVT/YjqIin2V0uomEMnTv7LTacebuZpkDwHwX3krh/xKmi/YgaDBfIatMdURY3PpM7hiRzT64q0QTGg0+CuPaRT72uyNWO5URp4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0P190MB0579
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/ONm1GrHOS37_pbCzaLasJiF9lbA>
Subject: Re: [core] Unnecessary "anchor" attributes in draft-ietf-core-resource-directory-25 ?
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, 21 Oct 2020 13:21:50 -0000

PS one additional remark to my previous email.

In the present link examples obtained from RD we may have:

<coap://[2001:db8:3::123]:61616/temp>;rt="tag:example.org,2020:temperature";anchor="coap://[2001:db8:3::123]:61616"

I was wondering what parsing problems would arise in the client if it were returned without the 'anchor':

<coap://[2001:db8:3::123]:61616/temp>;rt="tag:example.org,2020:temperature"

That seems clear; from this answer - how could anyone be mistaken about the anchor i.e. which server is hosting the '/temp' resource ? There's only one server mentioned so that's the one right :)    
And for the rel=hosts relation it would not make much sense to proclaim e.g. "coap://server1  hosts  coap://server2/resource"  ... 

Best regards
Esko

-----Original Message-----
From: core <core-bounces@ietf.org> On Behalf Of Esko Dijk
Sent: Wednesday, October 21, 2020 15:00
To: Christian Amsüss <christian@amsuess.com>
Cc: core@ietf.org
Subject: Re: [core] Unnecessary "anchor" attributes in draft-ietf-core-resource-directory-25 ?

Hello Christian,

Thanks for the helpful response. I've swapped two lines in your item [2] plus added some comments for clarification; below is my understanding:

```
docbase = the RFC3986 base URI (from the encapsulating entity, as link-format has no base embedded in the content)
href = string part between the angular brackets
anchor = string value of the anchor attribute, or null if absent
target = resolve href against docbase
if anchor == null:
        context = origin-of ( target )             # Section 2.1 rule (b) and (c). If href is ABNF 'URI' then this is origin-of(href), if href 'relative-ref' then origin-of(docbase).
else:
    context = resolve anchor against docbase       # Section 2.1 rule (a) - if anchor is ABNF 'URI' then result of resolution is again 'anchor'. If ABNF 'relative-ref' then result is "docbase / relative-ref"
```

Because this may be multi-interpretable, my idea for Limited Link Format was to simplify the parsing by splitting into two possible cases: 1) implicit rel=hosts without 'anchor' ; and 2) any other link with 'anchor'.
Then for parsers that would accept category 2) they can remove the above "anchor==null" case in the parsing, which simplifies it.  And IoT devices could just ignore any such 'complex' links that specify a 'rel' and an 'anchor'. (As is also expected per RFC 6690); and only parse case 1) links.
Case 1) is the simple "list of links" which is easier to interpret than the more general case 2).

Base on your comment [1] I see that my proposed rule needs some update to do this properly:  what about 2 rules:
1* "anchor" attribute MUST NOT be present for any link without the "rel" attribute   (this implies that this link uses the implicit rel=hosts semantics only)
2* "anchor" attribute MUST be present for any link with the "rel" attribute                  (this could be any type of link, possibly using rel="managed-by hosts" or rel="hosts" or rel=hosts )

So then the only case where "anchor" can be elided is the case of using the implicit 'rel=hosts' relation, achieved by leaving out the "rel" attribute.

There is one more consideration for the current RD draft - in case we decide to keep the explicit "anchor" attribute in all the examples. Because RFC 6690 is a normative reference, the assumption of the reader currently should still be that the "anchor" attribute that's added in all the example is just superfluous i.e.
* an RD implementation may elide it , following RFC 6690 rules  (in the interpretation as coded at the top of this email.) and Section 2.3 of 6690
* an RD client doing lookups may ignore it, following RFC 6690 rules in Section 2.3

So we still will be faced with interoperability issues if RD implementers interpret RFC 6690 differently.   What is needed in this case is that we *update* RFC 6690 rules explicitly e.g. by making "anchor" mandatory in all cases.  (Whether we formally update RFC 6690 or just define it as part of Limited Link Format doesn't matter that much I think.)

Best regards
Esko


-----Original Message-----
From: Christian Amsüss <christian@amsuess.com> 
Sent: Wednesday, October 21, 2020 13:38
To: Esko Dijk <esko.dijk@iotconsultancy.nl>
Cc: core@ietf.org
Subject: Re: [core] Unnecessary "anchor" attributes in draft-ietf-core-resource-directory-25 ?

Hello Esko, hello CoRE,

You're right, this does not only come from Limited Link Format, but is
an explicit additional requirement on the lookup side. As I remember,
this was intruduced for two reasons:

* There was little trust in implementations following the RFC6690 rules
  -- they might just as well work under Link Header rules.

* The 6690 rules would require that any present relative anchor would
  need resolution, and in some absent cases, an absent anchor would need
  to be set to a (full) URI.

  Given the varying interpretations of 6690, it would be difficult to
  come up with sharp rules when the anchor could be elided.

Re-reading the 6690 rules, I see that some of my own interpretations of
the resolution process (that, apart from discussions on whether or not
the relation type can have a bearing on the resolution process[1],
seemed to be largely agreed on) can easily have been wrong -- and that
reading played into the "always absolute in lookup" rules.

If what how I think you interpret 6690[2] is the accepted reading of
6690, the explicit anchor can indeed be elided for many cases.

The changes would be manageable on a prescriptive level (but affect a
lot of lookup examples -- removing text from the wire so that's a very
good thing, but still a large change). The three reasons I'm not jumping
to just doing it but ask the WG to chime in are:

* We're quite late in the process.
* If we pick [2] as The Reading of 6690, we should be sure about it, and
  I've been wrong about details of the 6690 process too often to jump to
  conclusions here.
* Very few people using link-format seem to care about the semantics of
  the links in link-format, using it more for the list of resources
  (like, we could have used some resource description format in the
  first place). This makes reviews on preserving the actual link
  semantics -- which we have to to not break the few cases where it does
  matter -- hard to come by.


Chairs, can we even still make such a change?

Esko, does [2] capture how you read the resolution process?

Group, can we find agreement on that being the right interpretation?

KR
Christian

[1]:
> * "anchor" attribute MUST NOT be present for a link with the "hosts"
> relation   (i.e. the default relation if none specified)

This is relatively hard to check -- sure you can test for the presence,
but how about if someone made it explicit as rel=hosts? What about
rel="managed-by hosts"?

[2]: I've read and written too many phrasings of that, maybe this is
less ambiguous -- the RFC6690 algorithm as I think you understand it:

```
docbase = the RFC3986 base URI (from the encapsulating entity, as
  link-format has no base embedded in the content)
href = string part between the angular brackets
anchor = string value of the anchor attribute, or null if absent
target = resolve href against docbase
if anchor == null:
    context = resolve anchor against docbase
else:
    context = origin of target
```

-- 
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