Re: [Cbor] Unusual map labels, dCBOR and interop

"lgl island-resort.com" <lgl@island-resort.com> Sun, 24 March 2024 19:21 UTC

Return-Path: <lgl@island-resort.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6D582C14F5EF for <cbor@ietfa.amsl.com>; Sun, 24 Mar 2024 12:21:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.911
X-Spam-Level:
X-Spam-Status: No, score=-6.911 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dzybaEa3GyCc for <cbor@ietfa.amsl.com>; Sun, 24 Mar 2024 12:21:52 -0700 (PDT)
Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2098.outbound.protection.outlook.com [40.107.223.98]) (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 B0508C14F5E6 for <cbor@ietf.org>; Sun, 24 Mar 2024 12:21:52 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q2RjqojKroSIzjfK6UbCE6whzKpkhd14pDDExAhMYK6Xvc0unAfOE2TlOMR0kw1StJ/02rsuYRlTP4s06UrXf+u8VqEilCh0fh+xEiWhlM0crFpaMlbRiH/rwR26aS2WOL30D38rAcS+M0xVpepu+anhPdkqLx0hLA3q7nEKd25wrFA5oe3r1xP7xBwpcSOT2A6r2asDZWOmHzZVRKdQZAbZ9wy/C7/yWu9Y3bSHqlTE57k/oRe686AxCstu9OHDZs4Uhm7FGlEIPcMtuLeL45MULL3qsPy3rDfWu4eg1gO3dbT+M13wElM9g5985dgYgymCdfascpJuPeXKQ+2U9Q==
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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WesLy3mDWhtuCOaGLnMaHe85reK5XcZ5c7sh7gvAd0Q=; b=oPx6muBpj7mmrMWZtf2e7JiGN/vKVIxOc10VWlbvRvtG//6qGoMk5FNLC9M3zviLLCdIrY/yxvEPdTWlnzhxawHASErNcTLKBMOATfXZuf+vq0QbJtEB9UbTBnCax1wpShkxDwPLpyRW7KfDDVHsy3rHz5ZJZP0dEynaLQ2jfwfs6IfzZKpxhlVYHj3aaRtRMdMZ7pMQ2pKCIqotKrgKXQ+KunH6IUt3g4UuBuWeSaLkBzFm6p4iGsNlbyy1kt7Y7eQ+vfAEDiubR22Zkdj97qAmJTE9G0jOY0va+76IyRJW0UI/kXNoFLdP6StNEc0Ag4WPjGANZIdIdFae9GxGPw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=island-resort.com; dmarc=pass action=none header.from=island-resort.com; dkim=pass header.d=island-resort.com; arc=none
Received: from PH7PR22MB3092.namprd22.prod.outlook.com (2603:10b6:510:13b::8) by PH7PR22MB5399.namprd22.prod.outlook.com (2603:10b6:510:31c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.30; Sun, 24 Mar 2024 19:21:48 +0000
Received: from PH7PR22MB3092.namprd22.prod.outlook.com ([fe80::1cab:7344:221c:bb8e]) by PH7PR22MB3092.namprd22.prod.outlook.com ([fe80::1cab:7344:221c:bb8e%5]) with mapi id 15.20.7409.028; Sun, 24 Mar 2024 19:21:48 +0000
From: "lgl island-resort.com" <lgl@island-resort.com>
To: Carsten Bormann <cabo@tzi.org>
CC: "cbor@ietf.org" <cbor@ietf.org>
Thread-Topic: [Cbor] Unusual map labels, dCBOR and interop
Thread-Index: AQHaeJqz5sU3csZdl0K76nI1ITZeVrE8YKeAgASbiQCAAB6MAIAGNQgA
Date: Sun, 24 Mar 2024 19:21:47 +0000
Message-ID: <58BA8F8C-0C63-4534-9BF7-255C32D02C16@island-resort.com>
References: <8C245824-1990-4616-AB70-FFD4FACB1AE9@island-resort.com> <11E8A8A5-D891-49FF-AF16-697C06F463B3@tzi.org> <9A0CE364-C141-4EBE-9703-292C416D12F5@island-resort.com> <3D62C4F0-D570-4EE4-AF6A-163C708AA6BE@tzi.org>
In-Reply-To: <3D62C4F0-D570-4EE4-AF6A-163C708AA6BE@tzi.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=island-resort.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PH7PR22MB3092:EE_|PH7PR22MB5399:EE_
x-ms-office365-filtering-correlation-id: 16322866-19aa-4e88-6437-08dc4c37a66c
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: YcHySJkmH/VDsc8UNDwskHmTubtEpvTRbKjyS6OU33/bGeJ5zdVTeAj5QZYvYAwYiT387Tm2IrTnPd/Kq14yQOcpfT8sbPwvhuAPItNZafu7YUWI2ULHV49a4zmnB1Mi94UtU7t3J6KTG03qF+sa3kQlSrnsBFxqkBuBypmbP+7fq2xvrVlujCB3wWxuAsKf0xKFhekTkJZtTzWiCoP/X39ujf9ZWQJveIFXGRcxLe+gpD9NGPj+Qyp7cL7Ev1u2WYyHk/c3OAlfzSbQAKxC3LSzDIrfnr8el+4LDU0FuyJhOABFWWnpwyDyiYhCV35pHQYpyaLQU+9kNGbNe9N8NmzyYv83/5fme/WZWbNDFw2RFV1cOFlrz7GKCnESPO70/0SEZrGJUuj67UImFz6YA3Fw9MUibfJkYmjv4Qu/MtQE1HlMeoNqiQr4p3iidvzYppxH2rNry7p/kcN87230KIvd+6eZVSLXUBEG2zrTKHxLMTcXWdL61HHiPgu4/b2rIu4uC7OTzH63dycQe1KQaney9rHPNN80kaciLK1zacAjry6PrxjRNkUxVPPMG1HobO+W3wSMbUcFMcL1sIytC/XbEBLbh9vLDOL/+pkp5LSnAGGUiZKGWzm+rytPDWCJnZYaXHnTw1PNcxgZfamdPRs/KosoQRp88E5H1i60It4xnghdJ6zzEgKogPO3mp1HXlPvb3VoUG8JaVgwCVcyCg==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR22MB3092.namprd22.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(366007)(376005)(38070700009); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 1iEu8XhZPixn7/h03O3v9udjiN0Ew4pAJ1N97xJYwodGMVUHql5NJ1B9CcKwoFL+pw6o8O7mGo5s8qmWYigQUUurQ9KXWEn0MapxLzXgv6mef8suVJvAzMVTNWJAWHrz9rcR8ZCJdk809w7MvJ09akQm8cElh1wUWOKiP1H0AlWha+1HW6XNBCSE9YaNTGqkeI4roYpjrRNRARR21B2QcKx7p61qhM3XcULDM36tfsIhmeP//BJDE7/tnE1oGRbFvvHXmbPlw1nKfW42cwHQDWrcP9UNpeOaoRF3sXDW2H7QBCKoD+DDO75ziN4OJ9Ii+MT8VbhtvHGpR06uEkGkfhqZFgl/U1ZVa3NXdJ4g6ruQ/dZ54+CD66DZJkWbSba6A1hhH7Yvr3kiq5P4avnA5XU8/3ultYCOCESH503eFuYxl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RByTCpCW1JTPWisZAkPa1HxJIAfdw9Yj1iAD1KxEKPysRLup5YYxv3OLZCQMESEE91iOGyHiAPR7spQfPEokDeUrHKopxNCYrOT+rTq/g==
Content-Type: text/plain; charset="utf-8"
Content-ID: <6E2D668428503844BDEEE2C72A790717@namprd22.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: island-resort.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PH7PR22MB3092.namprd22.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 16322866-19aa-4e88-6437-08dc4c37a66c
X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Mar 2024 19:21:47.8690 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: ad4b5b91-a549-4435-8c42-a30bf94d14a8
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: TtEqqkO49HKj+Bc6uCHzZJ6pj0vpwh+WrdHFAAGiVau60MZUYbDheDmDNwq09ycpntWXZdV0G1IzpkapWizbFA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR22MB5399
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/rvbIstFhqxdicXHu42ruA0toscg>
Subject: Re: [Cbor] Unusual map labels, dCBOR and interop
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Mar 2024 19:21:53 -0000

> On Mar 20, 2024, at 1:34 PM, Carsten Bormann <cabo@tzi.org> wrote:
> 
>> dCBOR disallows the simple value “undefined” and NaN payloads (both are restrictions on the CBOR data model).
> 
> Right.
> These are restrictions motivated by the application processing envisioned.
> 
>> I believe this is because JSON doesn’t support them.
> 
> I don’t think so.   I think JSON doesn’t support them because they didn’t want these data items at the application level.   I can’t speak for the dCBOR restrictions, but I can imagine similar considerations apply, but I don’t think dCBOR does this “because” JSON did this.
> 
>> Seems logical that dCBOR might want to disallow maps and arrays as map keys since they are not supported in JSON.
> 
> Non sequitur.

It is sequitur. If my first statement is true, then my second statement reasonably follows. 


>> CBOR has serialization variability that we must manage.
> 
> (For certain applications — most CBOR applications don’t need deterministic serialization.)
> 
>> The general acceptance of dCBOR here in the WG shows that sometimes we also manage the CBOR data model.
> 
> I’m not sure what that “general acceptance” is — I think there is a common perception that dCBOR is a valid example for an application profile, and that we should support the concept of application profiles, so having one instance under consideration is helpful.
> If the dCBOR people want to limit the map keys in some way, I’m fine with that; if they don’t, I’m fine with that, too.

Discussions here have been ended at times by asserting that the CBOR data model can’t be restricted. While dCBOR is not adopted yet, it seems that it will be. That shows me that the WG is willing to restrict the data model in some cases.

I fully agree with no restriction on the data model for CDE. We must have a deterministic encoding that covers the entire data model. 

(There’s no good description of serialization variation vs data model variation. It took me a while to fully understand these two (I’m roughly only average smart), but now I am a solid CDE implementor.)

For dCBOR, I’d like to see map labels very restricted. I’m not a JSON user/expert, but it is a Jupiter-sized data point for me. It has massive use with only string labels. 

I’ll propose integers and strings (major types 0-3) to start discussion. Maps and arrays seem too much. Only strings might be OK.

We’ll need Wolf and Christopher to weigh in. I haven’t heard from them lately.

I can imagine many use cases other than the Gordian Envelope finding dCBOR highly desirable because it eliminates all the CBOR stuff that is variable and a lot of stuff that is hard to understand. Most people aren’t as smart or as into this stuff as we are. Simple map labels line up with this.


> (One of the things I wrote cn-cbor for in 2013 was to make sure one could do CBOR in a limited amount of code, as in some 768 bytes (not megabytes, not kilobytes); it did not need a restriction on map keys for that.  But of course the application code that is dealing with the data items once decoded is more complex when the data items are more complex, and that is not included in those 3/4 KiB.)

(It’s cool that you can build a tiny CBOR decoder and make object code size claims, but such may not be as easy to use or code-size efficient for larger stacks like SUIT and EAT. If a CBOR library does more of the work for you, then you have to write less code, not think as hard and test less. The code-size efficiency comes because there’s only one chunk of object code for common functions like map lookup by label and bstr wrapping/unwrapping. If the CBOR library is shared, then sharing is across all CBOR apps on the device.

As I’ve built out a stack for COSE and EAT, I’ve moved common functions into QCBOR. It makes QCBOR bigger, but the overall stack smaller.)

LL