Re: [Cbor] I-D Action: draft-ietf-cbor-time-tag-04.txt

Laurence Lundblade <lgl@island-resort.com> Tue, 17 January 2023 19: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 65537C15171D for <cbor@ietfa.amsl.com>; Tue, 17 Jan 2023 11:18:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.398
X-Spam-Level:
X-Spam-Status: No, score=-1.398 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLACK=0.5, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=no 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 YalJArQcDNVP for <cbor@ietfa.amsl.com>; Tue, 17 Jan 2023 11:17:56 -0800 (PST)
Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2139.outbound.protection.outlook.com [40.107.220.139]) (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 9F207C151547 for <cbor@ietf.org>; Tue, 17 Jan 2023 11:17:56 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zugb6Az6rCJOEioR8CaTpZORC1z45VnSRu5r0synWY8PmCalTaQZn/HZwqMNo0uUfejw8CoWOMoGRCoABM8LwmonG5eCFWdALVxSHlWzlF+golZpufrzfnJ4XBfUDyYldpGSEpAL9jLqnBFyuEOJndcOd8bi0zjmEL0zoAGeog6RXG1RNnKxCOH6atXtgINcbhX10t1JPsbM6rjF+7HoohYqwPOMQCWKMFwA3j4HI2peAeXGTPEZZakCFzP1KBN+6AhthXziNk6WvtTr9SOHeXU32q+1KDMiLC7m+68TLLVX0mXsGSh7ExvWJ1aorG3fULLaASyojkwcMAqeNeYS4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xVvgcQtrbUaYXrOZbytW5Zeud1TKCCMkTKxo/DCqrjI=; b=dTlkO+UWiL82jCICJTmeFoHdK3EFUwuh9JfeRX1YT3eh7tuT4HMWJYGAzrpjJM271GhN8AEa8wWYklhNzqYTXlEcYDnRyBoYm7aydWBpx/qx1+z7Dj57EiaWewmzGjZ/NaHVO7nXto77HbIRphQ8UtNAYVyuGiRcT3J7LYnGqYlGCWr94geTcAm2QNDvMcVcdSmlkXRxvc2CU/r4CKACR3oSBHGENkj4q8waWrN/RhClORuZKsSIOaBSJcEcdxGXuagAqlTZKJi2n89ko9WVwWqTPAjVQHx2VyJNNQ/tk/8aw0rAUayFQhfkRDyNfajF7m/tdgfGBJUQvYCrnyMfFw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=island-resort.com; dmarc=pass action=none header.from=island-resort.com; dkim=pass header.d=island-resort.com; arc=none
Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=island-resort.com;
Received: from PH7PR22MB3092.namprd22.prod.outlook.com (2603:10b6:510:13b::8) by SJ0PR22MB2445.namprd22.prod.outlook.com (2603:10b6:a03:323::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Tue, 17 Jan 2023 19:17:52 +0000
Received: from PH7PR22MB3092.namprd22.prod.outlook.com ([fe80::56db:3dfb:772f:9043]) by PH7PR22MB3092.namprd22.prod.outlook.com ([fe80::56db:3dfb:772f:9043%9]) with mapi id 15.20.5986.023; Tue, 17 Jan 2023 19:17:52 +0000
From: Laurence Lundblade <lgl@island-resort.com>
Message-Id: <131F82B0-9A17-4ED0-8165-099EEEDA688E@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_171367DB-2FA9-4B5D-B03E-C3C3962CBADD"
Date: Tue, 17 Jan 2023 12:17:48 -0700
In-Reply-To: <884A5FC3-87C9-4DDE-8138-8C63C0DB80B4@tzi.org>
Cc: "cbor@ietf.org" <cbor@ietf.org>
To: Carsten Bormann <cabo@tzi.org>
References: <167345627851.15097.9738487459393843034@ietfa.amsl.com> <87ADDD53-9921-4E93-9806-911EBB5A43D3@island-resort.com> <884A5FC3-87C9-4DDE-8138-8C63C0DB80B4@tzi.org>
X-Mailer: Apple Mail (2.3608.120.23.2.4)
X-ClientProxiedBy: CY5PR17CA0022.namprd17.prod.outlook.com (2603:10b6:930:17::12) To PH7PR22MB3092.namprd22.prod.outlook.com (2603:10b6:510:13b::8)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH7PR22MB3092:EE_|SJ0PR22MB2445:EE_
X-MS-Office365-Filtering-Correlation-Id: a5ac72bc-ed78-4d75-ae65-08daf8bf8753
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: KUA3NpgxwNwsFHMjJumpL0Eagtemayz6Wl8CyCaYjjHEc5nQxGAum9FtelUvaOinsQd6HL8CsYahPNdZnmXcun06VrdUCiQDHM/2SI5metIbxqFqSrFa3PjhiUZJvrKOg27f+FHtMUilLC0oEViNaavM0vf4fG3FLIE8gUEo8rsgxwkLD1ahXnHMFRPaks79yWHUxcinRbHLhtJquMC9/cJk9+mK8Fn5SeEfnLKzHV3c+BIKR33gZaupHKpBhAdusrwht0rYvE7rUFbIi5EYXKD+PpgP6k823yDA1IZE8ezhxlJsuGWOuWF13AU8PJWxibJ62xEuwsOtuGKlN36s3Yh/jvNf7UTnQAylrVeWUgzc//urfpPgC3PsWJCnmOk8wb8eAdMfiYmsGi4VlPnd35EDr0Ycl4sYxPthGAVCglpfCJuURuGi1nVfGh+rc8ne7g1HQbV9uupZvHsOa7wmcUYJQkE8o0L2ORch9LNJL+XBCOEBs35tbK1c+zQMGyTija+3IZo3d4uHe2dBVcqudf3oBcQNPR8UROd8dBLlunh9PZnNQoNgqWsSdkH9D6wf+IbXWj5BzY2c5WJcTc3Gk5LA7r3d55LNQpO8KO0IRzAL6XfYJQXZOI32evTQoE605IARqImrVCgew84WGyl+NOFllaaPkiIqBPbY6j4TKNxAGATUX069Y8qMEi8vIeIdTOl3I8a1rhv0u+X2nTgQjL/XxfYuzI70ry58TS1MDKORrd2/cVGzGvBrxDhvFUy1
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR22MB3092.namprd22.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(39840400004)(136003)(376002)(366004)(346002)(396003)(451199015)(66899015)(36756003)(86362001)(6916009)(30864003)(2906002)(66946007)(8676002)(8936002)(66556008)(66476007)(4326008)(38100700002)(83380400001)(166002)(5660300002)(38350700002)(33656002)(316002)(6486002)(52116002)(966005)(41300700001)(6666004)(478600001)(2616005)(6512007)(6506007)(26005)(53546011)(186003)(33964004)(45980500001); DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: KOlz1qr6IEpgXQqvp4hLTSwOGbDQBURbK8QlU32MsOTFW1bSPkku8JcAE2O/8FtIOHHLHwBaTsfB/+EFjr2zbEiYzk9WNU7XMViBeDTWzoKHM/u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gdTR/u+f2ba1QaA5R6p2VaQEDF7duKK1XJtaPNRAiNb67yV6dZk6VR+zmoD8ZJy40vu3A9cHYEItscRvYlJiIYtauC/OZtCEUNx9nVrBjxAMqQrwh2H2RvjYAR60TdMn2+v6bH5T6dCuhHMaQpPALoExpS3veI01ff+wG4OVygtinNHcixybI/8FODywnawU/MVCq0KwdHMo4PDUwJ7ohhXruZGnWB0OmSsw30ZtxUcPGMyTky7Lhw4VISqCrTqPLDvFBRps+FVER2RDfa3ofuP1XqrR1shb2WRIA682+FG9/ppqioWsfVBoadwdKRIh4SdtkSAmemmz2m6na997gmjs/MMxdqQCp3o95TEmrikc17Dwkeyn6uDIX9ILIT/4Q0RQlc9SYFJCc4rWAWrXUa9TFQHfu4e+vet6
X-OriginatorOrg: island-resort.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a5ac72bc-ed78-4d75-ae65-08daf8bf8753
X-MS-Exchange-CrossTenant-AuthSource: PH7PR22MB3092.namprd22.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 19:17:52.1383 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: ad4b5b91-a549-4435-8c42-a30bf94d14a8
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: M960LMoMKE89o7tYPoL6fFbpvL3RgCVy8f2RbsEe+3dK0mpoaJRjb/siK4cd7dGDqPx66nHrmG4HImVz4RMJ5A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR22MB2445
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/cnMTHSDZnR-mLO-kSsFB97xl5bI>
Subject: Re: [Cbor] I-D Action: draft-ietf-cbor-time-tag-04.txt
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: Tue, 17 Jan 2023 19:18:01 -0000

> On Jan 16, 2023, at 10:14 AM, Carsten Bormann <cabo@tzi.org> wrote:
> 
> Hi Laurence,
> 
> Thank you for these comments.
> 
>> On 2023-01-15, at 01:16, lgl island-resort.com <lgl@island-resort.com> wrote:
>> 
>> Attached is an annotated PDF with my comments.
> 
> Let me take these items first:
> 
>> * It does a lot more than these two — time zones, clock quality.
> 
> 
> The spec itself is not concerned with timezone (the SEDATA additions may provide some additions).  But the paragraph you made this comment on was about timescales, so I’m confused.

This section is a list of objectives. Only two are listed when there while the document achieves more.  The thought was to add a few more bullet-paragraphs listing clock quality and such as objectives to make the document more consistent.


>> * Why not bignum? Bignum is much simpler to implement than bigfloat of decimal fraction. Maybe because -3, -6 and such give the equivalent of big nums?
> 
> 
> We are not aware of an application that would need a bignum value for the *seconds* that 1, 4, or 5 need.  But it would of course be possible to use a bignum value for milliseconds, picoseconds, 2^{-64} seconds, …  Keys for this can be registered later, or can be defined now.  Vadim made us aware of SQLite, which among other variants uses a milliseconds-based integer time — but here a basic CBOR int (-2^{64}..2^64-1) suffices for the next 500 Gigayears to so (the earth is scheduled to be absorbed by the sun in 7.5 Gigayears).

Understood. We don’t need bignums for the calendar app where the sun's schedule is tracked. :-)


>> * Seems like this CDDL could be much improved by listing out all map items like ClockQuality-group and providing a default rule for items not defined in this document. This would help people validating with the CDDL tool a lot.
> 
> 
> Well, when including future registrations, `any` is as specific as we can get here.  We could of course include the known registrations in an extended CDDL spec of the map.

Yes, I was thinking that CDDL for defined registrations is included and the future extensions have a .feature so you can know in CDDL validation when you are in the bounds of the specification.


>> * New time formats must be Posix-based (because the base time keys 1, 4 and 5 are TIME_T) (If others are allowed, then require definition of new base time types for them
> 
> Can you please elaborate on this concern?
> It is true that the tag so far assumes time formats and timescales mix freely; that may not be always true.  But a new (base) time format could come with its own timescales and require their use, so I’m not sure that actually is a problem.

I see.  A new base-time with key 11 or such could be defined that is not Posix/TIME_T based.

Some care is needed by implemtors to coordinate the timescale key (-1) with what base time is used in the base time. It’s counter-intuitive to me that each base-time has a default timescale that is then refined by the timescale key. Some text pointing this out would be helpful.

A more intuitive definition for me would be that the timescale of any base-time is determined solely by the timescale key, perhaps with the default timescale for all base times being TIME_T, but with some explanation the current seems workable.


>> Most are requests for clarifications and improvements. Here’s some, but not all:
>>  - Clearly state this is only for times with 1970 as origin — Posix-based time
> 
> “This”?  The two timescales registered so far have this property, but this is not intrinsic to the time tag.  (Of course, it would be nice if future timescales were to have this property, but that may be more complicated to achieve than it's worth.)

“This” is the draft-ietf-cbor-time-tag, I didn’t understand at first reading that base times could be other time than Posix.


>>  - Request for more examples
> 
> Examples are always good, but too many examples can bloat a specification.
> Do you have examples [sic] where an example might help?

One or two examples for section 3.3 is the top of my list. Would help to understand intent much more quickly.


>> Here’s one show stopper for me. I think the intent is that a decoder should error out if it encounters an item with an unsigned key that it can’t decode. For example a decoder that only supports base time “1” should be allowed and it should error out if it encounters a big float base time as input. But I think as written the text kind of says that all decoders must implement all base times and critical items.
> 
> Where does it say this?
> Nothing is mandatory to implement.
> (You need to have at least one base-time per time-tag.
> We might want to add a tag that identifies just additional keys such as clock quality; this needs to be a different tag as it is not by itself a timestamp.)

This sentence 
    Not understanding key/value for unsigned integer keys is an error
says to me that all decoders MUST implement all unsigned integer keys.

> Maybe clarifying this some more:
> https://github.com/cbor-wg/time-tag/pull/13

This helps and now I know what is intended, but I think it could be phrased a little more clearly. I think I would say somewhere that the only requirement of an implementation is that it support at least one base time. Then I’d say that decoders that encounters a base time type that they have not implemented should return a fatal error and cease decoding.



>> Here’s the other one (which you’ve heard from me before). I dislike the requirement to implement floating-point a lot. I would like to see an integer-only base time that doesn’t require floating-point. Perhaps key 1 is integer only and key 7 is float only. Or just say float is optional with key “1”.  This does break some compatibility with CBOR tag 1, but I still think this change should be made. 
> 
> It is evident whether your key 1 carries a floating point value or an integer value.

As an implementor of a decoder of key 1, I believe the text implies I MUST be able to decode floats. It seems like the encoder is free to choose int of float so there is only guaranteed interoperability of key 1 if the decoder supports float.

This is why I went to the trouble of explicitly excluding float for tag 1 in EAT. It prevents the sender from ever sending float so the decoder is clearly relieved from implementing float.

> Why do you need a different key as well?

Yes it could be either a different key or clearly state float is optional for key 1.

>> As this document stands all decoders of it MUST support one of IEEE 754 float, decimal fractions or big numbers.
> 
> I don’t agree.

OK, perhaps "strongly implied" because the definition of key 1 doesn’t explicitly say float is optional. 

> The point of key -3 etc. is that you can combine an integer base time with fractional seconds that are again specified in an integer key.
> 
>> There’s no simple integer-only option. I can’t do a simple thing like indicate an integer time is TAI without implementing IEEE 754 float. OK. Well I could and probably it would mostly be OK in practice, but it would be out of compliance with the specification. We’re serious about interop in the IETF, right?
>> 
>> Evidence I’d offer for this is multiple serious requests that I’ve had and fulfilled to optionally remove all use of floating point from my QCBOR library.
> 
> This is totally within the domain of application of this tag!

TLDR for the following: should the document have a profiles section?

The reality of this tag is that it must be profiled to guarantee interoperability. For example a protocol incorporating this needs to say which base-time and which fractions the sender can send and which the receiver must decode. There’s quite a lot to profile here. A full profile should probably list every key the sender can send and which the receiver must decode. Even within some keys (e.g., timescale) profiling is needed. Float optionality is just another thing to profile.

EAT takes this issue head-on admitting up front it is a framework, not a protocol and defines a profiling method. COSE also has some paragraphs that say it must be profiled for interoperability.

It was fairly strongly suggested that EAT was taking the easy way out and not doing it’s job by not locking down for full interoperability. It seems to me that those that said that about EAT might say that of this tag. However, I strongly disagree with that suggestion. The variability in EAT and here are present for a very good reason and should not be removed.

I kind of think there should be a paragraph that explains that this tag needs to be profiled for interoperability.

To go on a little further — the FIDO standard has a full protocol compliance validation/logo program that was used to validate that end consumer client products interoperate fully with commercial server products. This helped make the FIDO standard much tighter. There are only a few implementation options and they are managed. Probably WiFi Alliance, W3C, BlueTooth… do similar. This is what I think of for interoperability. A lot of IETF protocols, like COSE and this draft, are building blocks or tool kits, not end commercial interoperable protocols. That’s fine. The question is do we be up front about this the way EAT is.

LL