rfc-9109

Network Time Protocol Version 4: Port Randomization

F. Gont, G. Gont, M. Lichvar
date2021-08 streamIETF areaint wgntp statusPROPOSED STANDARD pages9 canonicalhttps://www.rfc-editor.org/rfc/rfc9109 doi10.17487/RFC9109
The Network Time Protocol (NTP) can operate in several modes. Some of these modes are based on the receipt of unsolicited packets and therefore require the use of a well-known port as the local port. However, in the case of NTP modes where the use of a well-known port is not required, employing such a well-known port unnecessarily facilitates the ability of attackers to perform blind/off-path attacks. This document formally updates RFC 5905, recommending the use of transport-protocol ephemeral port randomization for those modes where use of the NTP well-known port is not required.

updates

Extracted elements (15)

design-rationale §6

NTP has traditionally employed the well-known port 123 even when not strictly necessary, which unnecessarily reduces the entropy an attacker must overcome to mount a blind/off-path attack. This document corrects that pattern to align with BCP 156 (RFC 6056).

ntp, security, bcp

design-rationale §3.2

Port randomization is recommended on a per-association basis to minimize impact on clock stability, since per-request randomization causes packets in different exchanges to take different ECMP paths, leading to less stable offset and delay measurements.

ntp, udp, measurement

design-rationale §4

The choice of whether to randomize the ephemeral port on a per-request or per-association basis is left to the implementation; per-request randomization better mitigates blind/off-path attacks but may negatively affect time measurement stability due to ECMP path variation.

ntp, udp, security, measurement

design-rationale §3.3

When all NTP clients in a network use randomized ports, operators can easily differentiate client requests (random source port, destination port 123) from server responses (source port 123, random destination port), enabling DDoS mitigation policies.

ntp, udp, security

interoperability-note §3.2

ECMP intermediate systems may hash the source port to select the outgoing link. Changing the source port per-request can cause NTP exchanges to traverse different paths with different delay asymmetry, potentially introducing stable clock offsets between clients synchronized to the same server.

ntp, udp, measurement

interoperability-note §4

On most current operating systems implementing RFC 6056 ephemeral port randomization, NTP clients can rely on the OS by not calling bind() or binding to port 0; using connect() additionally restricts the socket to only receive packets from the specified remote socket.

ntp, udp

interoperability-note §3.4

Some NAPT devices do not translate the source port when a system port (0–1023) is used. In such networks, using the NTP well-known port 123 as the client port may limit the number of hosts that can simultaneously use NTP, since NAPT translation requires unique port mappings.

ntp, nat, udp

normative-requirement §4 SHOULD

If a client performs port randomization on a per-request basis, it SHOULD close the corresponding socket/port after each request/response exchange, to limit exposure of the randomized port.

ntp, udp, security

normative-requirement §4 SHOULD

In broadcast server mode (5) and symmetric modes (1 and 2), the dstport variable SHOULD contain the NTP well-known port number 123 assigned by IANA, as these modes require receipt of unsolicited packets.

ntp, udp, security

normative-requirement §4 SHOULD

In client mode (3), the dstport variable SHOULD contain a randomized ephemeral port number as specified in RFC 6056 (BCP 156), rather than the NTP well-known port 123.

ntp, udp, security

normative-requirement §4 SHOULD NOT

The randomized ephemeral port number SHOULD NOT be shared with other associations, to avoid revealing the randomized port to other NTP associations.

ntp, udp, security, privacy

normative-requirement §4 MAY

To prevent duplicate or delayed server packets from eliciting ICMP port unreachable errors at the client, the client MAY wait for additional responses for a specific period (e.g., 3 seconds) before closing the UDP socket/port.

ntp, udp, ip

protocol-element §4

The dstport peer process variable holds the UDP port number of the NTP client. It becomes the source port number in packets sent from that association. Its value depends on the operating mode: well-known port 123 for broadcast/symmetric modes, randomized port for client mode.

ntp, udp

security-consideration §3.1

Transport-protocol ephemeral port randomization is a transport-layer mitigation against blind/off-path attacks and is complementary to—not a replacement for—other NTP-layer mitigations such as NTP data minimization or authentication. Port randomization adds entropy that benefits those other mitigations as well.

ntp, security, udp, privacy

security-consideration §6

Using the NTP well-known port 123 for both srcport and dstport in client mode unnecessarily reduces the search space for blind/off-path attackers who need to guess the five-tuple {Protocol, IP src, IP dst, src port, dst port} to forge packets targeting an NTP association. This issue is assigned CVE-2019-11331.

ntp, security, udp