Re: [Ntp] Symmetric mode

Miroslav Lichvar <mlichvar@redhat.com> Thu, 29 September 2022 14:42 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 BC924C14CF14 for <ntp@ietfa.amsl.com>; Thu, 29 Sep 2022 07:42:05 -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_NONE=-0.0001, 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 PUWB1iziJYg1 for <ntp@ietfa.amsl.com>; Thu, 29 Sep 2022 07:42:03 -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 27565C14F735 for <ntp@ietf.org>; Thu, 29 Sep 2022 07:42:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664462522; 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=JdFVSsjDfXmLlHr3H0dfXEPVAh9JqQesGXlESuYK4FY=; b=WaPF28mfPPL3nzOt6A04A0t1ZG9xHqGvQyoj5DzYlnQDaV4pxxaQv34OWqpwfnsWTJoese cGr1rwfKaUZ//U4i8FqPElTWr8mlMIk1cz8cSDvUxxc/d50Btl31vuZGAUSX1PYczttNQj lBsEJ5O6vm7bsSv5JajL2olHT/3OdYs=
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-75-X_9WVMbWNSqAvpYeNUyiMw-1; Thu, 29 Sep 2022 10:41:48 -0400
X-MC-Unique: X_9WVMbWNSqAvpYeNUyiMw-1
Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52937800159; Thu, 29 Sep 2022 14:41:36 +0000 (UTC)
Received: from localhost (unknown [10.43.135.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8969540C6EC2; Thu, 29 Sep 2022 14:41:34 +0000 (UTC)
Date: Thu, 29 Sep 2022 16:41:32 +0200
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Hal Murray <halmurray@sonic.net>
Cc: Danny Mayer <mayer@pdmconsulting.net>, "ntp@ietf.org" <ntp@ietf.org>
Message-ID: <YzWunE8uQwTh8suS@localhost>
References: <mayer@pdmconsulting.net> <e15fb43b-9c28-7a13-b395-468e8c62b71a@pdmconsulting.net> <20220929094524.DCB1828C1D8@107-137-68-211.lightspeed.sntcca.sbcglobal.net>
MIME-Version: 1.0
In-Reply-To: <20220929094524.DCB1828C1D8@107-137-68-211.lightspeed.sntcca.sbcglobal.net>
X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2
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/hZ6avI7dU_ZAoOLF_OplAqF2YvQ>
Subject: Re: [Ntp] Symmetric mode
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, 29 Sep 2022 14:42:05 -0000

On Thu, Sep 29, 2022 at 02:45:24AM -0700, Hal Murray wrote:
> If one side says "peer other" and the other side doesn't say anything I get 
> the symmetric active/passive pair you describe.
> 
> I was expecting an ephemeral slot to show up in ntpq -p but I haven't seen it. 
> Maybe I haven't got the restrict stuff right.  I tried
>   restrict default notrap
> with all other restrict stuff commented out.  Can anybody confirm that this 
> ephemeral association does or doesn't show up in ntpq -p?  Is crypto now 
> required?  ???

You need to either add "disable auth" to ntp.conf, or configure a
symmetric key on both hosts and add it to the peer directive.

ntpq -p (or ntpq -c peers) prints emphemeral symmetric associations,
but only if there was a valid response (reachable). If you just replay
a packet from a different address or port, the association will not be
printed by ntpq -c peers.

You need to use the ntpq -c lpeers command to see all associations,
but that works only up to a certain number of association which can be
listed in a single mode-6 response. There is also a limit due to the
16-bit type of the association ID. With more than 65535 associations
some will be completely invisible and other interesting things may
start to happen. I'd expect the daemon to crash at some point due to
running out of memory, or at least become so slow it's no longer doing
anything useful.

If you limit the addresses and port from which can be created
ephemeral associations, you get basically the same thing as a
permanent association.

-- 
Miroslav Lichvar