Re: [Cbor] Tagging requirement

Carsten Bormann <cabo@tzi.org> Tue, 18 August 2020 19:18 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 AC7963A0A6E for <cbor@ietfa.amsl.com>; Tue, 18 Aug 2020 12:18:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 idML2tsdGusz for <cbor@ietfa.amsl.com>; Tue, 18 Aug 2020 12:18:37 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DA31E3A0A73 for <cbor@ietf.org>; Tue, 18 Aug 2020 12:18:36 -0700 (PDT)
Received: from [172.16.42.100] (p5089ae91.dip0.t-ipconnect.de [80.137.174.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4BWLL32vPLz102v; Tue, 18 Aug 2020 21:18:35 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <72CC1398-659B-4934-8851-50B8BB4752E1@island-resort.com>
Date: Tue, 18 Aug 2020 21:18:34 +0200
Cc: cbor@ietf.org
X-Mao-Original-Outgoing-Id: 619471114.825635-106db78117fa932f96bcd10defa78f2b
Content-Transfer-Encoding: quoted-printable
Message-Id: <7A845B58-9313-4B89-9A88-16A4E25A942B@tzi.org>
References: <5F695632-CF27-40FF-BC23-E731AAA95771@island-resort.com> <895A3DF8-DF11-479F-9DC6-9EF98465A7E0@tzi.org> <D8A304BA-897A-46D2-9B67-4FF458883478@island-resort.com> <1FC978C4-5EB5-42D9-B522-28D72FDCA5B9@tzi.org> <72CC1398-659B-4934-8851-50B8BB4752E1@island-resort.com>
To: Laurence Lundblade <lgl@island-resort.com>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/9f4NzhKZL74WZzLav10am7_2yto>
Subject: Re: [Cbor] Tagging requirement
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
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, 18 Aug 2020 19:18:40 -0000

On 2020-08-17, at 22:37, Laurence Lundblade <lgl@island-resort.com> wrote:
> 
> 
> 
>> On Aug 17, 2020, at 11:23 AM, Carsten Bormann <cabo@tzi.org> wrote:
>> 
>> On 2020-08-17, at 19:56, Laurence Lundblade <lgl@island-resort.com> wrote:
>> 
>>> with value 1 followed by the content which is a number.
>> 
>> Yes.
>> 
>>> Unless explicitly allowed, the type 6 integer and number content are inseparable. 
>> 
>> As long as you are talking about Tags, yes: Tags are a major-type 6 container.
>> You can also borrow the definition of a Tag content data structure for an application protocol, but then you aren’t using a Tag, you are using the definition of a Tag content data structure (or “an unwrapped tag”, if you must say so).
> 
> What do you think about defining CBOR protocol items that can be either tag-contained or unwrapped?  In CDDL, “dualistic_bigfloat = bigfloat / ~bigfloat”. 

I think that this specific example is the OPTIONAL in your previous message that we would normally try to avoid.

> Making a distinction in the way CWT is defined and named from the way epoch date, bignum and such are defined is what clears it up for me.

Good.

> The definition of the CBOR structure for CWT is independent of the CWT tag. The CBOR structure for the CWT is defined first. Then the tag definition comes a long and says is contents is a CWT.

Right.  Does it even say that a CWT with a tag 61 around it is a CWT?

That is indeed some terminology thing we could try to normalize.

> For tags epoch date, bignum and such there is no independent definition of the contents. That content definite is wrapped up with the tag definition. If you want to use the content without a tag-container you have to unwrap it.

Indeed.

> That a tag is a “container” is really helpful to me.

We are not using this term in 7049bis.
But if you look at Table 1, there are three (definite-length) major types that have data items in them: 4 (array), 5 (map), 6 (tag).
(Table 2 then reveals that indefinite length strings are represented like containers, but that is not really their semantics.)

> Thanks for the discussion on this!

Certainly!

Grüße, Carsten