Re: [Ntp] New I-D: NTP Port Randomization (draft-gont-ntp-port-randomization-00.txt)

Miroslav Lichvar <mlichvar@redhat.com> Wed, 24 April 2019 08:34 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 37C8C120180 for <ntp@ietfa.amsl.com>; Wed, 24 Apr 2019 01:34:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.901
X-Spam-Level:
X-Spam-Status: No, score=-6.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 jBM0n9Jf9V2x for <ntp@ietfa.amsl.com>; Wed, 24 Apr 2019 01:34:57 -0700 (PDT)
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F28451200A4 for <ntp@ietf.org>; Wed, 24 Apr 2019 01:34:56 -0700 (PDT)
Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0409308404C; Wed, 24 Apr 2019 08:34:56 +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 E8B8D5D705; Wed, 24 Apr 2019 08:34:55 +0000 (UTC)
Date: Wed, 24 Apr 2019 10:34:40 +0200
From: Miroslav Lichvar <mlichvar@redhat.com>
To: Fernando Gont <fgont@si6networks.com>
Cc: ntp@ietf.org
Message-ID: <20190424083440.GB26137@localhost>
References: <155544937440.24990.5297599214551671091.idtracker@ietfa.amsl.com> <d0be2bea-0e57-022f-16f1-4e682dcc66ad@si6networks.com> <20190418123648.GF5984@localhost> <ceea9343-496f-2842-8255-158b515106b6@si6networks.com> <20190423084853.GB5188@localhost> <890da574-a283-9ccc-28fc-19d500920d36@si6networks.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <890da574-a283-9ccc-28fc-19d500920d36@si6networks.com>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 24 Apr 2019 08:34:56 +0000 (UTC)
Archived-At: <https://mailarchive.ietf.org/arch/msg/ntp/hITXrVftKuvu9hmbP_R_dMO0xx0>
Subject: Re: [Ntp] New I-D: NTP Port Randomization (draft-gont-ntp-port-randomization-00.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, 24 Apr 2019 08:34:58 -0000

On Wed, Apr 24, 2019 at 01:17:43AM +0200, Fernando Gont wrote:
> On 23/4/19 10:48, Miroslav Lichvar wrote:
> > Yes, ntpd and ntpdate (without -q or -d) seem to be in the minority of
> > clients using source port 123.
> 
> Any clues whether in other cases they explicitly randomize the source
> port, or rely on the kernel doing port randomization?

I think most, if not all, rely on the OS to do that. When there is no
OS, it seems it's common to use a fixed port, but different from 123.
There are many peaks in the port distribution observed on servers.

> Stupid question: Can the peer doing active mode assume that the other
> peer will be using passive mode? I don't recall of the top of my head:
> is symmetric mode where both peers employ active mode supported? (as in
> e.g. TCP simultaneous open)

It depends on the configuration. If a peer has the other peer
specified in the config, it's using the active mode. There could be an
option to enable random source port for the case when I know the other
peer doesn't have this one specified in the config (e.g. because it's
behind NAT).

> OTOH, if symmetric mode where both endpoints do active mode is
> supported, then it would seem to me it wouldn't be possible to randomize
> the port on symmetric mode -- since otherwise you wouldn't know which
> port to connect to.

In the general case yes, but it could be enabled in the configuration file.

-- 
Miroslav Lichvar