Re: [Ntp] Antw: [EXT] Re: Timescales

Magnus Danielson <magnus@rubidium.se> Thu, 10 December 2020 00:23 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 A741E3A08D4 for <ntp@ietfa.amsl.com>; Wed, 9 Dec 2020 16:23:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level:
X-Spam-Status: No, score=-2.1 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.001, 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 J3HRWGU4w4yG for <ntp@ietfa.amsl.com>; Wed, 9 Dec 2020 16:23:47 -0800 (PST)
Received: from ste-pvt-msa1.bahnhof.se (ste-pvt-msa1.bahnhof.se [213.80.101.70]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1C1DB3A08C0 for <ntp@ietf.org>; Wed, 9 Dec 2020 16:23:44 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id 3C8A43FA44; Thu, 10 Dec 2020 01:23:42 +0100 (CET)
Authentication-Results: ste-pvt-msa1.bahnhof.se; dkim=pass (2048-bit key; unprotected) header.d=rubidium.se header.i=@rubidium.se header.b=OvavK6zW; dkim-atps=neutral
X-Virus-Scanned: Debian amavisd-new at bahnhof.se
Received: from ste-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (ste-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CCnbeMA7Rdc6; Thu, 10 Dec 2020 01:23:40 +0100 (CET)
Received: by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 9125C3F29E; Thu, 10 Dec 2020 01:23:40 +0100 (CET)
Received: from machine.local (unknown [192.168.0.15]) by magda-gw (Postfix) with ESMTPSA id 101969A0520; Thu, 10 Dec 2020 01:23:40 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rubidium.se; s=rubidium; t=1607559820; bh=D8xXc8+DegFfB7hl5TAeT2bKbFu7VLMD6JbYbZ4f13I=; h=Cc:Subject:To:References:From:Date:In-Reply-To:From; b=OvavK6zWKUPj0QD+fJ67lUxFPS9UADe25Y0TCPUCVPJ8HrYqdolDc1dk0ftco2L0K GJlLFaqhLcXY6joQdC5wtytrqFTYO2CBWNWYWucNL1LEL8OVGh/RUj8xuJ34oXzpiV fIuGlSrbpAFfEFZxyUZhF37Pcn+0zfagA0Spso/1/6pHP1/leKeI/zo19POU0aWY+c OuXwibbgZ+DW79aLh2THAN6JXAh4JDUfy+OGy/ZttJDLLaTnTGKXjgNDKvZofBFSo2 T3M3PpEiQFNAtJojzvi+wFl+GD+35NgGholwOY4IRPWNgYmVQDW08TGBEnFPMH/alZ u/isRdesheBsA==
Cc: magnus@rubidium.se
To: Martin Burnicki <martin.burnicki@meinberg.de>, ntp@ietf.org
References: <20201209190210.2408740605C@ip-64-139-1-69.sjc.megapath.net> <ae748c46-a180-1741-c082-4087d21f2995@rubidium.se> <7e4d57da-02ba-723c-58f5-ca1243a51710@meinberg.de>
From: Magnus Danielson <magnus@rubidium.se>
Message-ID: <cec1f5a5-c751-7d30-909b-26f43983db32@rubidium.se>
Date: Thu, 10 Dec 2020 01:23:39 +0100
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Thunderbird/78.5.1
MIME-Version: 1.0
In-Reply-To: <7e4d57da-02ba-723c-58f5-ca1243a51710@meinberg.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/1ISz5Z9aKLzxtP6c2Ru-J5wf-u8>
Subject: Re: [Ntp] Antw: [EXT] Re: Timescales
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: Thu, 10 Dec 2020 00:23:51 -0000

Martin,

On 2020-12-10 00:10, Martin Burnicki wrote:
> Magnus Danielson wrote:
>> Hal,
>>
>> On 2020-12-09 20:02, Hal Murray wrote:
>>> mlichvar@redhat.com said:
>>>> Most computers work primarily in UTC.
>>> Most computers work on POSIX pseudo UTC time.
>>> (which is why we have this leap-second mess)
>> Most computers use one of two interpretations of POSIX Time.
>>
>> One variant of UTC to POSIX time_t mapping was provided for a while, but
>> later removed from the POSIX documentation, mapping 23:59:60Z into
>> 00:00:00, which is what you expect from (omitting date)
>>
>> time_t = hours*3600 + min*60 + sec
>>
>> and as this is re-interpreted as print-out time
>>
>> sec = time_t % 60
>> min = (time_t / 60) % 60
>> hour = (time_t / 3600) % 24
>>
>> reads out as 00:00:00, which next section also labelled 00:00:00. This
>> behavior is mimiced by the NTP time-scale for at NTPv3 and NTPv4 as I
>> recall it.
> The problem is that there is no status flag. For example, if you read a
> POSIX-like timestamp from a Meinberg PCI card, there are API calls that
> also include a status word, and while one of the status bits tells that
> a leap second is approaching, another bit tells that the current second
> is a leap second, so you can properly solve the ambiguity if you
> evaluate the status flag.

Agreed. This is why I think one should look at other interfaces to get
the time, such that sufficient information is available. If you use
ntp_gettime() for instance you get considerable more meta-data. Also,
you can get time-stamps in CLOCK_TAI for instance for some OSes.

In general, I think we should make people aware of such solutions, make
sure they functions and promote their proliferation.

Cheers,
Magnus