Re: [Cbor] Simple values 24..31 (was Re: List of not-well-formed CBOR and test vectors)

Laurence Lundblade <lgl@island-resort.com> Thu, 01 August 2019 17:18 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 8C50D1201D6 for <cbor@ietfa.amsl.com>; Thu, 1 Aug 2019 10:18:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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 ynTkfHywr-Gs for <cbor@ietfa.amsl.com>; Thu, 1 Aug 2019 10:18:57 -0700 (PDT)
Received: from p3plsmtpa08-02.prod.phx3.secureserver.net (p3plsmtpa08-02.prod.phx3.secureserver.net [173.201.193.103]) (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 028ED1201ED for <cbor@ietf.org>; Thu, 1 Aug 2019 10:18:51 -0700 (PDT)
Received: from [10.12.100.152] ([66.228.17.5]) by :SMTPAUTH: with ESMTPSA id tEj4hBxZSs9XUtEj5hJi6O; Thu, 01 Aug 2019 10:18:51 -0700
From: Laurence Lundblade <lgl@island-resort.com>
Message-Id: <1F6B26E0-3C1C-4DAD-9CFA-FEF1D375A541@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_2973DA4F-81BE-4EFF-A55B-F8650A1D20C4"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Date: Thu, 01 Aug 2019 10:18:50 -0700
In-Reply-To: <6CE31BD8-FA1C-4E5E-B55D-50EFFDCDDBE4@tzi.org>
Cc: cbor@ietf.org
To: Carsten Bormann <cabo@tzi.org>
References: <CF3F871E-7489-4770-B2FE-1746C392ACF0@island-resort.com> <39259861-43D9-4498-A2F5-E07DBC998CA6@tzi.org> <9592F4F7-2008-4770-8FB4-54BD39191EFE@island-resort.com> <6CE31BD8-FA1C-4E5E-B55D-50EFFDCDDBE4@tzi.org>
X-Mailer: Apple Mail (2.3445.9.1)
X-CMAE-Envelope: MS4wfJ3F/CoTT7GLyFXJmTC4B/Z6v8GmPAcNiPGgyyT1mcC9javFs5buifJPRFy9KPDEqg3NmlnI1+bOHtTsHX3UKuWOhyy2ZJH1SBiYs0GpGUMEUnt/yPKe pCtDN9t8FFDP+cg07KrTd5Q39oxywr38uzOPwLal5hQUFzISZ9x+hE8JLu1TJAi1kLENL/1ZGeqv7g==
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/AWKbkseQc8YnodiVCYM1hHdtQu8>
Subject: Re: [Cbor] Simple values 24..31 (was Re: List of not-well-formed CBOR and test vectors)
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: Thu, 01 Aug 2019 17:19:00 -0000

> On Jul 31, 2019, at 11:52 PM, Carsten Bormann <cabo@tzi.org> wrote:
> 
> On Aug 1, 2019, at 05:01, Laurence Lundblade <lgl@island-resort.com> wrote:
>> 
>> Why wouldn’t 24 through 255 be considered unassigned and encoded 0xf8 0x18 through 0xf8 0xff?
> 
> Because we considered those values confusing, and decided to give up on 8 potential values in exchange for reducing this confusion.  See Section 2.3 of RFC 7049 (parenthesis in first paragraph on page 13).
> 
> Whether that was a particularly wise decision can be discussed.  Since we already have to check for too-low values in the second byte of 7.24, checking for 32 is not more onerous than checking for 24 (see pseudocode).  Giving up 8 values seems to be of limited concern given the number of allocations of Simple values so far.  Changing this now, however, would be a backward compatibility issue that we need to avoid.
> 
> Grüße, Carsten
> 

I see the logic, though I kind of think the opposite. Carving out a chunk of simple values as never-to-be-used is also confusing. Confused me :-). Another reason it is confusing is that it makes them (just slightly) different from low-value integers.

Probably a lot of decoders today cannot decode these simple values, so allowing them now would break backwards compatibility.

I think they should be labeled different than “reserved” because that implies they are going to be used at a later time or for some special purpose. That’s why I went looking at extension points and IANA. Here’s a few suggestions:
Never to be used
Disallowed
Forbidden

Agreed that implementation cost is insignificant for any choice here.

LL