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

Magnus Danielson <magnus@rubidium.se> Tue, 05 January 2021 14:11 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 613523A0EDA for <ntp@ietfa.amsl.com>; Tue, 5 Jan 2021 06:11:08 -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 VYGtPCYrqimV for <ntp@ietfa.amsl.com>; Tue, 5 Jan 2021 06:11:04 -0800 (PST)
Received: from pio-pvt-msa2.bahnhof.se (pio-pvt-msa2.bahnhof.se [79.136.2.41]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 093043A0D78 for <ntp@ietf.org>; Tue, 5 Jan 2021 06:11:02 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 199BD3F449; Tue, 5 Jan 2021 15:11:00 +0100 (CET)
Authentication-Results: pio-pvt-msa2.bahnhof.se; dkim=pass (2048-bit key; unprotected) header.d=rubidium.se header.i=@rubidium.se header.b=H3X+jN1s; dkim-atps=neutral
X-Virus-Scanned: Debian amavisd-new at bahnhof.se
Received: from pio-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Iq6P0uwCK5QW; Tue, 5 Jan 2021 15:10:58 +0100 (CET)
Received: by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id AFAF03F448; Tue, 5 Jan 2021 15:10:58 +0100 (CET)
Received: from machine.local (unknown [192.168.0.15]) by magda-gw (Postfix) with ESMTPSA id 02EF89A0078; Tue, 5 Jan 2021 15:10:57 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rubidium.se; s=rubidium; t=1609855858; bh=gaPUnHV41hu7tabhNFDX4uAFxy7VfeKzcgHcDKvl4Xg=; h=Cc:Subject:To:References:From:Date:In-Reply-To:From; b=H3X+jN1s720+2JKZ27mN02z+7qwG/zHt4DM32F3vhBlKeMBGI3sI5Ayjq8Tzs2ElZ 7QvL1QsDYJ7bBlSOdEmzlKfgdMlWqqZ+Aw/O1kmcD41EnWCm4L5Ait+mrRPAzy9xLz CEMRhTJ6VfZcZrXYVU3c2DYDGv3t7YFutbltjsTOvwttKdmnQDJEx3RBBPTXk3+78r xkzxFzKdRtIrUaEoWN+8ybyQnPfAQgrrlZ7MlGNcde11qquOAgZJ7E5abI0CJwn9Q8 RtYsUtTsKG21w6+D+0n9Z5nwhA8iOcMFUAHbezh0spIbsWu8FPJqKmo8WyCrCHpkIA gHDlI74K8zTEA==
Cc: magnus@rubidium.se, ntp@ietf.org
To: Miroslav Lichvar <mlichvar@redhat.com>
References: <20210102081603.1F63C40605C@ip-64-139-1-69.sjc.megapath.net> <cecaf661-92af-8b35-4c53-2f025c928144@rubidium.se> <20210104164449.GE2992437@localhost> <b1e61f7d-6cea-5e99-69f0-7eae815d9e19@rubidium.se> <20210105083328.GA3008666@localhost>
From: Magnus Danielson <magnus@rubidium.se>
Message-ID: <ba5d2cde-6b5e-d9b6-1877-c4060bf43e80@rubidium.se>
Date: Tue, 05 Jan 2021 15:10:55 +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: <20210105083328.GA3008666@localhost>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/SBKeWEb46ha3kAmeQoP2IhNJhuQ>
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 14:11:08 -0000

On 2021-01-05 09:33, Miroslav Lichvar wrote:
> On Mon, Jan 04, 2021 at 06:48:16PM +0100, Magnus Danielson wrote:
>>> The Linux system TAI clock can be read by applications, but there is
>>> no support for timestamping of packets with this clock, i.e. it is
>>> currently not useful for NTP.
>> The hardware time-stamping support will support PTP-timescale, which has
>> a know relationship to TAI. With whatever relationship there will be
>> between NTPv5 transport time-scale and TAI, the PTP relationship will
>> also be known and thus can be used.
> With hardware timestamping there is a separate (hardware) clock used
> for timestamping. It's not related to the CLOCK_TAI system clock
> discussed here.
So, you are saying that the kernel sense of TAI is not used to control
the time of the hardware clock? Fine, but some driver is doing that,
because the hardware clock of a typical is very stupid and is controlled
even with simpler forms than that for which the kernel clock is steered
by NTPD over the nanokernel interface.
>  I assume we don't want NTPv5 to require a hardware
> clock.
While we do not want to require it, we also do not want to exclude it
either. When it is there, the implementation should be able to use it.
> NTP is used for synchronization of various clocks. Most of them are
> based on UTC. NTPv5 cannot support only TAI.

I agree that NTPv5 cannot support only TAI.

However, there comes the first challenge, do the core time-stamp format
be that of a single format or of any timescale format. I think we agree
that formats having the POSIX, Linux and NTPv4 type of leap-second jumps
is to be avoided. OK, so we want something more continuous and then
concluding some variant of TAI-like property, similar to that of PTP is
useful, not at all saying or suggesting it needs to be the PTP one.

Second challenge, if we have a TAI-like core format, and we indeed can
rebuild a TAI replica, and we do not consider this enough, would a TAI
format allows us to fairly cheaply adapt that to other formats? Turns
out that this comes very cheap and is easy to do robust, if and only if,
one has access to the TAI-UTC difference and information about an
upcoming one as that eventually approaches.

Will that satisfy all needs? Maybe not. OK, but will this provide a
vehicle for more variants. Seems likely if we have a standard way of
augmenting the core timing with additional parameters and users add the
mapping.

Sure, I am advocating for a particular part of the solution space. But I
think it is doable without any of the parts becoming cumbersomely
complex to test and verify. An example is how PTP has extension fields
extended by SMPTE 2059-2 and the various output mappings documented
separately in SMPTE 2059-1 to show how the transported parameters
generate all the legacy timing things. SMPTE 2110-10 then extends SMPTE
2059-2 and 2059-1 for the application within the SMPTE 2110 transport
protocols and timing model of media used there. Anyway, I think it is a
fair model that seems to work.

Cheers,
Magnus