Re: [Ntp] Antw: [EXT] Minutes from IETF 108 NTP WG session

Miroslav Lichvar <mlichvar@redhat.com> Mon, 03 August 2020 10:36 UTC

Return-Path: <mlichvar@redhat.com>
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 A77643A0DFE for <ntp@ietfa.amsl.com>; Mon, 3 Aug 2020 03:36:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.201
X-Spam-Level:
X-Spam-Status: No, score=-0.201 tagged_above=-999 required=5 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.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 1BOhOcO4x1Bk for <ntp@ietfa.amsl.com>; Mon, 3 Aug 2020 03:36:25 -0700 (PDT)
Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6DF213A0DFB for <ntp@ietf.org>; Mon, 3 Aug 2020 03:36:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596450984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Oy3hRSTdy2LSEPlGWHKW0ONwGn9O9S4r7guXuY4wz4=; b=ip9TiYMrh/OMgqE++CfqiDJMINidJ6Lhdlhkg7yfvF2/UGOzIWxb221h+hbRKB7E7v3Vh0 c+DW1Z+3RcqHWjHvYSCPIahDE40h7mwlO1mqtFT5tccoYb3WUIQRWR80udXNNbU2hDdrHp 91rSCcaaEbbeCZINuM5Upm0W+X/MiaU=
Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-94-aXYiqAClMxK40Zm35LHcww-1; Mon, 03 Aug 2020 06:36:22 -0400
X-MC-Unique: aXYiqAClMxK40Zm35LHcww-1
Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7CF0F59 for <ntp@ietf.org>; Mon, 3 Aug 2020 10:36:21 +0000 (UTC)
Received: from localhost (holly.tpb.lab.eng.brq.redhat.com [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 046C18A191 for <ntp@ietf.org>; Mon, 3 Aug 2020 10:36:19 +0000 (UTC)
Date: Mon, 03 Aug 2020 12:36:18 +0200
From: Miroslav Lichvar <mlichvar@redhat.com>
To: ntp@ietf.org
Message-ID: <20200803103618.GK762467@localhost>
References: <16876866-D4DB-4941-A533-B92BCFFF60F3@gmail.com> <5F27ABE4020000A10003A63F@gwsmtp.uni-regensburg.de>
MIME-Version: 1.0
In-Reply-To: <5F27ABE4020000A10003A63F@gwsmtp.uni-regensburg.de>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13
Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mlichvar@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/3ZVPNqG2g1dTW0NGbw2jWqN0oAg>
Subject: Re: [Ntp] Antw: [EXT] Minutes from IETF 108 NTP WG session
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: Mon, 03 Aug 2020 10:36:27 -0000

On Mon, Aug 03, 2020 at 08:17:08AM +0200, Ulrich Windl wrote:
> "It turns out that for trades a nanosecond resolution matters."
> 
> I wonder what's really behind that claim: Reading the current system time on a
> current Linux server yields in about 1µs precision (independent from how the
> clock is synchronized).

On modern computers running Linux, at least for the last decade, the
time it takes to read the system clock is usually less than 50
nanoseconds. I have not seen a sub-10ns clock yet. That's still an
order of magnitude to get into the sub-nanosecond range. Even if the
CPU was so fast that it could read and convert the TSC counter in less
than a nanosecond, there is no POSIX API to return the timestamp in a
sub-nanosecond resolution.

I guess for hardware clocks (e.g. NICs that support hardware
timestamping) a sub-nanosecond resolution might be needed sooner than
for the system clock.

NTP has a 1/4ns resolution. For the White Rabbit that might not be
good enough. For synchronizing ordinary computers (in financial
industry or other) I think that will be sufficient for quite some
time. In any case, a correction extension field (which will need to be
supported in switches/routers in order to get a sub-nanosecond
accuracy) can have a better resolution than the timestamps in the NTP
header.

> So before claiming that financial industry needs sub-nanosecond resolution,
> I'd like to see hard facts and details.

FWIW, I have not heard anyone asking for a sub-nanosecond resolution
yet. The accuracy of the clock is a bigger issue.

> The other thing is: How small would the stability of the clock have to be to
> make any sub-nanosecond resolution be realistic? 0.001 PPM?
> Real "normal" servers will probably have 1 PPM, and a "certified chronograph"
> will allow around 50 PPM (AFAIK)...

For sub-nanosecond stability with an ordinary computer clock, the
update interval would need to very short, e.g. few milliseconds.

In a test I did with two directly connected idle computers and a
polling interval of -6 (using the interleaved mode), the reported
stability was just a few nanoseconds. With a shorter interval it might
be possible to get it under 1 nanosecond, but I'm not sure what would
be the point when the precision and accuracy of the clock is in tens
nanoseconds at best.

-- 
Miroslav Lichvar