Re: [Ntp] NTPv5 Loop Detection without Stratum

Miroslav Lichvar <mlichvar@redhat.com> Wed, 24 August 2022 13:31 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 BD28BC1522D6 for <ntp@ietfa.amsl.com>; Wed, 24 Aug 2022 06:31:56 -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_DNSWL_BLOCKED=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 q4LuAkEFWyPG for <ntp@ietfa.amsl.com>; Wed, 24 Aug 2022 06:31:56 -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)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D985DC14CF06 for <ntp@ietf.org>; Wed, 24 Aug 2022 06:31:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661347915; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+iS0113GfScFiFVhkhMAWESOeC8/Tvl1aAvKhyzJiP8=; b=U0rxkZSWS0ylIT/SRpCWCRPsST6by91mpkaFVmNSQOz3lJ42eHZ2N2Gshc3Kka9yhaAeBO OBOezAoHnCuSTjkiSS/U9qFDfpjWopnXz1oH2rVYHvYNGCt3yZq1/d2zUBug4X9R8GeuWD RMH6i9QAOuz7L0YWa76/LeBTwpH+tuQ=
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-616-bjuFPqRFPiWKTpNwqa75Zg-1; Wed, 24 Aug 2022 09:31:51 -0400
X-MC-Unique: bjuFPqRFPiWKTpNwqa75Zg-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 7E1B7294EDF3; Wed, 24 Aug 2022 13:31:51 +0000 (UTC)
Received: from localhost (unknown [10.43.135.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E27322166B29; Wed, 24 Aug 2022 13:31:49 +0000 (UTC)
Date: Wed, 24 Aug 2022 15:31:48 +0200
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Paul Gear <ntp=40libertysys.com.au@dmarc.ietf.org>
Cc: ntp@ietf.org
Message-ID: <YwYoRGQNMno+c0+G@localhost>
References: <DA1F1664-8A84-4197-844A-CA7E8DAA36B8@meinberg.de> <YwSszVA+ABO+3Tt3@localhost> <526dbee6-baff-bc40-d0e7-baadd71f438b@libertysys.com.au>
MIME-Version: 1.0
In-Reply-To: <526dbee6-baff-bc40-d0e7-baadd71f438b@libertysys.com.au>
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="WINDOWS-1252"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/wUa5uUHbK8Nadh_tm44j-3P-D1o>
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 13:31:56 -0000

On Wed, Aug 24, 2022 at 08:35:39AM +1000, Paul Gear wrote:
> I'm far from an expert on bloom filters, but they can have false positives,
> which would result in a source which was not part of a client's upstreams
> being erroneously flagged as being so.  Would this not require a trace (like
> what Heiko has described above) to detect?

I'm not an expert either. To me it seems that it shouldn't be a
problem unless we expect the number of IDs to grow to several
hundreds.

With the proposed filter (m=4096 and k=10) the chances of a collision
are about:
- 1e-12 with 26 IDs
- 1e-10 with 43 IDs
- 1e-8 with 70 IDs
- 1e-6 with 118 IDs
- 1e-4 with 207 IDs
- 1e-2 with 408 IDs
- 1e-1 with 648 IDs

I guess we could get away even with a smaller filter, but this is
going to be difficult to estimate.

> In some cases, false positives would be inconsequential (e.g. when the
> client is using a well-served zone in the public pool and can easily ask for
> another source), but in private networks where the number of sources may be
> more limited discarding an upstream source may be more problematic.

Would those clients in a private network be expected to operate as a
server? If not, they don't need to check for loops.

-- 
Miroslav Lichvar