Re: [Ntp] Hard NO: Re: WGLC - draft-ietf-ntp-ntpv5-requirements

Miroslav Lichvar <mlichvar@redhat.com> Wed, 03 January 2024 10:03 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 21B38C05DDFB for <ntp@ietfa.amsl.com>; Wed, 3 Jan 2024 02:03:42 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.106
X-Spam-Level:
X-Spam-Status: No, score=-2.106 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01] 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 ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tPvCz29cqit0 for <ntp@ietfa.amsl.com>; Wed, 3 Jan 2024 02:03:41 -0800 (PST)
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7B0ACC05E026 for <ntp@ietf.org>; Wed, 3 Jan 2024 02:03:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704276220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Hqhe1rA7mDCug0wWKVnD3iu/jDV3ROzheKoUZhSHRyw=; b=Qttmc4tFsngYOINPEROkve0JxILUmQls55ISOUIHOXDsuMu9Q9mfvxfzS8nDAWkizrS1xr tS++7smdK27M/TdHIxs+RRU9t2HTE7j5bzr3Ku7c2VOUtuVr9q1khRypa7/PraGEmjXhzX flaBSYDwy3q2wZ6N5LgPKl0kkWxl1Q4=
Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-30-Bk21dbpEPfCTsiGxcbhHcQ-1; Wed, 03 Jan 2024 05:03:37 -0500
X-MC-Unique: Bk21dbpEPfCTsiGxcbhHcQ-1
Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 72AE029AC033; Wed, 3 Jan 2024 10:03:36 +0000 (UTC)
Received: from localhost (unknown [10.43.135.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6072D1121306; Wed, 3 Jan 2024 10:03:35 +0000 (UTC)
Date: Wed, 03 Jan 2024 11:03:36 +0100
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Dave Hart <davehart@gmail.com>
Cc: Harlan Stenn <stenn@nwtime.org>, James <james.ietf@gmail.com>, Steven Sommars <stevesommarsntp@gmail.com>, Karen ODonoghue <kodonog@pobox.com>, ntp@ietf.org
Message-ID: <ZZUw-HNP645F2QJn@localhost>
References: <CA+mgmiMFLDRggrBUzdJyjhgbM6q0m8nY8PUoU5oxbR2HtZh51A@mail.gmail.com> <CAD4huA4+5R+tVQJQRFwR6vXuO0FZbtgTZwJeTfDjTVDaT4AwJg@mail.gmail.com> <2AEB577B-AEC3-4414-B8B7-9BA7382F3F54@gmail.com> <2f4226a3-484a-4f44-bd1b-758d648a30cd@nwtime.org> <ZXs4h46SERybNw_t@localhost> <CAMbSiYDeP9BObzQS+A2xKk5wN3LiW_zQ4S+D_d9WwhYyrq9Mkg@mail.gmail.com>
MIME-Version: 1.0
In-Reply-To: <CAMbSiYDeP9BObzQS+A2xKk5wN3LiW_zQ4S+D_d9WwhYyrq9Mkg@mail.gmail.com>
X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/9AE7NEU1yrSPADN_TQFyMNugWzs>
Subject: Re: [Ntp] Hard NO: Re: WGLC - draft-ietf-ntp-ntpv5-requirements
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Network Time Protocol <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: Wed, 03 Jan 2024 10:03:42 -0000

On Tue, Dec 26, 2023 at 11:23:25PM +0000, Dave Hart wrote:
> On Thu, 14 Dec 2023 at 17:18, Miroslav Lichvar <mlichvar@redhat.com> wrote:
> > If the RFC 5905 PLL+FLL is so great, why is nothing using it, not even
> > the "reference" implementation in default configuration?
> >
> 
> Would you mind elaborating how the reference implementation's PLL+FLL
> feedback loop differs from the NTPv4 spec?

The FLL frequency adjustment is calculated differently than in RFC
5905 (A.5.5.6 - local_clock). It's different in the Linux and FreeBSD
kernels (following the nanokernel implementation by David Mills) and
it's different in the "daemon loop" in ntpd. I remember David Mills
saying that the kernel and daemon loops are supposed to be different,
but neither seems to match RFC 5905.

Their responses are different from what I saw presented as designed
(e.g. in the "book"). There is significant gain peaking, which
impacts synchronization in longer chains.

If you want to see it in your own test:
- configure four hosts in local network
  - A running free (local driver or orphan mode)
  - B synchronized to A using default minpoll and maxpoll
  - C synchronized to B using default minpoll and maxpoll
  - D synchronized to C using default minpoll and maxpoll
- configure B, C, D to also poll A at minpoll and maxpoll of 3 with
  the noselect option
- let it settle down and reach the maximum poll (at least 10 hours)
- make a 10 ms step on A (e.g. date -s '-0.01 sec' on Linux)
- let it run for 40 hours
- plot the offsets measured by B, C, D against A

You should see the peaks getting significantly larger with increasing
stratum and possibly also some oscillations growing in time, but there
is some luck required.

> If verified that would seem to me a reason to improve the algorithms,
> rather than decide it's time for a wild west where every NTP implementation
> is free to behave in any way, as that would invite pathological results in
> situations where differing implementations sit on the synchronization path
> between the reference clock and the ultimate client.

There is no algorithm that can work optimally in all conditions. The
server doesn't know how many clients it has at different strata, how
stable are their clocks and in what network conditions they operate,
to even be able to consider optimizing its response for a subset of
its clients.

You can improve ntpd to work better in the conditions you consider
important, but please don't try to force your solution on others.
They likely have very different requirements.

> > Nobody seems to care. Maybe
> > it's a bug, but after so many years I think we can conclude that
> > Internet will not break if all NTP implementations don't have the
> > "well defined" response.
> >
> 
> The internet will not break even if all NTP sources were only good to a few
> seconds.  Those who require tight sync (such as distributed databases)
> engineer solutions to meet their requirements.

Ok, so you seem to agree that using one set of algorithms is not
critical for synchronization over the Internet between different
implementations.

The point I was trying to make is that ntpd without the "well defined
response" of RFC 5905 apparently worked well enough for many years
that its maintainers and users didn't notice any problems, which I
think confirms that it is not that important that it would have to be
prescribed in the NTPv5 spec.

-- 
Miroslav Lichvar