Re: [Ntp] I-D Action: draft-ietf-ntp-using-nts-for-ntp-27.txt

Miroslav Lichvar <mlichvar@redhat.com> Wed, 25 March 2020 11:58 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 CA97C3A0C1C for <ntp@ietfa.amsl.com>; Wed, 25 Mar 2020 04:58:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level:
X-Spam-Status: No, score=-2.1 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] 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 ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zeMwJUyskrc7 for <ntp@ietfa.amsl.com>; Wed, 25 Mar 2020 04:58:49 -0700 (PDT)
Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 41BFF3A08A6 for <ntp@ietf.org>; Wed, 25 Mar 2020 04:58:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585137528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N26Ubrv1EYSVqhJNsQN8b9CanQbqlOZtc0jvv800Hq0=; b=CQEaoUqc6atTPFPZ3/nLSGTKRvjhjm9VUo1dBhhYJFIBTiIfOX+232O+Zy0VZaov6MQbsN O7dbLpv23swpLWtDTHF5j7XzGyiIE8Bjfix1LxIL5rW9I/FKCYJyh6itqZy3DZmIDC2Rko /NliTd30sToGCAI+PxN86iCOibr+zTI=
Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-5-O_wzA2jRO9a-IeM_X1xkqA-1; Wed, 25 Mar 2020 07:58:37 -0400
X-MC-Unique: O_wzA2jRO9a-IeM_X1xkqA-1
Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9F51E1005514 for <ntp@ietf.org>; Wed, 25 Mar 2020 11:58:36 +0000 (UTC)
Received: from localhost (holly.tpb.lab.eng.brq.redhat.com [10.43.134.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2245B5DA7B for <ntp@ietf.org>; Wed, 25 Mar 2020 11:58:35 +0000 (UTC)
Date: Wed, 25 Mar 2020 12:58:34 +0100
From: Miroslav Lichvar <mlichvar@redhat.com>
To: ntp@ietf.org
Message-ID: <20200325115834.GC25803@localhost>
References: <158507294813.11622.18159158243943940302@ietfa.amsl.com>
MIME-Version: 1.0
In-Reply-To: <158507294813.11622.18159158243943940302@ietfa.amsl.com>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/wfiSMBcoIXr-EiuV0ygdenkVlMU>
Subject: Re: [Ntp] I-D Action: draft-ietf-ntp-using-nts-for-ntp-27.txt
X-BeenThere: ntp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <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, 25 Mar 2020 11:58:51 -0000

On Tue, Mar 24, 2020 at 11:02:28AM -0700, internet-drafts@ietf.org wrote:
> A diff from the previous version is available at:
> https://www.ietf.org/rfcdiff?url2=draft-ietf-ntp-using-nts-for-ntp-27

One of the changes in the latest version is a new section on
recommended NTS-KE retry intervals. There was some discussion in the
github issue #153 and there was a suggestion to continue here.

Does anyone else think that the minimum retry interval of 10 seconds
is way too short?

I think it should be at least 1024 seconds (corresponding to the
default NTP maxpoll), with an exception for retrying a TCP connection
when the server doesn't accept the connection, or it's closed before
the TLS handshake to implement a rate limiting. Is there anything else
that would be likely to change on the server for the NTS-KE to succeed
just after 10 seconds?

In my tests NTS-KE seems to be about 200x more expensive than an
NTS-NTP (a single core handling about 500 NTS-KE requests per second
or 100000 NTS-NTP requests per second). That's with the AES-NI
support.

A widely used polling interval of NTP clients is between 64 and 1024
seconds. That means a single NTS client retrying NTS-KE after only 10
seconds wasted the same amount of resources as about 10000 clients
using only NTS-NTP. That's crazy.

Yes, the server can limit the number of threads available to NTS-KE or
limit the connection rate, but that will have a disproportionate
impact on clients using more reasonable retry intervals.

I suggest to modify the second paragraph of the section to the
following:

  Clients SHOULD use an exponential backoff with a base of 2. The
  initial retry interval SHOULD be at least 16 seconds if the previous
  NTS-KE connection failed, or the server closed it before the TLS
  handshake, and 1024 seconds in other cases. The maximum interval
  SHOULD be at least 524288 seconds (~6 days). The minimum interval in
  seconds, t, for the nth retry can be calculated as

		t = min(R * 2^(n-1), 2^19)
		where R is 16 or 1024 depending on the previous error

I suggest powers of 2 to make it compatibille with NTP polling
intervals and avoid floating point operations.

-- 
Miroslav Lichvar