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

Magnus Danielson <magnus@rubidium.se> Tue, 05 January 2021 15:14 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 AD7263A0FE7 for <ntp@ietfa.amsl.com>; Tue, 5 Jan 2021 07:14:54 -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 YgpUt8mqIGrK for <ntp@ietfa.amsl.com>; Tue, 5 Jan 2021 07:14:52 -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 E00DE3A0FDE for <ntp@ietf.org>; Tue, 5 Jan 2021 07:14:51 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 3FD993F433; Tue, 5 Jan 2021 16:14:34 +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=oYIzc9ZH; 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 lD_LOVq_mXGT; Tue, 5 Jan 2021 16:14:32 +0100 (CET)
Received: by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id 7B2653F363; Tue, 5 Jan 2021 16:14:31 +0100 (CET)
Received: from machine.local (unknown [192.168.0.15]) by magda-gw (Postfix) with ESMTPSA id B9AE19A00A7; Tue, 5 Jan 2021 16:14:45 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rubidium.se; s=rubidium; t=1609859685; bh=fmObygS1RSCnhc6ANgFiqGL+7rnJG6B29U/dozmsHfg=; h=Cc:Subject:To:References:From:Date:In-Reply-To:From; b=oYIzc9ZHShvx87US4NP42lGUoEoOMMnl4R0Jkd+Nddm3eS0YWKNhbypoLyWqd6wvo eXjtVvhYvswMPjzZWKZLKiZnEJbqvD5bi/0EBD+cP9RvC0iRtQGgV0LI4nH3PrKua0 oNwnw6H151liWX0LZS17dfrw8XgB+WNp+ZHF+QCtQyY/AmH1mV1ZCHgX7PSF6EI9LQ BkUujNFDlrKXRi79V65PF1QRNFKKnHkhXcfW2fJjZ7dAI310Oqv1sPDsBHzTfQyLw1 HSulSpNgD+TR6qIxYhwqbXL7S/R0kEeNVKQtVRmg0e/LiD+j3bqphLYbeokPr3RD1+ uDsTbwRz87H/g==
Cc: magnus@rubidium.se, ntp@ietf.org
To: Hal Murray <hmurray@megapathdsl.net>, Miroslav Lichvar <mlichvar@redhat.com>
References: <20210105124544.5EF5C40605C@ip-64-139-1-69.sjc.megapath.net>
From: Magnus Danielson <magnus@rubidium.se>
Message-ID: <c7f63c1f-5d41-9f73-f96a-82c480c32cc7@rubidium.se>
Date: Tue, 05 Jan 2021 16:14:45 +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: <20210105124544.5EF5C40605C@ip-64-139-1-69.sjc.megapath.net>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/oFavzfE4XG_qhU3pExh9g1x736w>
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 15:14:55 -0000

Hal,

On 2021-01-05 13:45, Hal Murray wrote:
> mlichvar@redhat.com said:
>> NTP is used for synchronization of various clocks. Most of them are based on
>> UTC. NTPv5 cannot support only TAI. 
> This is a tangled area.
>
> I think that a TAI only NTPv5 protocol would be much cleaner and easier to 
> document.  Yes, I agree that we need a story for UTC, but the answer doesn't 
> have to clutter up an RFC for NTPv5.

Look at the SMPTE 2059-1 and SMPTE 2059-2 solution for instance. 2059-1
provides the detailed mapping mechanisms for all various formats. 2059-2
augments the IEEE1588-2008 with fields to carry the necessary
information. so that the set of gears in 2059-1 will work.

So, you can keep one RFC with a TAI-based (but not actual TAI) NTPv5
protocol. Then another RFC providing the mapping mechanisms and
extension fields for them. If then the extension is carried in the NTP
core protocol, an extension data variant of NTP that also gets
transported through is then another separate issue. There is no secret
that I lean towards one that follows the overall distribution of time
itself, at least for most part (I know it sounds confusing, but it's a
separate point).

>
> All the kernel and/or libc need to convert TAI to/from UTC is the TAI-UTC 
> offset (a small integer) and the date of the next leap second, a flag for 
> insert/delete/none, and the valid-until date of the info.
Yes. Actually, you do not need a flag to indicate insert/delete/none.
You can do with something to indicate upcoming leap-second event, and
then the encoding of that event will include information of when the
event occurs and the resulting difference. The flag should not
necessarily indicate direction, that's a specific encoding from history
that we may choose to ignore.
>
> We could provide that data in an extension.  The same extension would allow a 
> NTPv4 server to provide clients with enough info to let current UTC based 
> kernels provide TAI and/or leap when appropriate.
They are not really UTC based kernels. Some of them is however also able
to do UTC, but most have the POSIX or Linux time_t, which isn't UTC. We
can let libc provide the historic time_t in implementations.
> We could provide that data in a new protocol.  Or a new packet type on the NTP 
> port.  Or via DNS.

If one looks at PTP for instance, it has an "event interface" and a
"general interface". The event interface is the only packets that
experience time stamping, where as the general interface does not. The
type of data we describe here would fit what goes on the general
interface rather than the event interface. I think it's a good model.
See Figure 2 in IEEE 1588-2008.

I have also already made the point that management related data, which
have been discussed as potential DDOS tool, do not even have to be
carried on what looks like NTP. Thus, it may not need to be limited to
UDP but could use the TCP stack of solutions. That would for sure not be
event interface, but general interface.

> An extension would piggyback on whatever we use to authenticate NTPv5.  DNSSEC 
> would authenticate the DNS approach.
>
> If we implement this on the network, we should be sure to emphasize that the 
> data only changes every 6 months and that we expect clients to remember the 
> answer rather than ask every time.

No. It still can change every month. It's just a preference to change on
the end of each half year, and that preference have been honored so far.
However, I've seen bugs show up because of interpreting things
incorrectly. Whatever mechanism is being used, it needs to respect the
underlying capability of inserting leap seconds at the end of every UTC
month, and it also needs the ability to indicate that when an upcoming
leap second shift is to occur, it needs to be able to indicate when that
shift occurs and what the new value will be. The exact encoding of that
can then differ naturally, but it needs to unambigously convey the same
information as I stated.

> We could provide code that lets systems process leap-seconds.list
> ntpd already does.
> A copy of the leap seconds file is included by the Time Zone project and 
> distributed by IANA.  Most distros are already setup to keep the time zone 
> info up to date.  It should be simple for the leap file to go along for the 
> ride.  Debian already does it.
>
A curious note there thought. It uses the older NTPv4 time of timestamp
format. It will be less well adapted to a new TAI-based NTPv5 timestamp
format. It may actually be wise to revise that and eventually to
unentangle it, as it has historical limits to it. The way that NTPv4
time-stamps work, you kind of need the table, but if you use a TAI-base,
you only need the current TAI-UTC offset and potentially the future. You
do not need the history. The leap-seconds.list is another form of
artifact that is not without it's issues. Even the comments in them can
be somewhat confusing if read outside of the NTPv4 context.

Cheers,
Magnus