Re: [Ntp] Frequency transfer in NTP

Miroslav Lichvar <mlichvar@redhat.com> Mon, 01 February 2021 09:37 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 BF3173A0C84 for <ntp@ietfa.amsl.com>; Mon, 1 Feb 2021 01:37:18 -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 nHt_XRIIo95D for <ntp@ietfa.amsl.com>; Mon, 1 Feb 2021 01:37:17 -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 223943A0C81 for <ntp@ietf.org>; Mon, 1 Feb 2021 01:37:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612172236; 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=3cb7ImJqXZH1agGnPY4yDkancaU1REknUr6gksSJ680=; b=hghspXXoCWaDxiQ+XtxI7m/wVLOYTkyadNn1BVmgHEHyI8dzNE/v8cJ0mv8ZbIamePhkNi mWJSRGBSeaFtaV5v1+f1F8yE+y/kuTFgBl9bebH/rqgC/aYZGlA+fFCYcoLMADMXR2l5PG xEG8LSMM5jtwpm/BrPDE6cO0OH5qBwQ=
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-55-sVDmTIfSPym8NOuf_Rnjvw-1; Mon, 01 Feb 2021 04:37:14 -0500
X-MC-Unique: sVDmTIfSPym8NOuf_Rnjvw-1
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BCFF800D53; Mon, 1 Feb 2021 09:37:13 +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 B748E2BFF1; Mon, 1 Feb 2021 09:37:11 +0000 (UTC)
Date: Mon, 01 Feb 2021 10:37:09 +0100
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Magnus Danielson <magnus@rubidium.se>
Cc: ntp@ietf.org
Message-ID: <20210201093709.GF1205378@localhost>
References: <20210128143137.GA1205378@localhost> <f60202de-d53f-4dea-6e2b-d59dbb0e1143@rubidium.se>
MIME-Version: 1.0
In-Reply-To: <f60202de-d53f-4dea-6e2b-d59dbb0e1143@rubidium.se>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11
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/dy9cciiAP_R-Ro01F2ji3CbmDK0>
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 09:37:19 -0000

On Sun, Jan 31, 2021 at 11:30:03PM +0100, Magnus Danielson wrote:
> perfectly. The first PLL loop will feed the "worst case" input into the
> next where it will amplify it most, and so it goes. The problem is
> already well analyzed classically, and what you need to do is to
> increase the damping factor, and hence reduce Q, of the PLL and this is
> done by increase the P factor of a PI-loop PLL.

Yes, you can dampen the loops to avoid the overshoot, but that will
have a negative impact on the timekeeping performance. You can
minimize the phase error, or frequency error, but not both at the same
time.

> You also use a statement that you cannot in the protocol convey both
> time and frequency errors. This is just plain incorrect. A phase
> measurement will include both.

The point that I'm trying to make is that transfering time and
frequency separately works better than time transfer alone.

> I have before mentioned that incorrect setting of parameters compared to
> polling rate will create overshoots. This is because P and I parameters
> needs to be scaled correctly with regards to the polling rate, or else
> the balance between them will alter the actual damping factor and thus
> going from over-damped to under-damped.

PI loops are extremely simple, but difficult to tune. I have plenty of
experience with them in PTP. I find it interesting that you would
consider using one in NTP, where the conditions are more variable,
there is more filtering, non-constant update interval, etc. Making one
comparable to the standard NTP loop would be tricky.

> I can provide a range of references, unfortunatly not all in online
> sources. I could do a fairly long derivation of equations for it, and
> you can find posts from me where I do that.

If you wanted to be constructive, it would be best if you showed us an
example of a loop that doesn't overshoot in the step response and
otherwise performs similarly to ntp or chrony.

We can compare it a chain of servers and see if it performs better
than the ntpd and chronyd patched for frequency transfer.

-- 
Miroslav Lichvar