Re: [Ntp] Antw: Re: I-D Action: draft-ietf-ntp-port-randomization-00.txt

Miroslav Lichvar <> Wed, 13 November 2019 16:01 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 3183D120817 for <>; Wed, 13 Nov 2019 08:01:06 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -4.3
X-Spam-Status: No, score=-4.3 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id dk0nFIbUjJ_a for <>; Wed, 13 Nov 2019 08:01:03 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 58FDB120073 for <>; Wed, 13 Nov 2019 08:01:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=mimecast20190719; t=1573660862; 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=BcnUACVWh24Tqh42XVtQdq0Gdkzt753P9MfCW9gp6Ig=; b=f+t51L3+qyl4r8e3Yq5kqNxIL98XMI+KuSxB9SeKkH0p2YkxyjySA3ZWa/9ckgic6DVvkn gS12ThhRCc6Mmt4brY0l5bzdjs1entfNRNjVrv1fx9HvczTNKLVL+zVid+ob/l0V2rDw2y ZXJDSfvxNij4zuY3uBBVDjuXjTNQnvU=
Received: from ( []) (Using TLS) by with ESMTP id us-mta-136-6RB5-hGhPliabbYNFgOJ8g-1; Wed, 13 Nov 2019 11:00:58 -0500
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 8C64C800686 for <>; Wed, 13 Nov 2019 16:00:57 +0000 (UTC)
Received: from localhost ( []) by (Postfix) with ESMTPS id 13B8A60471 for <>; Wed, 13 Nov 2019 16:00:56 +0000 (UTC)
Date: Wed, 13 Nov 2019 17:00:55 +0100
From: Miroslav Lichvar <>
Message-ID: <20191113160055.GC2634@localhost>
References: <> <20191113112126.GA2634@localhost> <>
MIME-Version: 1.0
In-Reply-To: <>
User-Agent: Mutt/1.12.1 (2019-06-15)
X-Scanned-By: MIMEDefang 2.79 on
X-MC-Unique: 6RB5-hGhPliabbYNFgOJ8g-1
X-Mimecast-Spam-Score: 0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Archived-At: <>
Subject: Re: [Ntp] Antw: Re: I-D Action: draft-ietf-ntp-port-randomization-00.txt
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 13 Nov 2019 16:01:06 -0000

On Wed, Nov 13, 2019 at 12:49:32PM +0100, Ulrich Windl wrote:
> >>> Miroslav Lichvar <> schrieb am 13.11.2019 um 12:21 in
> > ‑ It seems to be the current practice. From the implementations
> >   that I'm familiar with and that use a random source port, each one
> >   opens a new socket for each request, at least by default. On my
> >   public servers I see that most clients do change their port over
> >   time.
> >From remote you cannot know whether it's the same instance of the same client
> sending the requests.

Yes, there could be multiple clients (e.g. behind NAT), but I think we
can make a good guess whether any of them use a stable port by
counting how many requests are there per port. When I analyze 24-hour
captures from public servers in few different countries, for most
addresses there seem to be only one request per port. I'm ignoring
addresses that send only requests from some popular fixed ports like
123, 1024, 1490.

> My guess is that the client does not specify the source port, so for each
> socket a free (not "random") port will be chosen. The implementation rationale
> most likely is that "it's easier", not because "it's better".

I'm not sure if it's really easier. The port assigned by the system
should be random. Do you have an example of a widely used
implementation keeping a socket open which is not also used for
different servers?

> I think I said it before: The server SHOULD still work if the client changes
> the port number (leaving it open to the server to assume that it's a different
> client then), but I would NOT require the client to vary the source port
> number.

It's not meant to be a requirement, just a recommendation.

Miroslav Lichvar