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

Anders Rundgren <anders.rundgren.net@gmail.com> Mon, 25 March 2024 06:09 UTC

Return-Path: <anders.rundgren.net@gmail.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 A407BC151069 for <cbor@ietfa.amsl.com>; Sun, 24 Mar 2024 23:09:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=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 ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Acs3qblqU36y for <cbor@ietfa.amsl.com>; Sun, 24 Mar 2024 23:09:46 -0700 (PDT)
Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 112CCC14F70C for <cbor@ietf.org>; Sun, 24 Mar 2024 23:09:46 -0700 (PDT)
Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-41485fe355bso5719825e9.1 for <cbor@ietf.org>; Sun, 24 Mar 2024 23:09:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711346984; x=1711951784; darn=ietf.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/k0zDBb2Bsxz6MRE5qrFsLLZ0M/ROT5vEC0oLtGXEuc=; b=LuJcKQiVDq1j4h0sfd17bWSVCaBJuUT8CAuC55PW4AJS8/07+OUEEOfGfrDI+CqZkn hNOBt+8Szer5aQjhL2Frgztse6R8sxkid5g5iwdjGwvZmQxrpQAZSH1vSG6nhvoV9frY vCdsRxc1klO91CnN6d75EuUYXNLSW5m8TsTRlc2oZ0llsbXjZt5LidDw8ygsW4cyDdKa DOZiObw4+I4HFLKQAnSZYBmns2h3lRXLHFyPeKl8jNCPtR4Z8eTbgOrqArfqiBsLjup7 QOIQe/jmsjDPGisNDGIBW970MgPt4wTxLMW+aJpMmHZf9YNYd5j24gkuZuU475LNdkf7 I2+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711346984; x=1711951784; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/k0zDBb2Bsxz6MRE5qrFsLLZ0M/ROT5vEC0oLtGXEuc=; b=GeXptLqSOnTnyT7U/OmxHrjmBmGNOPlDo3hV5gikl7oTAuuosar+49gsaJxP3tnkBF /E9hQeNKsahl/WXXxTtLnX7jHn66bCHAKDlXd8U6XvGAiT7TkwPbYft6JuVLrmU7fBsz nafgQgcvM1+9kXA9UlEnxLPRo5VILSkpSnYK3b8Yl3ny7Nauq+y0gGym8ILClUqNq9e7 wBeOvSEclSSKW+5K79U/PatKtUZvE0VUBSuM4fEFeA7IrJIRVKj+nFkuI9N/WyV29VUP 1oVM222VI5P44MYtAlH643i6EMsUxsyyT/kz+HlOv3Cvpoz+Zsi8btT/KoFjydVPuN84 5WJw==
X-Forwarded-Encrypted: i=1; AJvYcCVsB4n/bS8jpNKfCDhk2+sd9mmw0HfoMeviGAXUKdKGJlEpRjqtkvBLA0kOfLm4Ozo7SKP5qqXk+YlOJzqT
X-Gm-Message-State: AOJu0Yy8PBmgLNbxAtXcCtFloob8776oPtKhgWijtOu8oCoaeq2gMjfk NFOv1zNeM/TKOgECAA22uKeLhXpngM+bk22QKGFoknGoTiCyFl7C5UsHJRHV
X-Google-Smtp-Source: AGHT+IGGDl0H/3GsqdDpnOJFzERsj6tMSp6YyvIz4UoEQ4D/TtW+sHpjVu4q/hHYmZ2/eVAEPpQjnw==
X-Received: by 2002:a05:600c:19c8:b0:414:89ba:12ad with SMTP id u8-20020a05600c19c800b0041489ba12admr910659wmq.10.1711346983816; Sun, 24 Mar 2024 23:09:43 -0700 (PDT)
Received: from ?IPV6:2a01:e0a:e1b:64b0:e1ec:b9bc:a0e4:6cca? ([2a01:e0a:e1b:64b0:e1ec:b9bc:a0e4:6cca]) by smtp.googlemail.com with ESMTPSA id bd21-20020a05600c1f1500b00414850d5df7sm5354275wmb.2.2024.03.24.23.09.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Mar 2024 23:09:43 -0700 (PDT)
Message-ID: <437a375c-49e8-4406-a192-acb9a5e7bf31@gmail.com>
Date: Mon, 25 Mar 2024 07:09:42 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Orie Steele <orie@transmute.industries>, "lgl island-resort.com" <lgl@island-resort.com>
Cc: Carsten Bormann <cabo@tzi.org>, cbor@ietf.org
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> <58BA8F8C-0C63-4534-9BF7-255C32D02C16@island-resort.com> <CAN8C-_KCLv_cAt-0-C_=i6DXjZFkgkmgZ8DNq48RcxcvV+jEUQ@mail.gmail.com>
Content-Language: en-US
From: Anders Rundgren <anders.rundgren.net@gmail.com>
In-Reply-To: <CAN8C-_KCLv_cAt-0-C_=i6DXjZFkgkmgZ8DNq48RcxcvV+jEUQ@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/QvzhtHsA3JJ7fcGhtEo2czXbjIw>
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: Mon, 25 Mar 2024 06:09:50 -0000

On 2024-03-24 21:11, Orie Steele wrote:
> Why do we need both CDE and dCBOR?

According to (...) the primary motivations for dCBOR are:
1. There's a data source holding numbers and it is not known if the numbers represent integers or floats.  Therefore numbers must be normalized in order to achieve deterministic encoding.
2. Validating the CDE application profile concept.

Personally, I find #1 to be a pretty unlikely use-case ("marginal design"), which in turn makes #2 rather contrived.

Anders



> 
> OS
> 
> On Sun, Mar 24, 2024, 2:21 PM lgl island-resort.com <http://island-resort.com> <lgl@island-resort.com <mailto:lgl@island-resort.com>> wrote:
> 
> 
>      > On Mar 20, 2024, at 1:34 PM, Carsten Bormann <cabo@tzi.org <mailto: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
> 
> 
> 
> 
>     _______________________________________________
>     CBOR mailing list
>     CBOR@ietf.org <mailto:CBOR@ietf.org>
>     https://www.ietf.org/mailman/listinfo/cbor <https://www.ietf.org/mailman/listinfo/cbor>
> 
> 
> _______________________________________________
> CBOR mailing list
> CBOR@ietf.org
> https://www.ietf.org/mailman/listinfo/cbor