Re: [Ntp] NTPv5 Loop Detection without Stratum

Miroslav Lichvar <mlichvar@redhat.com> Tue, 23 August 2022 10:32 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 2D16AC1526E8 for <ntp@ietfa.amsl.com>; Tue, 23 Aug 2022 03:32:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.679
X-Spam-Level:
X-Spam-Status: No, score=-7.679 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_HI=-5, 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 drvfNoIvHP7u for <ntp@ietfa.amsl.com>; Tue, 23 Aug 2022 03:32:58 -0700 (PDT)
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 6FF1AC1526E7 for <ntp@ietf.org>; Tue, 23 Aug 2022 03:32:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661250768; 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=m7gjrV8FQPTGHPfjB8X1JIrwdejRER2mCNrH+0+mBHY=; b=JGhCQJOnHKS/zYld1hWyzZDbbnp0+RD1z4VJMujRP9fHtl3IPorsjLk3qegK2nIlVJ4kqU ZYLwPFo2swY37Vzmb437lxq8sl/JnWXJkXb1oFTewrzW3+VZf0hu5ZLq5zN2KQxvKI2z3c XjNGW6eIrhDw1hLbNOKvfuMYAf2eXLI=
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-664-Z7e8-dhbNbmmAlBo248Bgw-1; Tue, 23 Aug 2022 06:32:47 -0400
X-MC-Unique: Z7e8-dhbNbmmAlBo248Bgw-1
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52D751C05AB2; Tue, 23 Aug 2022 10:32:47 +0000 (UTC)
Received: from localhost (unknown [10.43.135.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BBC6B2026D4C; Tue, 23 Aug 2022 10:32:46 +0000 (UTC)
Date: Tue, 23 Aug 2022 12:32:45 +0200
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Heiko Gerstung <heiko.gerstung@meinberg.de>
Cc: Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>, "ntp@ietf.org" <ntp@ietf.org>
Message-ID: <YwSszVA+ABO+3Tt3@localhost>
References: <DA1F1664-8A84-4197-844A-CA7E8DAA36B8@meinberg.de>
MIME-Version: 1.0
In-Reply-To: <DA1F1664-8A84-4197-844A-CA7E8DAA36B8@meinberg.de>
X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4
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/sBOAhuEURKrlHA_Kv-uZgRA0hJ8>
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: Tue, 23 Aug 2022 10:32:59 -0000

On Tue, Aug 23, 2022 at 12:21:19PM +0200, 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

That was the original idea before Daniel Franke suggested to use a
bloom filter instead of a simple list. This makes the amount of
exchanged data constant and it can contain a very large number of
reference IDs before collisions can be expected.

-- 
Miroslav Lichvar