Re: [Cbor] RFC7049bis processing of unknown tags

Laurence Lundblade <lgl@island-resort.com> Fri, 08 May 2020 04:22 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 8FCC43A0EE9 for <cbor@ietfa.amsl.com>; Thu, 7 May 2020 21:22:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.895
X-Spam-Level:
X-Spam-Status: No, score=-1.895 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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 6GBQzrWQajNz for <cbor@ietfa.amsl.com>; Thu, 7 May 2020 21:22:52 -0700 (PDT)
Received: from p3plsmtpa06-09.prod.phx3.secureserver.net (p3plsmtpa06-09.prod.phx3.secureserver.net [173.201.192.110]) (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 E98633A0EE8 for <cbor@ietf.org>; Thu, 7 May 2020 21:22:51 -0700 (PDT)
Received: from [192.168.1.34] ([76.167.193.86]) by :SMTPAUTH: with ESMTPA id WuXCjVlj5oXx7WuXDj2QUQ; Thu, 07 May 2020 21:22:51 -0700
X-CMAE-Analysis: v=2.3 cv=Revu9Glv c=1 sm=1 tr=0 a=t2DvPg6iSvRzsOFYbaV4uQ==:117 a=t2DvPg6iSvRzsOFYbaV4uQ==:17 a=RIlx1_Rhpp72ai8PUUAA:9 a=QEXdDO2ut3YA:10 a=bfIT2CVviWJ-shvUhXEA:9 a=yt1We-i2Pdz6Jy0M:21 a=_W_S_7VecoQA:10
X-SECURESERVER-ACCT: lgl@island-resort.com
From: Laurence Lundblade <lgl@island-resort.com>
Message-Id: <BBE5BF4A-23F8-43CB-BE63-047A28C17BA4@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_D4443572-47E2-4172-B638-AB57EFA75527"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
Date: Thu, 07 May 2020 21:22:50 -0700
In-Reply-To: <CANh-dXmjD=RCwh7ExjSvFx+5ciew+eqHoVS88OommQ2xVnX5=Q@mail.gmail.com>
Cc: Michael Richardson <mcr+ietf@sandelman.ca>, cbor@ietf.org, Carsten Bormann <cabo@tzi.org>
To: Jeffrey Yasskin <jyasskin@chromium.org>
References: <17300.1588779159@localhost> <38BB6FFF-737F-4C11-AD7A-DA3F28A9F570@tzi.org> <CANh-dXkdjMyO=WFUxrF06OfP+RE9v11unKJXL8P3UtEe+prV1w@mail.gmail.com> <13690.1588894939@localhost> <CANh-dXmjD=RCwh7ExjSvFx+5ciew+eqHoVS88OommQ2xVnX5=Q@mail.gmail.com>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
X-CMAE-Envelope: MS4wfGwZwhCYzWb56YE89pgrU/3higCxjMPqaiqmRLvhw0AN/ecO8pSXfXGUbCfFWNYJWDCeoAKoteiFIwkeMldWnxLIe2uSd6cuXrYaUo+EG42XWgL2y2In 64yhiUTDmoTudxSHAWWwcDSt9zBj5kVXIkkbg5LytZLbCL66dHYt7M8uEY2mkgXX9J3yA6613PLjFBclldTxKZ5psocX4GQmSWpMzuwa6EnOeZ54lv967Wd5 /TifhJqPyID6tjchd1Q7Rw==
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/zjM5eZKafI4eauRZkmPzjfnWcQo>
Subject: Re: [Cbor] RFC7049bis processing of unknown tags
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: Fri, 08 May 2020 04:22:54 -0000

The more core issue for me is how protocols and protocol implementations handle unknown tags. Generic decoders are an implementation detail in a way. It is still useful to discuss then, but what drives the CBOR specification should be the effect on an end-end protocol.

In most use cases where a tag defines a new data type it will not be useful to ignore the tag. An implementation that doesn’t understand the new data type is  out of date and incompatible. However, it is useful to entirely skip the full data item with the unknown tag, but it seems preferable to handle that with map keys/labels or such. If you don’t know the map key/label, skip the data item. An unknown tag shouldn’t break the ability to do that.

In some cases of type definition it might be useful to interpret the data item as if it were untagged, but from a quick look at the registry, it doesn’t seem to be useful that often. For example, if you are tagging something as a positive bignum, you probably really to know that to do anything with the data item. Ignoring a COSE tag isn’t going to be productive in any way. (It is possible that you know it is a positive bignum by other means than tagging, but in that case, you should be tagging in the first place; optional tagging is discouraged).

The analogy doesn’t completely work, but it seems kind of like ignoring type-defining tags is like ignoring  typedefs in C.

It's the case of conversion hints, where ignoring tags can work. But you have to know the purpose of the tag is a conversion hint and that its not a new type definition. Conversion hints don’t seem to the the main purpose of tagging, critically useful, or widely used, so it doesn’t seem critical to change CBOR to accommodate them.

From what Cartsen said it seems it would be an incompatible change from 7049 to require tags be ignored and it doesn’t seem that necessary.

If I’d put anything in CBORbis, it would be a warning that one should not count on unknown tags being ignored in CBOR, unless the protocol specification  says they must be ignored and how to do it and what it means.

LL


Also, it seems fine to define protocol modes that get implemented as API options, but it is the mode that is defined not the API.