Re: [Ntp] NTPv5 Loop Detection without Stratum - Why do we want this?

Danny Mayer <mayer@pdmconsulting.net> Tue, 06 September 2022 23:23 UTC

Return-Path: <mayer@pdmconsulting.net>
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 C7A7AC14CF1E for <ntp@ietfa.amsl.com>; Tue, 6 Sep 2022 16:23:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01] 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 zGyB-X3vhSeb for <ntp@ietfa.amsl.com>; Tue, 6 Sep 2022 16:23:16 -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 46950C15257A for <ntp@ietf.org>; Tue, 6 Sep 2022 16:23:05 -0700 (PDT)
Received: from [192.168.1.156] (pool-108-26-202-2.bstnma.fios.verizon.net [108.26.202.2]) (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 chessie.everett.org (Postfix) with ESMTPSA id 4MMhJN5PmXzMQ2Q; Tue, 6 Sep 2022 23:23:00 +0000 (UTC)
Content-Type: multipart/alternative; boundary="------------Kmo69LUowyuj0ZZnn6Metwki"
Message-ID: <591a00e1-517d-0b03-6789-e97f45218ce0@pdmconsulting.net>
Date: Tue, 06 Sep 2022 19:22:57 -0400
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0
Content-Language: en-US
To: kristof.teichel=40ptb.de@dmarc.ietf.org, "ntp@ietf.org" <ntp@ietf.org>
Cc: Heiko Gerstung <heiko.gerstung=40meinberg.de@dmarc.ietf.org>
References: <DA1F1664-8A84-4197-844A-CA7E8DAA36B8@meinberg.de> <OF43150191.DABAA331-ONC12588B5.00362DC0-C12588B5.003861AF@ptb.de>
From: Danny Mayer <mayer@pdmconsulting.net>
In-Reply-To: <OF43150191.DABAA331-ONC12588B5.00362DC0-C12588B5.003861AF@ptb.de>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/W447sAET4dM9a0qlo6zOlPBLukc>
Subject: Re: [Ntp] NTPv5 Loop Detection without Stratum - Why do we want this?
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: Tue, 06 Sep 2022 23:23:20 -0000

On 9/6/22 6:15 AM, kristof.teichel=40ptb.de@dmarc.ietf.org wrote:
> Hey all,
>
> I'm sorry to take several steps backwards here, but I was discussing 
> this with Dieter and the Ostfalia folks yesterday, and I have questions:
>
> 1) What is the motivation to want to do loop detection, specifically 
> without stratum?
> If everyone does use stratum consistently (and in particular sees to 
> it that their own stratum is higher than the max of those of its own 
> sources), then there will never be a loop.
> Why would anyone want to not use strata in that way, but then still be 
> careful about loops?
There is no way to be sure that everyone does stratum consistently, not 
least of which you have no knowledge of the internals of the server you 
are contacting.
>
>
> 2) What is this black magic that I've heard a few times (from at least 
> Dieter and Danny now) that one RefID is supposed to be enough for loop 
> detection?
> Miroslav said it: it's a classic graph theory problem, and I don't see 
> how looking just two hops further would ever give me a consistent 
> reliable answer to "am I connected to X on some path, or not?".
> Someone gave an example of a synchronization path A->B->C->D->A, and I 
> don't see how the current RefID scheme is even supposed to ever detect 
> that.
> Perhaps it "works in practice", but that might just mean that 99.9...% 
> of users aren't doing crazy enough things to really approach the 
> limits of the current scheme's robustness, which is NOT the same as it 
> being very robust!
>
> 1b) Wouldn't tighter requirements on stratum use make things even easier?
> I assume that everyone agrees that using higher stratum servers is 
> never beneficial for accuracy - and often detrimental.

No, that isn't always true. Sometimes the lower stratum results have too 
much jitter, dispersion, too far off, etc. Some of that could be because 
of network traffic or connectivity and a thousand other possibilities. 
Stratum is only one measure to be considered.


>
> I would therefore assume that anyone who does not sync to a stratum 1 
> server and instead uses stratum 2 has prohibitive reasons for that 
> decision (and accordingly for higher strata decisions).
> Why then can't stratum be something that is treated as a constant for 
> each entity, with an accomanying requirement that a stratum n server 
> ONLY EVER uses stratum n-1 servers to sync their clock?
See above.
>
> (Add an encouragement that everyone keep their stratum as low as 
> possible given their infrastructure)
> Shouldn't loops go away completely (and strata 4+ become a really rare 
> sight on the public internet, basically an indicator of user error)?
>
>
> I'm guessing this comes down to some practical aspect (such as the NTP 
> pool) that I'm ignorant of, but it really seems to be causing a lot of 
> headache for something that looks like it could be avoided with some 
> low-complexity guidelines.
>
We cannot assume anything about a server providing time. We can only 
analyze the data it sends us and make our own decisions about the 
quality of the timestamps it sends.

Danny