Re: [Cbor] Request for IANA registry addition for cbor tag

Jim Schaad <ietf@augustcellars.com> Wed, 22 January 2020 01:05 UTC

Return-Path: <ietf@augustcellars.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 5D3421200C5 for <cbor@ietfa.amsl.com>; Tue, 21 Jan 2020 17:05:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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 eRG4q_pxw-V0 for <cbor@ietfa.amsl.com>; Tue, 21 Jan 2020 17:05:49 -0800 (PST)
Received: from mail2.augustcellars.com (augustcellars.com [50.45.239.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4E1F11200C4 for <cbor@ietf.org>; Tue, 21 Jan 2020 17:05:49 -0800 (PST)
Received: from Jude (73.180.8.170) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 21 Jan 2020 17:05:38 -0800
From: Jim Schaad <ietf@augustcellars.com>
To: 'Carsten Bormann' <cabo@tzi.org>, 'Laurence Lundblade' <lgl@island-resort.com>
CC: cbor@ietf.org, 'Kio Smallwood' <kio@mothers-arms.co.uk>
References: <8eefb11ba6e49f7f19fd645d11d47a7f@mothers-arms.co.uk> <75E3B32F-CEF8-4338-917D-2264006287FF@tzi.org> <644EE647-CC60-4F4C-AE4A-94B511E9597F@island-resort.com> <8EB0DDFD-5AF1-4010-84AF-55F6E21688B2@tzi.org>
In-Reply-To: <8EB0DDFD-5AF1-4010-84AF-55F6E21688B2@tzi.org>
Date: Tue, 21 Jan 2020 17:05:36 -0800
Message-ID: <000001d5d0c0$100a0cd0$301e2670$@augustcellars.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQMncCY59d2Xg3V/x0PcOAKJW+BM4QIBEeFaAY+ltsEBZHBqAqUq9UvQ
Content-Language: en-us
X-Originating-IP: [73.180.8.170]
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/hB7jZI1U_9kfzwJnjTFfKC71K3o>
Subject: Re: [Cbor] Request for IANA registry addition for cbor tag
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: Wed, 22 Jan 2020 01:05:51 -0000


-----Original Message-----
From: CBOR <cbor-bounces@ietf.org> On Behalf Of Carsten Bormann
Sent: Tuesday, January 21, 2020 12:03 PM
To: Laurence Lundblade <lgl@island-resort.com>
Cc: cbor@ietf.org; Kio Smallwood <kio@mothers-arms.co.uk>
Subject: Re: [Cbor] Request for IANA registry addition for cbor tag

Hi Laurence,

I’m not sure I follow.  Decoders either implement a tag or they don’t.

> On 2020-01-21, at 18:58, Laurence Lundblade <lgl@island-resort.com> wrote:
> 
> Here’s some decoders types in relation to this tag:
> 
> 1) It recognizes the tag, supports it and does the right thing.

That would be a decoder that implements the tag.

> 2) It recognizes the tag, knows it can’t do what is required and errors out. For this decoder this type is invalid.

That would be a decoder that fundamentally doesn’t accept this tag.
Not particularly useful.
What does “can’t do what is required” mean?

> 3) It doesn’t recognizes the tag and happens to do the wrong thing. That is perfectly OK.

How would that be OK?  But maybe I don’t understand that “do the wrong thing” means.

> 4) It doesn’t recognize the tag and happens to do the right thing.

Which would be to present the tag number and the tag content to the application.

> So anyone using this tag really needs to be sure they are using a decoder of type 1. Decoder types 3 and 4 are really the same in that there is no way to know which one you’ve got.
> 
> I don’t think we want some sort of implication that decoder type 3 is defective creating a situation where all decoders are forced to support this.

Now I’m completely lost about your type 3.  “Do the wrong thing” and “OK” don’t mix that well for me…

> I think this should be spelled out in the description of this tag.

I think 7049bis might need some more text about handling unimplemented tags in decoders.

Right now, it says:
  Implementations receiving an unknown tag number can choose to simply ignore
  it or to process it as an unknown tag number wrapping the enclosed data
  item. The IANA registry in {{ianatags}} is the appropriate way to

[JLS]
Carsten,

I would argue that the decode that I use obeys the text above and would fall into the category of decode that is going to do one of "bad" things Laurence discussed above.  It will return a tree with the following 
<TAG  new tag number>
   <MAP>
       [<key> <value>]+

However, depending on what the final language that the group comes up with for the duplicate tag language, it will either take the first, the last or throw and exception when a duplicate tag is found.  That says that it can not do the first option (hey dup tags are not done will for hash based maps) and thus will either do 3  or totally fail.

I would not really be a huge fan of this tag.  If this is really what you want to do then an array seems to me to be a better answer.

Jim


But it also says:
Generic encoders provide an application interface that allows the application to specify any well-formed value, including simple values and tags unknown to the encoder.

So a generic encoder would not have problems with unimplemented tags; but other (e.g., task-specific) implementations might.

Grüße, Carsten

_______________________________________________
CBOR mailing list
CBOR@ietf.org
https://www.ietf.org/mailman/listinfo/cbor