The following subsections analyze a number of considerations about transport-protocol ephemeral port randomization when applied to NTP.
There has been a fair share of work in the area of blind/off-path attacks against transport protocols and upper-layer protocols, such as [
RFC 4953] and [
RFC 5927]. Whether the target of the attack is a transport-protocol instance (e.g., TCP connection) or an upper-layer protocol instance (e.g., an application-protocol instance), the attacker is required to know or guess the five-tuple {Protocol, IP Source Address, IP Destination Address, Source Port, Destination Port} that identifies the target transport-protocol instance or the transport-protocol instance employed by the target upper-layer protocol instance. Therefore, increasing the difficulty of guessing this five-tuple helps mitigate blind/off-path attacks.
As a result of these considerations, transport-protocol ephemeral port randomization is a best current practice (BCP 156) that helps mitigate off-path attacks at the transport layer. This document aligns the NTP specification [
RFC 5905] with the existing best current practice on transport-protocol ephemeral port selection, irrespective of other techniques that may (and should) be implemented for mitigating off-path attacks.
We note that transport-protocol ephemeral port randomization is a transport-layer mitigation against blind/off-path attacks and does not preclude (nor is it precluded by) other possible mitigations for off-path attacks that might be implemented at other layers (e.g., [
NTP-DATA-MINIMIZATION]). For instance, some of the aforementioned mitigations may be ineffective against some off-path attacks [
NTP-FRAG] or may benefit from the additional entropy provided by port randomization [
NTP-security].
Intermediate systems implementing the Equal-Cost Multipath (ECMP) algorithm may select the outgoing link by computing a hash over a number of values, including the transport-protocol source port. Thus, as discussed in [
NTP-CHLNG], the selected client port may have an influence on the measured offset and delay.
If the source port is changed with each request, packets in different exchanges will be more likely to take different paths, which could cause the measurements to be less stable and have a negative impact on the stability of the clock.
Network paths to/from a given server are less likely to change between requests if port randomization is applied on a per-association basis. This approach minimizes the impact on the stability of NTP measurements, but it may cause different clients in the same network synchronized to the same NTP server to have a significant stable offset between their clocks. This is due to their NTP exchanges consistently taking different paths with different asymmetry in the network delay.
Section 4 recommends that NTP implementations randomize the ephemeral port number of client/server associations. The choice of whether to randomize the port number on a per-association or a per-request basis is left to the implementation.
In a number of scenarios (such as when mitigating DDoS attacks), a network operator may want to differentiate between NTP requests sent by clients and NTP responses sent by NTP servers. If an implementation employs the NTP well-known port for the client port, requests/responses cannot be readily differentiated by inspecting the source and destination port numbers. Implementation of port randomization for nonsymmetrical modes allows for simple differentiation of NTP requests and responses and for the enforcement of security policies that may be valuable for the mitigation of DDoS attacks, when all NTP clients in a given network employ port randomization.
Some NAPT devices will reportedly not translate the source port of a packet when a system port number (i.e., a port number in the range 0-1023) [
RFC 6335] is employed. In networks where such NAPT devices are employed, use of the NTP well-known port for the client port may limit the number of hosts that may successfully employ NTP client implementations at any given time.
In the case of NAPT devices that will translate the source port even when a system port is employed, packets reaching the external realm of the NAPT will not employ the NTP well-known port as the source port, as a result of the port translation function being performed by the NAPT device.