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

Esko Dijk <esko.dijk@iotconsultancy.nl> Wed, 21 October 2020 09:46 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 1FAED3A1579 for <core@ietfa.amsl.com>; Wed, 21 Oct 2020 02:46:55 -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 HjpdMWudlZUH for <core@ietfa.amsl.com>; Wed, 21 Oct 2020 02:46:52 -0700 (PDT)
Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70122.outbound.protection.outlook.com [40.107.7.122]) (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 24AD23A1562 for <core@ietf.org>; Wed, 21 Oct 2020 02:46:51 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=avLAGNxPo8DQbPju786FsAioCykcFJ3Iw3LlUIWR5ZCb1tyEVHayulcmdqrZeY8e/69PurpSA1yFLBegavQT5YSGNr+Knk54g3JUOD68odUZDd+gevoK42PatHwq2YxipjeAibDYc9s9pjmRFZx5S+eEp8phF5vJ36geHf+ezUU9fkeNL6eJ7cwdzOCCLsmmo8KkW3vUCIV/KeKU5JEdyjgZOx6L3CDRSUT3tjmouTumIa2LUckabylU0SgB7quQqN2FzGv4J4qVK/U7HMq4lW7V6LDfv2P5Qbh6ckRHjxWbAbTds9xZ2JpHafWp+aTROqt4e4Ay2aGA1H6laVPwEQ==
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=eP4/mEOsufv2SvdezhSHnKl8U6Oq/PuUsKeq/52O704=; b=Hbd8sVsvioXdvvsfMPygfUCgHPh0NrV3SMLXpwMKx7skTR9nivKAUfpoJJKNNYvyXRIOYhn5uVczwWFfZYOFAJ3SEk8sP2jIML7nW4GguY3DUi9lE/jp0G3UUNzMgvLQQDX+zReDgO2phJvsPx7k/JdWYjEtqyaVz9Conor8bKQ3ADOqWiwFccv+/9/0EtA2u8yD3C1rWaiJQaFlws5xcUczjRthLZ7S6VWTIkYEwVGeNWqO7KgNLntntTvn03+YbKKO8sd/r9M9VtB2m9Kn33ssicm18dCwlGJYeEgvRBlXkXQVZMZeKUuPlnduE/LGGyLuQTSJUzkroyCsm9dVVg==
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=eP4/mEOsufv2SvdezhSHnKl8U6Oq/PuUsKeq/52O704=; b=rX5sKAXMUsO+BeQ1M2XQw5RS0AWj3BYCzU3hKfPRFuwmwzfHeBdaAnwfXE/KlGckWTFJhvmUpRv+jRE/RQqcZlzZkpeIPV7N8hJBTxO+8GsmF/EPosRCACZU1z0LBbc8B3fk4eINOH7yc/HdwuoMPox1OcsqOz1AzYkknfjWsiM=
Received: from AM8P190MB0979.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:1d3::8) by AM4P190MB0036.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:5e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.26; Wed, 21 Oct 2020 09:46:46 +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 09:46:46 +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: AdagiZ7ddTpjV6VySOOkvoVV5WS9KQGQp6uAAC9rtEA=
Date: Wed, 21 Oct 2020 09:46:46 +0000
Message-ID: <AM8P190MB0979BE1707EF27FDF6AAD2CFFD1C0@AM8P190MB0979.EURP190.PROD.OUTLOOK.COM>
References: <AM8P190MB09798CB94C780DBB8DD718CBFD070@AM8P190MB0979.EURP190.PROD.OUTLOOK.COM> <20201020103159.GA311699@hephaistos.amsuess.com>
In-Reply-To: <20201020103159.GA311699@hephaistos.amsuess.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: 58e76211-a35a-46cc-88cb-08d875a639d5
x-ms-traffictypediagnostic: AM4P190MB0036:
x-microsoft-antispam-prvs: <AM4P190MB0036EB18FA5E86CAA8E008CFFD1C0@AM4P190MB0036.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: lIzdpZK6V6Cu5OkpQoqSmLACil/RvfqJHAK9hqSiBxJ51O5gQHGuyeiqCAQDcYRgT5VHJk328hooZJtP+vnssae7dt4SmU9pJBVv5REUCpngmMUbqmlQZ+p2MpZy7TboGp2FaqFAtd7/bStBN87oaA7c9/cSaU4Z+57SvGez/j2SdcLuSNcncgZvpeVvWOkE2bex0zIAm6erHbb0w1gw0c90L1/gbjkvacvwwQBzgxkmAP2DPaCoqupPo8z7Np2TdN9EcLTbyVb1iKdkaLFl0FFWFxsUZmT/jWmPgBdED/dy4lvBQB91JrSoDIB+QNNSy7vN7qH3U4JvPriWoYaupktrvjdm/XC2jmRgTQDZqMlT9zGkeJX3D7rpJ1xkmhsgEXZyBByRFFRxNJWFhdT0KA==
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:(39830400003)(136003)(376002)(346002)(366004)(396003)(86362001)(2906002)(9686003)(8936002)(478600001)(186003)(53546011)(6506007)(4326008)(44832011)(71200400001)(7696005)(52536014)(66446008)(5660300002)(76116006)(6916009)(966005)(66574015)(55016002)(8676002)(316002)(66556008)(64756008)(66476007)(33656002)(66946007)(83380400001); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: rTbZNqM70WB/sbXUeOBqiEl40a09HdvuMFLl9Q3HGwicHQaOffrzShaVwsn4oce33rOiEZAC4rNm93uI9NnGmoC6wccZk1Q/ZpxzUQQkF8WewOJNcSYeTuMPCLFGRb+nwLaifDe/xVTGcynkUg2LbnbnihqY33iJOozZvluX90uu3Th6WWFsNjZ910lA5sCJP2InbUC2zflf7Qh2BNQ0RPdu6B+UwIoSqlWT5gAH3fG3jUlUDR/Tg80FLlQ+KqbDaPz6Er9ojHfbNISCvHwcR0PXwnZXYt6RtbzhhFXXcc8bPyI3HqfsG34iLiB9Xet24+/pI5q+wIY3amfHsP5LKabDSBStQZDMCZMMm6Wj/3ZiYDmKPakn/iM+mJFQooxTxSAwok2NI4/0jCzaca+tiBOXJhaWZHnl7HikRJv4hbfWU2dQmqhSn63ES7SVnw3KmH1pYi5vIpkuJfa61wt/wt9oLq6zNhfEYqI1ff+6lUefcY7K8XkmhtW/2vtPwuQvsPjJN+JFdnCuLQoTdeR5aPrWpT4KezDys85AmUEczXqUImjsklg/L2abcOVALG/TMVedlqjK0fXLNX6kdwjmJkOKxTDla2VYe6DSGXIyKRmxe0zi4WeTo6XW1FY1ZzKBQUFXon06A6bewfHiKZZdSXAhm9WJLnOl1Hb/TiSttDkpguCub6ASG/WRnAYz0Oz27QNjKuZEEry9yLnSk6ulbw==
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: 58e76211-a35a-46cc-88cb-08d875a639d5
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2020 09:46:46.7196 (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: 7e14Vlk9oVsUmp7/etqaSub7XT0TEZz6ZuALlXeNEHzV339GCRu3Ylp/CEykkLt6154crVCqMcgYGzd9lai6qqsSRGKdnq0SD04FxWzL7L4=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4P190MB0036
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/n5SS9kGkpnb47mxrxtqI6nMBVss>
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 09:46:55 -0000

Hello Christian,

Thanks for the background information. What I don't understand is that you seem to say that Limited Link Format is the cause of a less efficient encoding of link format payloads.
When I look into Appendix C (Github master branch .md) I don't see any rules that there must be an anchor present in particular cases. And I don't see rules that change or simplify Section 2.1 of RFC 6690.

I agree that Link Format can be tremendously complex when all its features are being used, and it is hard to get it right in this case. And yes it has particular flaws (e.g. tremendously inefficient when indicating over coap:// resources hosted on the same host under coaps:// ) 
But I also see that the basic idea of link format for constrained devices is just to use mostly, or exclusively, the "hosts" relation which is the default.
In this case you get nothing more or less than a list of resources, with some optional attributes with it that describe e.g. content format and resource type semantics.

Such a list of resources is quite straightforward to generate, to parse, and to get right I believe.

So what the Limited Link Format Appendix could define in addition is the following rule:
* "anchor" attribute MUST NOT be present for a link with the "hosts" relation   (i.e. the default relation if none specified)

This will lead to the desired, and originally intended, solution for IoT devices that nothing more than a list of URIs is communicated with optional semantic attributes.

So a device serving its own links would respond relative links e.g.
</sensors/temp>;rt=temperature-c;if="sensor",
</sensors/light>;rt=light-lux;if="sensor"

This is simple to interpret as "resources are hosted on the same CoAP endpoint".

A device like an RD serving other's links would respond with absolute links e.g.
<coap://new.example.com/sensors/temp>;rt=temperature-c;if="sensor",
<coap://new.example.com/sensors/light>;rt=light-lux;if="sensor"

This is also simple to interpret as "resources are hosted at the specified CoAP endpoint".
Adding an "anchor" attribute to the above list would only confuse things and the requesting client -- if an IoT device -- wouldn't anyhow use this information! See Section 2.3 of RFC 6690.

To me, it seems we can make Link Format more limited, and simpler, and more efficient at the same time, by the above. And it would also be a true subset of RFC 6690 Link Format.

To make things more clear , and more subset, one can also consider to add the below rule:
* "anchor" attribute MUST be present for a link that specifies a relation ("rel") attribute.   (I.e., that includes a "rel" attribute - and does not use the implicit "hosts" relation.)

So this makes it clear there are 2 types of links possible:
1) Simple "hosts" links that just specify the resource (relative or absolute) - also IoT devices can parse these as a list of links/resources without forming semantic RDF triples internally :)
2) More complex links ( 'subject' <relation> 'object' - semantic statements) that IoT devices are not expected to parse, but more powerful devices could. E.g. a Commissioning Tool.  And there would not be confusion as to what the 'subject' is because that's always specified in the link.


