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

Orie Steele <orie@transmute.industries> Sun, 24 March 2024 20:11 UTC

Return-Path: <orie@transmute.industries>
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 9A2D5C14F714 for <cbor@ietfa.amsl.com>; Sun, 24 Mar 2024 13:11:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.106
X-Spam-Level:
X-Spam-Status: No, score=-7.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, 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=transmute.industries
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 A6o0kNvY6yXi for <cbor@ietfa.amsl.com>; Sun, 24 Mar 2024 13:11:26 -0700 (PDT)
Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) (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 472D1C14F609 for <cbor@ietf.org>; Sun, 24 Mar 2024 13:11:26 -0700 (PDT)
Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5a4f9f94e77so2169152eaf.3 for <cbor@ietf.org>; Sun, 24 Mar 2024 13:11:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=transmute.industries; s=google; t=1711311085; x=1711915885; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=m+tjiVn4Rr76XvpDgYJJnKb6NYs2/jTrPQEgO5TEiDo=; b=bwd+CulEJu7qnPayhrsQRei4+gYWukgiPWJSJ8p5RkoUepoZTvAsuLTvvikeLZvNy5 hJWrxjlvfe+NuTkkkKDYzcXUhIlGjnEnJpdmvbZ4cLk39odVbHmbIb/7SCNlnO71VT+G D8nAUYchURf26DcrUUMdH17wxGkk4kzrTkpHMkFikjMr7NQ1jmsnWCfsDx0PVsLvkmlF tBFxSQ/U13Xo/rWdUX4fqleuyzr42wfZL8vyP2T8jqKjBoNBS76TPayznEJdUnw7eyzt 8fQptJTUDIPFsGkWoUJXG/WVWtSl12v9Nbfd1qzgU7vwURj8jj2skBmJehiyWfSvFHt4 +Tpg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711311085; x=1711915885; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m+tjiVn4Rr76XvpDgYJJnKb6NYs2/jTrPQEgO5TEiDo=; b=eRfS8SB9XyaJRxljIy+3x/uMqWxtQKmLApPvVFc9DYb0f9NeQmQZYPkbGVPEVE2oSF kQIbaFsTHWmG9h1PVsBvk7Ss8P52Swv2vocWMAWND8HjYFE45LKZsGLhBj+jUXguH7+S guwQXO1dih2KWRdTCTWp7p39bGOfM1c3WxRXWfjWCrSb6aP0w6Ow6Xbl+2TBITYVACQs G4RUtFkG1F43O72z65ROUM7nob7EzXC6GpS+HIeCp/Er4nRjuFPz/66HgekkUTQc021X Rkq/cwsp5mBpVr0gux3v5EQknLDb3yz09jRty7xaMCcnSjgVsXd86X4vQGPDe81beEfb EL3w==
X-Forwarded-Encrypted: i=1; AJvYcCU4FGa7WY5FbyCm79gdhBmGyfkrassY7nFqWd15uTR0QB+aMcTK4raUVk6K584ohBF4pMDgYc38ZKh2crVv
X-Gm-Message-State: AOJu0YyI9SF+bdMDyNfQHwNXr7rBDQClBwh/EhtcUoq6qjxdbTko4AaR Pxz5RZa5GQA2kmaTpxBvphV42+zd2PJbSafG8c/kHVGtYDlhsXj0ncRzig8NtgQzTCjYasdQBOL wro8Wb2WTVgCeTbnxJuFFgfbvJeVSWo6RsXrOU7K38VwnB5iR
X-Google-Smtp-Source: AGHT+IFA7/pUVYwdUDxsplbhZwKS/0jU6/jD6Td3CS6s22FqeQvTwqM7kg9wAVSeEcXf+8RH5Qp/vuwcVCO1tFn7Qj0=
X-Received: by 2002:a05:6358:784:b0:179:c8c:98db with SMTP id n4-20020a056358078400b001790c8c98dbmr6927561rwj.18.1711311084739; Sun, 24 Mar 2024 13:11:24 -0700 (PDT)
MIME-Version: 1.0
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>
In-Reply-To: <58BA8F8C-0C63-4534-9BF7-255C32D02C16@island-resort.com>
From: Orie Steele <orie@transmute.industries>
Date: Sun, 24 Mar 2024 15:11:12 -0500
Message-ID: <CAN8C-_KCLv_cAt-0-C_=i6DXjZFkgkmgZ8DNq48RcxcvV+jEUQ@mail.gmail.com>
To: "lgl island-resort.com" <lgl@island-resort.com>
Cc: Carsten Bormann <cabo@tzi.org>, cbor@ietf.org
Content-Type: multipart/alternative; boundary="0000000000004e787506146da96e"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/dAkiX_6KRlLD3COja3zJ00hABxY>
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 20:11:30 -0000

Why do we need both CDE and dCBOR?

OS

On Sun, Mar 24, 2024, 2:21 PM lgl island-resort.com <lgl@island-resort.com>
wrote:

>
> > 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
>
>
>
>
> _______________________________________________
> CBOR mailing list
> CBOR@ietf.org
> https://www.ietf.org/mailman/listinfo/cbor
>