Re: [Ntp] Antw: [EXT] Timescales, leapseconds and smearing

Kurt Roeckx <kurt@roeckx.be> Tue, 08 December 2020 20:07 UTC

Return-Path: <kurt@roeckx.be>
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 C7DA83A1121 for <ntp@ietfa.amsl.com>; Tue, 8 Dec 2020 12:07:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=unavailable autolearn_force=no
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 9fJYhJdLGDmZ for <ntp@ietfa.amsl.com>; Tue, 8 Dec 2020 12:07:50 -0800 (PST)
Received: from excelsior.roeckx.be (excelsior.roeckx.be [IPv6:2a05:7300:0:100::3]) (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 E90D13A10BD for <ntp@ietf.org>; Tue, 8 Dec 2020 12:07:49 -0800 (PST)
Received: from intrepid.roeckx.be (localhost [127.0.0.1]) by excelsior.roeckx.be (Postfix) with ESMTP id C2A74A8A0117; Tue, 8 Dec 2020 20:07:46 +0000 (UTC)
Received: by intrepid.roeckx.be (Postfix, from userid 1000) id 8E8FE1FE0DE5; Tue, 8 Dec 2020 21:07:46 +0100 (CET)
Date: Tue, 08 Dec 2020 21:07:46 +0100
From: Kurt Roeckx <kurt@roeckx.be>
To: Martin Burnicki <martin.burnicki=40meinberg.de@dmarc.ietf.org>
Cc: Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>, "ntp@ietf.org" <ntp@ietf.org>
Message-ID: <X8/dEqlUaYnPih1A@roeckx.be>
References: <X86sVykHUqlkXP96@roeckx.be> <5FCF4DC8020000A10003D5FB@gwsmtp.uni-regensburg.de> <X89eBhhdUDijLVpL@roeckx.be> <c73d4c57-5cb8-4e5e-e786-391c50b8d368@meinberg.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <c73d4c57-5cb8-4e5e-e786-391c50b8d368@meinberg.de>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/8tU_lb4bumCG51Ajkws4FhNWwkI>
Subject: Re: [Ntp] Antw: [EXT] Timescales, leapseconds and smearing
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, 08 Dec 2020 20:07:52 -0000

On Tue, Dec 08, 2020 at 07:31:16PM +0100, Martin Burnicki wrote:
> > The linux kernel has support for TAI. You can set a TAI offset, so
> > that applications making use of the POSIX API still get the POSIX
> > time. The clock_gettime() function you mentioned has TAI support.
> > The information to convert from TAI to UTC is available, so it's
> > possible to work in TAI or UTC on Linux, it's just that most
> > applications don't.
> 
> But in any case you first need to have a trusted source for the TAI
> offset, so some program can send it down to the kernel.
> 
> By the way, if you start a Linux kernel and the TAI offset has not been
> set by some program, the kernel reports TAI offset 0.
> 
> However, when the kernel receives a leap second warning from an NTP or
> PTP daemon, and it inserts a leap second, the kernel increments its TAI
> offset when the leap second is inserted.
> 
> To the kernel reports TAI offset 1 after it has observed a leap second,
> which is obviously wrong, but it shows that you can't simply check if
> the TAI offset is 0 if you need to know if the kernel knows the real TAI
> offset.

If you want to work in UTC, yes you need a trusted source of the
offsets. Assuming you do have that, you can check that the kernel
has it set correctly. If it's not correct, there are some options,
for example setting it if you have permissions, switching to POSIX
time, or returning an error.

We seem to be getting a little of topic.


Kurt