Re: [Cbor] Robert Wilton's Discuss on draft-ietf-cbor-time-tag-11: (with DISCUSS and COMMENT)

Carsten Bormann <cabo@tzi.org> Thu, 26 October 2023 08:22 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 13378C151701; Thu, 26 Oct 2023 01:22:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.906
X-Spam-Level:
X-Spam-Status: No, score=-1.906 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] 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 rZM0_MD0BgxV; Thu, 26 Oct 2023 01:22:28 -0700 (PDT)
Received: from smtp.zfn.uni-bremen.de (smtp.zfn.uni-bremen.de [IPv6:2001:638:708:32::21]) (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 03152C15106C; Thu, 26 Oct 2023 01:22:25 -0700 (PDT)
Received: from eduroam-pool10-182.wlan.uni-bremen.de (eduroam-pool10-182.wlan.uni-bremen.de [134.102.90.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4SGJgg1QvLzDCgC; Thu, 26 Oct 2023 10:22:23 +0200 (CEST)
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: <169822991734.25025.2578479462883686140@ietfa.amsl.com>
Date: Thu, 26 Oct 2023 10:22:22 +0200
Cc: The IESG <iesg@ietf.org>, draft-ietf-cbor-time-tag@ietf.org, cbor-chairs@ietf.org, cbor@ietf.org, barryleiba@computer.org
X-Mao-Original-Outgoing-Id: 720001342.5513541-d177ae65f1ff911bdbfeda2333e4fe0a
Content-Transfer-Encoding: quoted-printable
Message-Id: <9BF158D2-BF72-4BB7-A035-99FAB8FE536F@tzi.org>
References: <169822991734.25025.2578479462883686140@ietfa.amsl.com>
To: Robert Wilton <rwilton@cisco.com>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/9e6bjj7wzrVGhQxTQgBuQEiR9t0>
Subject: Re: [Cbor] Robert Wilton's Discuss on draft-ietf-cbor-time-tag-11: (with DISCUSS and COMMENT)
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: Thu, 26 Oct 2023 08:22:33 -0000

Hi Rob,

thank you for this feedback!

> On 2023-10-25, at 12:31, Robert Wilton via Datatracker <noreply@ietf.org> wrote:
> 
> Robert Wilton has entered the following ballot position for
> draft-ietf-cbor-time-tag-11: Discuss
> […]
> 
> The document, along with other ballot positions, can be found here:
> https://datatracker.ietf.org/doc/draft-ietf-cbor-time-tag/
> 
> 
> 
> ----------------------------------------------------------------------
> DISCUSS:
> ----------------------------------------------------------------------
> 
> Hi,
> 
> Thanks for this document, I have a few "discuss" level comments:
> 
> Moderate level comments:

I think that this discussion could lead to quite different conclusions based on different perspectives on how tags like these will be used.
I think that most people in the CBOR WG see these new tags as building blocks that do not constitute a complete application protocol by themselves (e.g., we are not defining a media type here), but that are used as components of actual application protocols.
This means that much of the onus of discussing the below questions rests with those application protocols.

> (1) p 0, sec
> 
>   The Concise Binary Object Representation (CBOR, RFC 8949) is a data
>   format whose design goals include the possibility of extremely small
>   code size, fairly small message size, and extensibility without the
>   need for version negotiation.
> 
> My main concern here is the risk that introducing these new time encodings
> could end reducing interoperability.  My initial reading is that these new
> types are more flexible, contain more information, and hence require more code
> to parse and understand than say the tag 1 type, and hence may not be so widely
> understood and used by implementations.  Hence, please can the authors consider
> whether there should be a recommendation to use time type 1 in preference, and
> only use the extended time types where required?  Or conversely, encourage
> everyone to move to a particular variant of the new extended time type.

Tag 1 is fine for its intended purpose, and we are not changing anything about this (except maybe relieving the pressure that Tag 1 should have been defined to accept Tag 4 or Tag 5 numbers, which 1001 now does).

We could define a 1001 with just map key 1 as equivalent in general to Tag 1 and declare this as the preferred representation.

But it really should be the application protocol that decides this.
Many application protocols will uses an “unwrapped” form of this (without a tag, because that would be redundant with context information already available), and then possibly also integrate the unwrapped form of tag 1:

unwrapped-time = ~Etime / ~time
my-application-struct = {
  4711: unwrapped-time
  …: …
}

> (2)
> Related to my previous comment, I have a question about normalization or
> canonicalization.  The new extended time type allows the same time to be
> represented in multiple different ways (e.g., int, binary float, decimal float,
> split secs + fraction).  Does any guidance need to be given if canonicalization
> is required?

Again, this really should be defined in the application protocol; preferred/deterministic representation requirements can be very application specific.
E.g., a protocol that essentially represents UNIX (Posix) timestamps might prescribe that keys 1 (seconds, with an integer value) and -9 (nanoseconds) are always used, but no other keys.  These data items can then be processed by any generic extended time implementation, but also by one very specifically targeted for this application protocol.

> (3) p 12, sec 4.  Duration Format
> 
>   Semantically, they do not measure the time elapsed from a given
>   epoch, but from the start to the end of (an otherwise unspecified)
>   interval of time.
> 
> Are any of the fields defined in etime-detailed not appropriate for a duration,

In my response to Erik Kline’s COMMENT in
<https://mailarchive.ietf.org/arch/msg/cbor/RrZOgsy1iapx6W-H1uaw5zR-U1U>, I wrote about Duration:

>> Indeed, not all combinations of (possibly even nested) keys make a lot of sense (e.g., an uncertainty for an uncertainty, see the note in Section 3.5.4).  I wouldn’t know what to do with a critical Time Zone Hint, unless there is context that supplies an epoch.
>> 
>> I don’t think we could provide exhaustive rules that would define which combinations make sense, in particular with new map keys being assigned in an open registry.

> and if so should they be listed

(I don’t think we can say that in general)

> and what should a receiver do if they receive
> them?

(The example of a critical Time Zone Hint on a Duration would make me reject the Duration, unless there is context that is intended to supply an epoch, which would again something that an application protocol would define.)

I don’t think we could provide exhaustive rules that would define which combinations make sense, in particular with new map keys being assigned in an open registry.

> Or is the only rational choice here that is has to be down to the
> application to decide how to handle this case?  

I think this is indeed the case.

> Either way, is any additional
> text needed here?

A need for this probably didn’t occur to us as we see tags like 1001 to 1003 as building blocks that are used by applications, not applications by themselves.

> ----------------------------------------------------------------------
> COMMENT:
> ----------------------------------------------------------------------
> 
> Minor level comments:
> 
> (4) p 13, sec 5.  Period Format
> 
>   Period = #6.1003([
>     start: ~Etime / null
>     end: ~Etime / null
>     ? duration: ~Duration / null
>   ])
>   If the third array element is not given, the duration element is
>   null.  Exactly two out of the three elements must be non-null, this
>   can be somewhat verbosely expressed in CDDL as:
> 
> I found it harder (but not impossible) to understanding the intended encoding
> here.  Also, rather than allowing duration to be null, or missing (i.e., len 2
> array), would it better to choose just one of these encodings, or otherwise do
> you need to consider canonicalization of start/end periods?
> 
> Perhaps splitting this into two paragraphs would be easier to read/explain. 
> E.g.,
> 
>  A period can be represented by a start and end time, in which case it is
>  represented as an array of two elements.
> 
>  Alternatively, a period can be represented as a start time with duration or
>  an end time with duration.  This is represented as an array of 3 elements
>  where either the start or end time MUST be set to null.

That is a slight simplification that I personally like.

I edited this a bit further; it is now:
https://github.com/cbor-wg/time-tag/pull/25

This is a slight technical change as the third element no longer can be null, but I count that as an improvement (one less variant to interop-test).

Grüße, Carsten