Re: [Ntp] Antw: [EXT] Re: NTPv5: big picture

Magnus Danielson <magnus@rubidium.se> Tue, 05 January 2021 14:34 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 B67223A0F46 for <ntp@ietfa.amsl.com>; Tue, 5 Jan 2021 06:34:46 -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 1rW9HUqTK7fS for <ntp@ietfa.amsl.com>; Tue, 5 Jan 2021 06:34:44 -0800 (PST)
Received: from ste-pvt-msa2.bahnhof.se (ste-pvt-msa2.bahnhof.se [213.80.101.71]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D2E473A0F3A for <ntp@ietf.org>; Tue, 5 Jan 2021 06:34:43 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 7347C3F6C4; Tue, 5 Jan 2021 15:34:27 +0100 (CET)
Authentication-Results: ste-pvt-msa2.bahnhof.se; dkim=pass (2048-bit key; unprotected) header.d=rubidium.se header.i=@rubidium.se header.b=NuXjhDUL; dkim-atps=neutral
X-Virus-Scanned: Debian amavisd-new at bahnhof.se
Authentication-Results: ste-ftg-msa2.bahnhof.se (amavisd-new); dkim=pass (2048-bit key) header.d=rubidium.se
Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C-0s0chD1j9x; Tue, 5 Jan 2021 15:34:26 +0100 (CET)
Received: by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 9AF183F6C0; Tue, 5 Jan 2021 15:34:22 +0100 (CET)
Received: from machine.local (unknown [192.168.0.15]) by magda-gw (Postfix) with ESMTPSA id 4C4E79A0078; Tue, 5 Jan 2021 15:34:37 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rubidium.se; s=rubidium; t=1609857277; bh=PLsqswFef+SKwOTnq9DjYjwcxEewqQ0RHR8IOnhQt/E=; h=Cc:Subject:To:References:From:Date:In-Reply-To:From; b=NuXjhDULxHHB9re4LvD7BuuP+O7VhO9u4X8k9uPWTpdVMu32jGH1qaWfl5N4VukKz xTpeQhFGJx2s95nU5maOnFJBWteW8xt6a3RPCbZjLjn4hxvfFZCIfrwMPECdcOTSAb IEfpE2m61XfnYP7m7BjGf4Ws2h/xU7q7hxkdlFcEGVaTYdRqgLryZd96f5aiPIPFdQ zI3B9OcEies1/o9ZdUlg3/LW0JbNw08JC4iu6rt0Eq4fLKBLEJsOU0onPmprZDUS3/ eZ6dllv8UG6oB7436d3bcsXUEgRT2na2EXs64EsSsdSNl5xARFpsweIZmxvhJieftI fLh3jwQZ2gaSA==
Cc: magnus@rubidium.se
To: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>, "ntp@ietf.org" <ntp@ietf.org>
References: <20210101025440.ECE3340605C@ip-64-139-1-69.sjc.megapath.net> <20210104151813.GB2992437@localhost> <301BACA8-EFA2-4588-81B1-B39CD977298E@redfish-solutions.com> <89622453-292d-1a6d-3639-e653f446edb3@rubidium.se> <5FF41328020000A10003DF76@gwsmtp.uni-regensburg.de>
From: Magnus Danielson <magnus@rubidium.se>
Message-ID: <d1613db2-d4d9-cd1a-fe7f-00a16afa80f8@rubidium.se>
Date: Tue, 05 Jan 2021 15:34:36 +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: <5FF41328020000A10003DF76@gwsmtp.uni-regensburg.de>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/orEZpzs2xF2Bcx99BUjqv4QFYNg>
Subject: Re: [Ntp] Antw: [EXT] Re: 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 14:34:47 -0000

On 2021-01-05 08:20, Ulrich Windl wrote:
>>>> Magnus Danielson <magnus@rubidium.se> schrieb am 04.01.2021 um 19:00 in
> Nachricht <89622453-292d-1a6d-3639-e653f446edb3@rubidium.se>:
>> Philip,
>>
>> On 2021-01-04 18:40, Philip Prindeville wrote:
>>
>> While I agree that kernel very well could operate in some suitable TAI
>> format, and the PTP scale would be the low-hanging fruit for that, as it
>> intends to be that blend of TAI and classical UNIX/POSIX time_t.
>>
>> However, the only way I know with spreading in which TAI and UTC is
>> maintained is through the kernel interface provided by the NTP
>> nanokernel, and that is supported on effectively most Linuxes.
> Now that you mention it: I think it was also a bad design in NTPv4 to require
> a nanokernel to handle TAI: Instead of storing and reading the TAI in/from the
> kernel, the daemon should have a "working copy". The other bad thing was that
> TAI processing was tied to autokey protocol extensions.

Well, there is a long line of technical decisions spread over a long time.

For instance, the fact that the NTP time would mimic the time_t behavior
on leap seconds is one very clear case where a specific user behavior
was pushed onto the on the wire protocol.

Then, the original nanokernel interface was concerned with scheduling
issues and the state of time-stamp mechanisms available at that time. We
have since gained access to several additional time-stamp mechanisms
even in user-space, both running as counter on the bus-clock and
CPU-clock cycles, the later which may vary over time due to dynamic
cycle handling to avoid overheating.

Then, the notion that we want to also keep the TAI-UTC difference, and
that this would allow for a CLOCK_TAI in the first place. However, as
that was added, it was the TAI-UTC difference that was added to the
Autokey transport (but never really to the Autokey itself).

The pre TAI-UTC difference version of the nanokernel interface was for a
long time stuck in the glibc headers not being updated, despite the
linux kernel had the capability for it. Again illustrating how a
side-channel became problematic rather than a solution, which I keep
having to point out is an issue.

So, yeah, it became ugly for sure, but it was a consequence of history,
not because it was inherently bad. I think the proper lesson to learn is
to actually build for it from the start. Then if it is implemented in
the kernel or in libc for a particular operating system, well that I
think is not what the working ground should care about as such, but we
can discuss it. I think it is not inherently bad to keep both TAI and
UTC sense in the kernel, and I am much more keener to push out UTC in
that case than TAI. The low-hanging fruit for UNIX/Linux type operating
systems would be to use the PTP time definition, then you could move UTC
adaptation and classical time_t variants out of the kernel and only use
the new time_t internally. The needed things in libc would be fairly
trivial. A common way to access the TAI-UTC difference is however
needed, one could let the kernel take on that task only for practical
reasons, but really not process on them itself. That provides fairly
small burden, but then again, that would be an implementational detail
for the OS, that we can hide behind libc, as long as we can do the right
things and access it all the times. The overall requirements for such
interface contains a bit of details to know if we "have" things right
now and it's error handling, but not very complex. Using a form of
nanokernel interface to steer the rate of the system time, is probably
still a good idea, but I think reposition the problem will simplify it
significantly.

So, make sure to learn the right things from history.

Cheers,
Magnus