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

Miroslav Lichvar <mlichvar@redhat.com> Thu, 08 September 2022 06:24 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 8FCECC14CF14 for <ntp@ietfa.amsl.com>; Wed, 7 Sep 2022 23:24:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.678
X-Spam-Level:
X-Spam-Status: No, score=-2.678 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.571, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=unavailable 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 ohP-7pd519y0 for <ntp@ietfa.amsl.com>; Wed, 7 Sep 2022 23:24:28 -0700 (PDT)
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 BC35CC14CEFC for <ntp@ietf.org>; Wed, 7 Sep 2022 23:24:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662618265; 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=NB/gak+jo6K6oaSyakxSNDiaP1Sj68V9PPagAItlwLI=; b=VHaWAnaKQHlR00LIMaUObSqySpea4GcWLD39fSwgV3AYsPMBLIg/VgK+u+VmZ3BMv/F2Hc kdnRVNlXTxXah/V2rila5ZsgViIn1J3YWj6ipRSIdaE/NKG33ZdBSI9YdrZVCDomyxXCRL BbaNkMTxGk//mgTngLzl+cVsksJIkKQ=
Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-321-VBprWpVPNMmCY0cxSzsIPw-1; Thu, 08 Sep 2022 02:24:24 -0400
X-MC-Unique: VBprWpVPNMmCY0cxSzsIPw-1
Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 177D8811E80; Thu, 8 Sep 2022 06:24:24 +0000 (UTC)
Received: from localhost (unknown [10.43.135.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F5EE945D0; Thu, 8 Sep 2022 06:24:22 +0000 (UTC)
Date: Thu, 08 Sep 2022 08:24:21 +0200
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Danny Mayer <mayer@pdmconsulting.net>
Cc: kristof.teichel=40ptb.de@dmarc.ietf.org, "ntp@ietf.org" <ntp@ietf.org>, Heiko Gerstung <heiko.gerstung=40meinberg.de@dmarc.ietf.org>
Message-ID: <YxmKlSVTzOQah/nc@localhost>
References: <DA1F1664-8A84-4197-844A-CA7E8DAA36B8@meinberg.de> <OF43150191.DABAA331-ONC12588B5.00362DC0-C12588B5.003861AF@ptb.de> <YxckOm2+TD3tTPN4@localhost> <7d7f0656-2fd2-b781-4913-526a4be8cb62@pdmconsulting.net> <Yxg4Cba58hI/aPKw@localhost> <aba44bbc-2204-735e-daff-a29a59dac9da@pdmconsulting.net>
MIME-Version: 1.0
In-Reply-To: <aba44bbc-2204-735e-daff-a29a59dac9da@pdmconsulting.net>
X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5
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/ZljEFxC8FGsWk6XjSFb0l8F699o>
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: Thu, 08 Sep 2022 06:24:32 -0000

On Wed, Sep 07, 2022 at 02:50:23PM -0400, Danny Mayer wrote:
> On 9/7/22 2:19 AM, Miroslav Lichvar wrote:
> > If stratum came from the maximum from all selected sources, it would
> > always terminate the loop, but I think it would lead to unstable
> > selection. We can experiment with that.
> Only one source is selected at a time so this makes no sense.

An NTP client can select multiple sources at the same time for its
synchronization. Look for "combine" in the NTP RFCs. With the "ntpq
peers" command you would see sources marked with the * and + symbols.

The best source (in terms of root distance) determines stratum and
root delay/dispersion of the client. That other sources don't.
 
> > In orphan mode stratum is interpreted differently. Symmetric mode or
> > client/server mode makes no difference.
> There is no symmetric mode for client/server. A client is by definition one
> stratum value larger than the server. Peers can have the same stratum.

This is about the onwire protocol, not about source selection or
synchronization. A client polling a server can have a smaller, equal,
or higher stratum than the server.

The difference between the client/server and symmetric mode is that in
symmetric mode a message is a request and response at the same time.
A client/server association provides measurements (offset, delay) only
for the client side. In symmetric mode the association provides
measurements for both sides.

Two client/server associations in opposite directions provide the same
functionality as a symmetric association, except the number of
exchanged messages is doubled, it's much easier to implement and
understand, and there are no replay attacks.

> > If a local stratum-1 server had a poor reference clock (e.g. a GPS
> > receiver without PPS), it would be better to use a distant server with
> > higher stratum, i.e. stratum doesn't say much about accuracy.
> 
> Then it wouldn't be a stratum-1 server any more.

What it would be?

-- 
Miroslav Lichvar