Re: [Ntp] NTPv5 Loop Detection without Stratum

Harlan Stenn <stenn@nwtime.org> Wed, 24 August 2022 08:43 UTC

Return-Path: <stenn@nwtime.org>
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 F13B8C1522DF for <ntp@ietfa.amsl.com>; Wed, 24 Aug 2022 01:43:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.908
X-Spam-Level:
X-Spam-Status: No, score=-1.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
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 o4cbFjdaP1oH for <ntp@ietfa.amsl.com>; Wed, 24 Aug 2022 01:43:22 -0700 (PDT)
Received: from chessie.everett.org (chessie.everett.org [66.220.13.234]) (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 E3F9BC14CF1E for <ntp@ietf.org>; Wed, 24 Aug 2022 01:43:17 -0700 (PDT)
Received: from [10.208.75.149] (071-084-168-128.res.spectrum.com [71.84.168.128]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by chessie.everett.org (Postfix) with ESMTPSA id 4MCKPG57ZszMPQr; Wed, 24 Aug 2022 08:43:14 +0000 (UTC)
Message-ID: <4c3306fc-4a44-6cb1-57b7-895a543d51dc@nwtime.org>
Date: Wed, 24 Aug 2022 01:43:13 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0
Content-Language: en-US
To: ntp@ietf.org
References: <DA1F1664-8A84-4197-844A-CA7E8DAA36B8@meinberg.de>
From: Harlan Stenn <stenn@nwtime.org>
In-Reply-To: <DA1F1664-8A84-4197-844A-CA7E8DAA36B8@meinberg.de>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/3OyLGT3zDgsfxhYbzE46ax446iw>
Subject: Re: [Ntp] NTPv5 Loop Detection without Stratum
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, 24 Aug 2022 08:43:28 -0000

Are timing loops an actual, real problem?

If so, what are the significant considerations?

What core variables are in play?  Root distance?  Root/peer dispersion?

What are the root causes of these loops?

H

On 8/23/2022 3:21 AM, Heiko Gerstung wrote:
> One way of avoiding/detecting loops:
> - upon startup, an NTPv5 instance creates a random 64bit ID
> - we add a loop detection EF that can include n IDs (or we use n EFs)
> - a stratum one server, when ask for his "sync trace", responds with only his ID
> - a stratum two server would add its own ID to the ID of its upstream server, responding with a sync trace of two IDs
> - a stratum 1+n server would respond with the sync trace of its upstream source(s) plus its own ID
> - if you use more than one upstream source, you can respond with a list of all IDs from the sync trace of all your upstream sources (removing duplicates)
> - by checking if your own ID is in the sync trace of your upstream source(s), you can find out if there is a loop
> 
> Maybe smaller IDs (32 bit, 16 bit) would be OK as well. 10 IDs would be 80 octets on the wire. No question that we would have to find a way to avoid amplification attacks (hello monlist!). Maybe by making it mandatory to send a request (with padding bytes) that is as big as the worst case response.
> 
> Regards,
>    Heiko
> 
> --
> Heiko Gerstung | Managing Director
> T: +49 (0)5281 9309-404 | LinkedIn Profile <https://www.linkedin.com/in/heikogerstung/> | Twitter <https://twitter.com/hgerstung>
> heiko.gerstung@meinberg.de
> 
> MEINBERG® The Synchronization Experts
>   
> Meinberg Funkuhren GmbH & Co. KG
> Lange Wand 9 | 31812 Bad Pyrmont | Germany
> Web: http://www.meinberg.de | http://www.meinbergglobal.com | LinkedIn  <https://www.linkedin.com/company/meinberg-funkuhren-gmbh-&-co--kg>
> 
> Amtsgericht Hannover 17HRA 100322
> Geschäftsführer/Management: Günter Meinberg, Werner Meinberg, Andre Hartmann, Heiko Gerstung
> 
> Do not miss our Time Synchronization Blog:
> http://blog.meinbergglobal.com
>   
>   
> 
> Am 23.08.22, 12:07 schrieb "ntp im Auftrag von Miroslav Lichvar" <ntp-bounces@ietf.org im Auftrag von mlichvar@redhat.com>:
> 
>      On Tue, Aug 23, 2022 at 11:30:44AM +0200, Ulrich Windl wrote:
>      > So my conclusion still is that the "ping pong" style of time exchange between
>      > peers is in accordance with the protocol specification.
> 
>      If the protocol cannot prevent the loop, there is no other option :).
> 
>      If NTPv5 can detect all loops, the client can decide to ignore the
>      measurements of the source to avoid the loop.
> 
>      > (However if those peer have no other time source, the quality should become
>      > worse over time, eventually declaring them unsynchronized)
> 
>      If they have no other time source, the protocol will block the
>      synchronization by ignoring sources with larger stratum (NTPv3) or
>      ignoring sources with matching refid (NTPv4).
> 
>      > > It causes oscillations, which has a negative impact on stability of
>      > > the clocks. If you remove the symmetric associations, it performs
>      > > better. You can easily verify that.
>      >
>      > It may be, but would it be in the spirit of the protocol specification?
> 
>      I'm not sure what you mean by this.
> 
>      --
>      Miroslav Lichvar
> 
>      _______________________________________________
>      ntp mailing list
>      ntp@ietf.org
>      https://www.ietf.org/mailman/listinfo/ntp
> 
> 
> _______________________________________________
> ntp mailing list
> ntp@ietf.org
> https://www.ietf.org/mailman/listinfo/ntp

-- 
Harlan Stenn <stenn@nwtime.org>
http://networktimefoundation.org - be a member!