Re: [Cbor] tag optionality and dCBOR
Carsten Bormann <cabo@tzi.org> Tue, 07 March 2023 18:01 UTC
Return-Path: <cabo@tzi.org>
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 DC32BC1524AE for <cbor@ietfa.amsl.com>; Tue, 7 Mar 2023 10:01:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.888
X-Spam-Level:
X-Spam-Status: No, score=-6.888 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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 iNRBoDyqu1Jc for <cbor@ietfa.amsl.com>; Tue, 7 Mar 2023 10:01:54 -0800 (PST)
Received: from smtp.uni-bremen.de (gabriel-smtp.zfn.uni-bremen.de [IPv6:2001:638:708:32::15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 F1C0FC1522AD for <cbor@ietf.org>; Tue, 7 Mar 2023 10:01:48 -0800 (PST)
Received: from [192.168.217.124] (p548dc9a4.dip0.t-ipconnect.de [84.141.201.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.uni-bremen.de (Postfix) with ESMTPSA id 4PWNYh69Y3zDCc6; Tue, 7 Mar 2023 19:01:44 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <5C727283-695E-4A47-B18F-B4FC85551CF3@island-resort.com>
Date: Tue, 07 Mar 2023 19:01:44 +0100
Cc: cbor@ietf.org
X-Mao-Original-Outgoing-Id: 699904904.412354-df88c360859efd9702c571f988bc1721
Content-Transfer-Encoding: quoted-printable
Message-Id: <F0CCF4B9-A486-4160-94DA-7D2177DA810F@tzi.org>
References: <5C727283-695E-4A47-B18F-B4FC85551CF3@island-resort.com>
To: Laurence Lundblade <lgl@island-resort.com>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/UFHz6OtJnjAYN8GlWzxvoZ3kreY>
Subject: Re: [Cbor] tag optionality and dCBOR
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: Tue, 07 Mar 2023 18:01:59 -0000
On 2023-03-07, at 18:42, Laurence Lundblade <lgl@island-resort.com> wrote: > > Section 4.2 of 8949 discussed tags in relation to deterministic encoding and around 5 minutes into the dCBOR video this is discussed. > > I’d like to drive a wedge between serialization variability (e.g. integer lengths, map sorting) and tag optionality and would like there to be no requirements in dCBOR around tag optionality. I think tag optionality is a protocol/application design characteristic. Indeed. Section 4.2 really talks about different ways an application may represent something (using the presence or absence of tag 1 as an example). Since we did have protocols that considered representing the same information both with and without a tag, the text is quite useful to recommend against this practice. If your application likes representing today as 1678212055 and 1(1678212055) half of the time each, or the number 1 as integer 1 and float 1.0 half of the time each, you have a deterministic encoding issue. That is not a CBOR problem. But CBOR gives you the tools to make that difference, and if the application jitters about uncontrollably, that’s a problem. The text might have been a bit shorted by just saying “folks, deterministic representation is not just a representation format layer problem, your application also needs to play”. > This is a little bit of a round about way to highlight this — A protocol that sends three integers (e.g. red, green and blue for a pixel) could use an array where red is first, green is second and blue is third. Or it could use a map and label the three integers. I expect dCBOR to be completely silent on this choice. It’s an application/protocol design issue with nothing to do with serialization variability. No, but with deterministic representation. See above. > I think the choice of whether to identify items in a protocol/application by tag is of the same nature. Yes. > I also think that discussion of tag optionality should probably not be in section 4 of 8949. It’s not really a related to serialization. It is the example we were using because there were protocols around that were just about to make this mistake. Grüße, Carsten
- Re: [Cbor] tag optionality and dCBOR Carsten Bormann
- [Cbor] tag optionality and dCBOR Laurence Lundblade
- Re: [Cbor] tag optionality and dCBOR Laurence Lundblade
- Re: [Cbor] tag optionality and dCBOR Christopher Allen