Re: [Ntp] Antw: Re: Antw: [EXT] NTPv5 Loop Detection without Stratum

Miroslav Lichvar <mlichvar@redhat.com> Wed, 31 August 2022 07:26 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 E23BFC1522DB for <ntp@ietfa.amsl.com>; Wed, 31 Aug 2022 00:26:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.378
X-Spam-Level:
X-Spam-Status: No, score=-3.378 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_DNSWL_LOW=-0.7, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01] 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 ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F6Cq8GmZn3vV for <ntp@ietfa.amsl.com>; Wed, 31 Aug 2022 00:26:04 -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 5DB7BC1522D7 for <ntp@ietf.org>; Wed, 31 Aug 2022 00:26:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661930762; 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=+7xUhbJxenaE1Qxk5qIcshCRz4qBuoQamUSMC4Kfrr0=; b=Yw9JbE/5BQHNYIZzi1NlYqbOaXj112Ro2kmNdVDh+vjHZPEvpils4sysVClezwuQQn9elp VarqaHMtjTM4B81xngKEiBA7RGrG6Y0YKWUzrZXYqyEo0PtaMCV5GmfKhhIzRenop2zvV9 EjdkMaWmafIJ71IoqiF0vYTlAzxRG7Q=
Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-447-cUW_EenQO1affm9Nz3flYQ-1; Wed, 31 Aug 2022 03:26:01 -0400
X-MC-Unique: cUW_EenQO1affm9Nz3flYQ-1
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 97CEC3804525; Wed, 31 Aug 2022 07:26:00 +0000 (UTC)
Received: from localhost (unknown [10.43.135.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5317F2166B26; Wed, 31 Aug 2022 07:25:58 +0000 (UTC)
Date: Wed, 31 Aug 2022 09:25:57 +0200
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Hal Murray <halmurray@sonic.net>
Cc: David Venhoek <david@venhoek.nl>, Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>, Heiko Gerstung <heiko.gerstung@meinberg.de>, mayer@pdmconsulting.net, "ntp@ietf.org" <ntp@ietf.org>
Message-ID: <Yw8NBX6ATjRr0/A4@localhost>
References: <david@venhoek.nl> <CAPz_-SVPE-Fd1vFWnbu+GAPc=y2bkJMW4pyu98bBwDfcm+R2rg@mail.gmail.com> <20220830205143.DFDC328C1D8@107-137-68-211.lightspeed.sntcca.sbcglobal.net>
MIME-Version: 1.0
In-Reply-To: <20220830205143.DFDC328C1D8@107-137-68-211.lightspeed.sntcca.sbcglobal.net>
X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6
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/mBGPgcMprtdE47f6KdVv29mnqBI>
Subject: Re: [Ntp] Antw: Re: Antw: [EXT] 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, 31 Aug 2022 07:26:09 -0000

On Tue, Aug 30, 2022 at 01:51:43PM -0700, Hal Murray wrote:
> That brings up an interesting point.
> 
> What does loop mean?

I think it's when a clock is synchronizing directly or indirectly
(over one or more other clocks) to itself. As a test, you can inject a
small offset to the server's clock and see if the impulse comes back
later from one of its sources.

In the graph theory, it's a loop in a directed graph.

> The draft for NTPv5 is only the wire protocol.  It doesn't cover what goes on 
> inside a server.  If a server latches on to the best upstream server and only 
> uses any others for checking, then the topology is simple and loop would be 
> easy to define.

Such a loop is guaranteed to break when the stratum reaches maximum,
but it can repeat if some of the sources switch to something else and
back.

> Is that a reasonable assumption?  Do we need a section in the draft to collect 
> assumptions about the internals of servers?
> 
> Consider the alternative where a server does some sort of weighting on the use 
> of its upstream servers.  What does stratum mean?  Is loop well defined?

This should be specified in the draft. As David suggested, stratum could be
the maximum+1 of all sources. Maybe we can provide both minimum and
maximum. This needs to be tested.

> Do we want 2 different client/server packet modes/formats?  One for 
> leaf-clients (SNTP) and another for the client side of servers?  Or maybe the 
> same packet format but different descriptions of the way fields are used.

That sounds like an unnecessary complication to me.

> Or maybe even 2 separate RFCs.  The idea being that SNTP will be much easier 
> to understand and we can target it for a longer lifetime.  In particular, it 
> wouldn't have to say anything about loop detection.

I don't like duplicating text or code. We just need to make sure the
document is clear on what parts are not required for client-only
implementations.

I think SNTP vs NTP is more about algorithms, not the protocol.
Without the symmetric mode, NTPv5 will be very easy to implement.

-- 
Miroslav Lichvar