Re: [Ntp] CLOCK_TAI (was NTPv5: big picture)

Magnus Danielson <magnus@rubidium.se> Tue, 05 January 2021 11:05 UTC

Return-Path: <magnus@rubidium.se>
X-Original-To: ntp@ietfa.amsl.com
Delivered-To: ntp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B24563A00C9 for <ntp@ietfa.amsl.com>; Tue, 5 Jan 2021 03:05:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.361
X-Spam-Level:
X-Spam-Status: No, score=-2.361 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.262, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rubidium.se
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 qK2b4VjrJ-Nv for <ntp@ietfa.amsl.com>; Tue, 5 Jan 2021 03:05:05 -0800 (PST)
Received: from pio-pvt-msa3.bahnhof.se (pio-pvt-msa3.bahnhof.se [79.136.2.42]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 840573A005D for <ntp@ietf.org>; Tue, 5 Jan 2021 03:05:03 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTP id F0FAB3F509; Tue, 5 Jan 2021 12:05:00 +0100 (CET)
Authentication-Results: pio-pvt-msa3.bahnhof.se; dkim=pass (2048-bit key; unprotected) header.d=rubidium.se header.i=@rubidium.se header.b=AoOBZaiB; dkim-atps=neutral
X-Virus-Scanned: Debian amavisd-new at bahnhof.se
Received: from pio-pvt-msa3.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa3.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0GYWieqlU8iu; Tue, 5 Jan 2021 12:04:55 +0100 (CET)
Received: by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTPA id 1AD7D3F451; Tue, 5 Jan 2021 12:04:54 +0100 (CET)
Received: from machine.local (unknown [192.168.0.15]) by magda-gw (Postfix) with ESMTPSA id A028B9A0531; Tue, 5 Jan 2021 12:04:54 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rubidium.se; s=rubidium; t=1609844694; bh=T0/GB7hlT9aFRvfBQe/yKWY4iBLNs7uZj8gZ+RmzkaA=; h=Cc:Subject:To:References:From:Date:In-Reply-To:From; b=AoOBZaiBf+LaBiMxT25+ndPPjPK+JYUxp8cu+VSSil/L6+VtDyOrvRR5reQCLVG+c XxO47u+l7ZmXohSykHeHxBs0LyrMqe4EfOTsrzi8CEqevv4lpEUOeVbnq32lUNsCKf mh1r0010pJBYVWmktVYconnzGg51O2+pXbwC1dyqQacPLqQLI1oazRY7asqrjDx2Rw OjYO9yp/nK3b4anf/ou0oyQwR26cXtrDIIUAVAmyBWBO8w6G/eve3ht2BEGZNfp1LF O+iHOOKiB76PiKXQ5DVqaF/lWv6ZW1eOmHGjMVSCtlbzDkGs/e+GN+B4ClU/pqrXYM 6mccWKa5JMbHQ==
Cc: magnus@rubidium.se, NTP WG <ntp@ietf.org>, Warner Losh <imp@bsdimp.com>
To: Philip Prindeville <philipp@redfish-solutions.com>
References: <20210102081603.1F63C40605C@ip-64-139-1-69.sjc.megapath.net> <cecaf661-92af-8b35-4c53-2f025c928144@rubidium.se> <CANCZdfrURzZp5EoU8A-Q9K1tZN0DvLJ10a3ekQtvfrLJExuriA@mail.gmail.com> <cbfd20ae-7cc1-4ef8-0db4-540a11f64378@rubidium.se> <24EEF821-8ED9-46CF-8790-1DF63B102D76@redfish-solutions.com> <6a3a6032-29fa-d426-df3d-140bde4f0eca@rubidium.se> <FA39602B-038C-4844-9F10-82AAE4F8689A@redfish-solutions.com>
From: Magnus Danielson <magnus@rubidium.se>
Message-ID: <edaa2188-786d-bf8b-1f52-0064816564f9@rubidium.se>
Date: Tue, 05 Jan 2021 12:04:53 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.6.0
MIME-Version: 1.0
In-Reply-To: <FA39602B-038C-4844-9F10-82AAE4F8689A@redfish-solutions.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/jaDXSs2DKfz2pWNiXNEuHdq1a2M>
Subject: Re: [Ntp] CLOCK_TAI (was NTPv5: big picture)
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <ntp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ntp>, <mailto:ntp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ntp/>
List-Post: <mailto:ntp@ietf.org>
List-Help: <mailto:ntp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ntp>, <mailto:ntp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Jan 2021 11:05:10 -0000

Philip,

On 2021-01-05 04:40, Philip Prindeville wrote:
>
>> On Jan 4, 2021, at 4:03 PM, Magnus Danielson <magnus@rubidium.se> wrote:
>>
>> Philip,
>>
>> On 2021-01-04 21:33, Philip Prindeville wrote:
>>>> On Jan 4, 2021, at 1:21 PM, Magnus Danielson <magnus@rubidium.se> wrote:
>>>>
>>>> Warner,
>>>>
>>>> On 2021-01-04 19:29, Warner Losh wrote:
>>>>> On Mon, Jan 4, 2021 at 9:34 AM Magnus Danielson <magnus@rubidium.se> wrote:
>>>>>> It's not in NetBSD or FreeBSD.
>>>>> Unfortunately not. However, that could probably be changed if enough
>>>>> interest exists.
>>>>>
>>>>> There were a number of issues with it in Linux.
>>>> What issues are these that you refer to?
>>>>> If there's a clearer definition of what it should be and how things should be updated as leap second knowledge evolves, I'd be happy to get it into FreeBSD...
>>>> I think that part of the discussion is really not part of NTP WG discussion, but I am sure things can be figured out.
>>>>
>>> Again, disagree.  I remember the days of the IETF where (1) a document describing a protocol was required, and (2) a successful “bake-off” demonstrating 3 unrelated interoperating implementations was equally required…
>> Which is fine if it was relevant, which it really isn't.
>>
>> The details of how various implementations choose to do things is really
>> not what the protocol should go into, but it is good that the protocol
>> and details is done so the implementation becomes feasible. Wither the
>> kernel use TAI only or can handle various time-scales in parallel is in
>> my mind to very much degree an implementation detail.
>
> It’s as relevant as it’s ever (always) been: the implementations are in theory to be written “blind” with only the proposed RFC to guide the developers.  If the RFC isn’t sufficiently clear for at least 3 implementations to converge on a common interpretation, then it’s not adequately explained.
>
> I’m not talking about TAI being what the kernel uses; I’ve been talking about the on-the-wire canonical representation of time.
Trouble is, this particular thread started out with a discussion of what
the kernel should do, and I objected to the NTP WG to dictate what a
particular implementation would do. The protocol on the wire is a
different thing, that is for sure what the NTP WG should care about.
>> There Linux and
>> BSD can make different approaches with various benefits, and this is why
>> you want at least two implementations, with assumed different
>> implementation decisions, to bring it up on the standard track so that
>> you learned something. There are many ways to implement things, and not
>> all involve even the kernel to be involved at all. So, I think the
>> discussion about how the kernel handling things in itself is not the NTP
>> WG issue, other than showing it's feasible to do. If we agree that it's
>> feasible, we move on.
>
> That’s not what I was saying at all.  It was pointed out that the kernel uses UTC internally.
Actually, they do not use UTC internally, except some under very
specific conditions.
>
> I replied pointing out that (1) it doesn’t matter what the kernel uses internally if applications can get whatever time they need through run-time support (i.e. libraries like libc) and (2) internally the Linux kernel at least (and I figure most POSIX compliant kernels) are capable of maintaining multiple timescales.  As long as whatever the clock runs in natively can be converted unambiguously into any other format, it doesn’t matter which is used.
>
> For the sake of the kernel, the notion (or distinction) of days, years, and leap-days seems to be arbitrary or even irrelevant.
>
> All the kernel really cares about is maintaining accurate, stable, unambiguous time which can then be converted to the timescale being requested by a process in user-space.
>
> And because of this freedom, NTP can use whatever timescale it wants on-the-wire… and the kernel can likewise independently use whatever timescale it wants to use internally… as long as there’s a mechanism to convert to whatever applications want.
>
> I hear people repeating that the kernel, the protocol, and applications all need to use the same timescale.  They don’t.  This is a fallacy.

Agree, it's a fallacy indeed. I have tried to make that very point.

The particular thread started out with an ambition to steer how kernel
implement things, that I think is outside the scope of the WG. What is
inside is that regardless of how it is implemented, the needed
definitions, information and similar is provided such that
implementations (the notion kernel and user space may actually be
completely irrelevant in some implementations) can reasonably be
implemented, both in clarity and consistency.

If the NTP WG feels like it, it can provide informal information to
guide implementors, at least for some model. That is usually handy, as
it tends to provide alternative explanation of things fits together.
Here the NTPD implementation has acted as the reference, the golden
standard if you so like. Trouble is, it attempts to be both reference
implementation and the actual implementation. This can be troublesome,
as the reference part becomes obscured by the many details of real life.
This is not to say that NTPD is not without value, but it is problematic
in terms of reference implementation in this regard. There is quite a
bit of reading to do to be able to penetrate the many things going into
it. Dave Mills provides information in books and webpages for sure, I
have seen far worse examples, but one could consider a somewhat cleaner
slate.

Cheers,
Magnus