Re: [art] Predictable Internet Time

Nico Williams <nico@cryptonector.com> Wed, 29 March 2017 01:58 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: art@ietfa.amsl.com
Delivered-To: art@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 921D91295B3 for <art@ietfa.amsl.com>; Tue, 28 Mar 2017 18:58:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.795
X-Spam-Level:
X-Spam-Status: No, score=-4.795 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cryptonector.com
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 t8Bpc-AZedXr for <art@ietfa.amsl.com>; Tue, 28 Mar 2017 18:58:17 -0700 (PDT)
Received: from homiemail-a31.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B4DCE1273B1 for <art@ietf.org>; Tue, 28 Mar 2017 18:58:16 -0700 (PDT)
Received: from homiemail-a31.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a31.g.dreamhost.com (Postfix) with ESMTP id 22F8F1406B1A; Tue, 28 Mar 2017 18:58:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=cryptonector.com; bh=IkiJEAOjOyYoBg idm9ND9+ibnec=; b=TPDiZimvt/cdxgywQBqQ5iB55wNqSnkL+3OcdgKTMDcR6U wdQqWlol54SJGs/GhVoG5ypBcue9kfpFf5QK1e19Urk4P4CCtCR6Z6WnxOG9l90J 0RkTqTuGk4Y5hNyQs866wDbBRFun3CWPe+mBwDZpFTsiCx9qMuEqMxLwHqKTg=
Received: from localhost (cpe-70-123-158-140.austin.res.rr.com [70.123.158.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a31.g.dreamhost.com (Postfix) with ESMTPSA id D40401406B0A; Tue, 28 Mar 2017 18:58:14 -0700 (PDT)
Date: Tue, 28 Mar 2017 20:58:12 -0500
From: Nico Williams <nico@cryptonector.com>
To: Joe Touch <touch@isi.edu>
Cc: art@ietf.org
Message-ID: <20170329015811.GL7490@localhost>
References: <e0a43370-751f-808c-3719-9716f9cd57d1@isi.edu> <alpine.DEB.2.11.1701031348430.7102@grey.csi.cam.ac.uk> <f94415b6-d9f7-0a03-cf5b-ce39c109aa71@isi.edu> <f9429571-b9d5-75d4-9b46-b877a189a7bf@gmail.com> <20170328173916.GE7490@localhost> <e73d5c15-1ba3-8162-f7df-555e2e8588a6@isi.edu> <20170328224041.GJ7490@localhost> <9ddcde60-a915-a03d-dfc3-2c2c451c398c@isi.edu> <20170329000601.GK7490@localhost> <96ad09b7-7dc2-20e8-2aa4-793310d184f6@isi.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <96ad09b7-7dc2-20e8-2aa4-793310d184f6@isi.edu>
User-Agent: Mutt/1.5.24 (2015-08-30)
Archived-At: <https://mailarchive.ietf.org/arch/msg/art/tgnf11L5HLI3RpjVSN3OQlfrl5w>
Subject: Re: [art] Predictable Internet Time
X-BeenThere: art@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Applications and Real-Time Area Discussion <art.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/art>, <mailto:art-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/art/>
List-Post: <mailto:art@ietf.org>
List-Help: <mailto:art-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/art>, <mailto:art-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 29 Mar 2017 01:58:20 -0000

On Tue, Mar 28, 2017 at 05:15:58PM -0700, Joe Touch wrote:
> >> time_t does not access a SI reference or frankly any other stable reference.
> > The Open Group man pages I'm looking at don't reference SI, but so
> > bloody what.  If it says "seconds", it means "seconds".
> That's the trouble - seconds in SI are not seconds defined as 86400/day.
> If the units don't match,  then a conversion needs to be included. If
> the units aren't known, you can't convert accurately.

POSIX does NOT define seconds in terms of days!  It does the opposite:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16

    How any changes to the value of seconds since the Epoch are made to
    align to a desired relationship with the current actual time is
    implementation-defined. As represented in seconds since the Epoch,
    each and every day shall be accounted for by exactly 86400 seconds. 

There is NO reference to solar or sidereal days or any other
astronomical definition of day.

Unlike as with days, there is no multiplicity of generally accepted
definitions of seconds, so there is no support for the idea that this
text defines seconds in terms of days.

The second sentence defines days in terms of seconds, not the other way
around.

The first sentence is a bit abstruse, but no matter, because in
_practice_ on all systems I know of that claim to implement POSIX, or
which don't but which are Unix or Unix-like systems, seconds since the
epoch differs from UTC *only* by leap seconds -- just like TAI.

Also, POSIX does refer to UTC:

    A value that approximates the number of seconds that have elapsed
    since the Epoch. A Coordinated Universal Time name (specified in
    terms of seconds (tm_sec), minutes (tm_min), hours (tm_hour), days
    since January 1 of the year (tm_yday), and calendar year minus 1900
    (tm_year)) is related to a time represented as seconds since the
    Epoch, according to the expression below.

But as others have pointed out, that is either a lie or an error: POSIX
simply does not and cannot account for leap seconds in a numeric type
representing seconds since an epoch.  Perhaps we can say that the
reference to UTC was meant to be to TAI.  Either way the definition of
seconds can only plausibly be SI.

The text is sufficiently ambiguous (because of its errors, for example)
that you could remotely plausibly make these claims that you do, but
practice does not bear them out.

> > It's very safe to assume it's 1.  Anything else would be insane.
>
> s/insane/undefined/
> 
> That's the problem. I appreciate it would be nice if there were a
> definition (as a start), and if the defined unit were SI, but it isn't,
> AFAICT. If you have a ref to the contrary, I'd be more than glad to
> include it and correct the doc accordingly.

POSIX seconds are not defined, indeed, but they can only be taken to be
SI seconds -- anything else would be sheer madness and, anyways, not
supported by actual practice.  I know of no POSIX or POSIX-ish system
where this is not true.

Running code, _running code_.

> > Isn't that the important bit of information here?
> 
> To you and me, perhaps, but there are others on this thread that are
> misled by what POSIX is and how easy/hard it is to convert to TAI/UTC...

Maybe, but so are you.  Not that that is particularly important to
making a successful argument against smearing, but that such errors are
distracting.

The obvious argument against smeared time is that we already have _two_
time standards, and we don't need a third.  All we need is to carefully
pick one or the other in each specification, and preferably TAI time in
all cases.

Nico
--