Re: [Ntp] Frequency transfer in NTP

Miroslav Lichvar <mlichvar@redhat.com> Mon, 01 February 2021 15:19 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 36DE53A120A for <ntp@ietfa.amsl.com>; Mon, 1 Feb 2021 07:19:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.37
X-Spam-Level:
X-Spam-Status: No, score=-2.37 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 rIu3_j3tJc8E for <ntp@ietfa.amsl.com>; Mon, 1 Feb 2021 07:19:37 -0800 (PST)
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4F8CC3A1208 for <ntp@ietf.org>; Mon, 1 Feb 2021 07:19:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612192776; 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=yESxoLkYvykvc1i+DVolcMRvUkWMU7144jLri7bUHUc=; b=LwLPCZVYDGiKi35LYf/Q5eBvwAbaUiS5lMhFg89V2liQSRmifL8kMz8WOKRAWxM+M32D6w mIwA9nIGaIQqaXS3N0RAJwNIttHQ+yfktuJD/5AkGQ3uKC3QFVuDsz6UxclHB8buv8DNSY wvPown9L8eFnVWDVYl86zv5m5mvDUrk=
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-147-KHZ2d_kIOIyGvy_PZXxObw-1; Mon, 01 Feb 2021 10:19:34 -0500
X-MC-Unique: KHZ2d_kIOIyGvy_PZXxObw-1
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CDC510151EB; Mon, 1 Feb 2021 15:19:33 +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 AFF905C23D; Mon, 1 Feb 2021 15:19:31 +0000 (UTC)
Date: Mon, 01 Feb 2021 16:19:29 +0100
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Magnus Danielson <magnus@rubidium.se>
Cc: ntp@ietf.org
Message-ID: <20210201151929.GJ1205378@localhost>
References: <20210128143137.GA1205378@localhost> <f60202de-d53f-4dea-6e2b-d59dbb0e1143@rubidium.se> <20210201093709.GF1205378@localhost> <a22737e3-05d0-e681-e32f-daada351e51c@rubidium.se> <20210201113856.GI1205378@localhost> <ea775bc0-25dc-5821-3231-00c013f8a39b@rubidium.se>
MIME-Version: 1.0
In-Reply-To: <ea775bc0-25dc-5821-3231-00c013f8a39b@rubidium.se>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16
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="us-ascii"
Content-Disposition: inline
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/plSFJo72I9k-IA_PnjhNi6eKwpQ>
Subject: Re: [Ntp] Frequency transfer in NTP
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, 01 Feb 2021 15:19:39 -0000

On Mon, Feb 01, 2021 at 01:18:15PM +0100, Magnus Danielson wrote:
> On 2021-02-01 12:38, Miroslav Lichvar wrote:
> > I'd like to see an example of a loop (it doesn't have to be PI) that
> > performs similarly or better than an implementation using the proposed
> > frequency transfer. I don't think that is possible. You say it is, so
> > an example would be a good way to show that.
> 
> Let me see if I can whip up a little simulator for you then. I've done
> that before and made it match up with the reality just nicely.

That would be great.

> Also, what you show is transient behavior, not long-term errors, not the
> usual measure of stability. You need to do that. My experience is that
> transient behaviors needs to be taken way down, and first things to fix
> is damping.

I think the response to a large time/frequency step indicates how well
it will perform in a chain. You can scale it down to any numbers you
like. In normal operation there are smaller offsets, but the response
is identical in proportion. It's a series of responses that add up,
together with the frequency errors coming from the clock drift and
measurement noise due to network jitter.

As for long term errors, I have some data for chrony:

st	no-freq		freq
2	11.7		12.0
3	18.1		15.4
4	24.7		17.2
5	30.1		20.7
6	40.1		22.5
7	50.4		25.9
8	64.2		26.9
9	77.1		29.0
10	91.7		31.4

It is the RMS offset (in microseconds) at different strata of the
chain. As you can see, the error grows much faster without frequency
transfer. At stratum 10 it's already 3x better.

If I slowed down the loop as you suggest, the error would not grow as
quickly, but it would start at a larger value.

> > Just post the code of the loop. In any language you like. I can
> > integrate it with NTP and compare it with the existing
> > implementations.
> >
> Notice that no "code" will just work as you drop it in. The gain factors
> needs to be corrected for any implementation. Building code to tune that
> is more or less painful depending on the implementation. Things needs to
> be normalized and parametrized for this to have a chance of working. I
> don't have time to make it fool proof.

Ok, just specify the conditions. A simulation is fine. To show the
impact of independent frequency transfer, I'm mostly interested in the
case where frequency errors dominate noise in measurements, i.e. when
the Allan intercept is too short for the polling interval. Let's say a
polling interval of 64 seconds, a network jitter of 10 microseconds
and a random walk of 1 ppb/s for the clock?

-- 
Miroslav Lichvar