Overall I do not see yet a good reason why the "anchor" attribute is there in the RD draft - given that the simple IoT client may just ignore it (Section 2.3 of RFC 6690) and given that the Appendix C doesn't change the interpretation rules (e.g. Section 2.1 of RFC 6690).
Could you please clarify why it would be useful or good to have the "anchor" attribute there for the "hosts" relation?   Including this seems to make it more rather than less complex I fear.

Of course if we expect this Limited Link Format isn't going to be used much because Coral will eventually replace it, our discussion may be less useful. 

Best regards
Esko

-----Original Message-----
From: Christian Amsüss <christian@amsuess.com> 
Sent: Tuesday, October 20, 2020 12:32
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,

(picking this to go first as it's the most visible of your comments, and
thanks for all of them),

On Mon, Oct 12, 2020 at 11:25:10AM +0000, Esko Dijk wrote:
> [...] about “anchor” attributes in Link Format that seem unnecessary.
> Hoping this helps to make Link Format documents smaller in size.
>
> This is something I found after reviewing RD again after some years I
> last looked at it.

The issue with the redundancy between anchor and target is that the
RFC6690 link format details about target and anchor are ... well we can
argue about whether they are ambiguous, but they do conflate concepts
(context and base), are hard to read, subtly different from the Link
header and, most importantly, nobody ever implemented them right[1].

Consequently, a compatible subset of link-format and Link headers, that
would be consumable by a wider range of devices, was added as Limited
Link Format (in the RD appendix B). It's admittedly not great at
compression, but at least it works with how people use link-format.

Back when this was added, the hope was that nobody would practically use
text-based link format anyway because links-json[2] (actually, -cbor)
was on the brink of being published. It wouldn't have removed all the
warts, but at least the most pressing ones about resolution. (It would
still have kept the ASCII-delimited arrays for rt and if, and would not
have had a way to set an inline base address, as you'd probably want to
do when returning more than two links from a single endpoint). The
document was withdrawn to avoid churn anticipating a more powerful
solution to the problem (CoRAL), which hasn't landed yet.

(Avoiding too many formats war also why Limited Link Format was born: We
could have done a 6690bis, but feared it'd delay RD too much (hah,
anticipating a publication in 2019), and it would only delay a proper
solution that doesn't need to be held back by the link-format
decisions.)

Does this, to you, explain and justify the choices made about the
link-format representations?

KR
Christian

[1]: https://mailarchive.ietf.org/arch/msg/core/D_kuIq6QoBZ86FNniN7G_6d1Rtg/
[2]: https://datatracker.ietf.org/doc/draft-ietf-core-links-json/

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