RFC 9131 | Gratuitous ND | August 2021 |
Linkova | Standards Track | [Page] |
Neighbor Discovery (RFC 4861) is used by IPv6 nodes to determine the link-layer addresses of neighboring nodes as well as to discover and maintain reachability information. This document updates RFC 4861 to allow routers to proactively create a Neighbor Cache entry when a new IPv6 address is assigned to a node. It also updates RFC 4861 and recommends that nodes send unsolicited Neighbor Advertisements upon assigning a new IPv6 address. These changes will minimize the delay and packet loss when a node initiates connections to an off-link destination from a new IPv6 address.¶
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc9131.¶
Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
The Neighbor Discovery state machine defined in [RFC4861] assumes that communications between IPv6 nodes are, in most cases, bidirectional and if a node A is trying to communicate to its neighbor, node B, the return traffic flows could be expected. So, when node A starts the address resolution process, the target node B would also create an entry containing A's IPv6 and link-layer addresses in its Neighbor Cache. That entry will be used for sending the return traffic to A.¶
In particular, Section 7.2.5 of [RFC4861] states:¶
When a valid Neighbor Advertisement is received (either solicited or unsolicited), the Neighbor Cache is searched for the target's entry. If no entry exists, the advertisement SHOULD be silently discarded. There is no need to create an entry if none exists, since the recipient has apparently not initiated any communication with the target.¶
While this approach is perfectly suitable for host-to-host on-link communications, it does not work so well when a host sends traffic to off-link destinations. After joining the network and receiving a Router Advertisement, the host populates its Neighbor Cache with the default router IPv6 and link-layer addresses and is able to send traffic to off-link destinations. At the same time, the router does not have any cache entries for the host global addresses yet and only starts address resolution upon receiving the first packet of the return traffic flow. While waiting for the resolution to complete, routers only keep a very small number of packets in the queue, as recommended in Section 7.2.2 of [RFC4861]. Any additional packets arriving before the resolution > process finishes are likely to result in dropped packets. It can cause packet loss and performance degradation that can be visible to users.¶
This document updates the Neighbor Discovery protocol [RFC4861] to avoid packet loss in the scenario described above. Section 4 discusses the changes and analyzes the potential impact, while normative changes to [RFC4861] are specified in Section 6.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
The most typical scenario when the problem described in this document may arise is a host joining the network, forming a new address, and using that address for accessing the Internet:¶
This scenario illustrates the problem occurring when the device connects to the network for the first time or after an inactivity period long enough for the device's address to be removed from the router's Neighbor Cache. However, the same sequence of events happens when the host starts using a new global address previously unseen by the router, such as a new privacy address [RFC8981] or if the router's Neighbor Cache has been flushed.¶
While in dual-stack networks this problem might be hidden by Happy Eyeballs [RFC8305], it manifests quite clearly in IPv6-only environments, especially wireless environments, leading to poor user experience and contributing to a negative perception of IPv6-only solutions as unstable and non-deployable.¶
It would be highly desirable to improve the Neighbor Discovery mechanics so routers have a usable cache entry for a host address by the time the router receives the first packet for that address. In particular:¶
In addition, the solution must not exacerbate issues described in [RFC6583] and needs to be compatible with the recommendations provided in [RFC6583].¶
The following changes are required to minimize the delay in creating new entries in a router's Neighbor Cache:¶
The following sections discuss these changes in more detail. Normative changes are specified in Section 6.¶
Section 7.2.6 of [RFC4861] discusses using unsolicited Neighbor Advertisements to inform node neighbors of the new link-layer address quickly. The same mechanism could be used to notify the node neighbors about the new network-layer address as well: the node can send gratuitous unsolicited Neighbor Advertisements upon assigning a new IPv6 address to its interface.¶
To minimize potential disruption in the case of duplicate addresses, the node should not set the Override flag for a preferred address and must not set the Override flag if the address is in the Optimistic state [RFC4429].¶
As the main purpose of sending unsolicited NAs upon configuring a new address is to proactively create a Neighbor Cache entry on the first-hop routers, the gratuitous NAs are sent to the all-routers multicast address (ff02::2). Limiting the recipients to routers only would help reduce the multicast noise level. If the link-layer devices are performing Multicast Listener Discovery (MLD) snooping [RFC4541], then those unsolicited NAs will only be sent to routers on the given network segment/link, instead of being flooded to all nodes.¶
It should be noted that the mechanism discussed here does not cause any significant increase in multicast traffic. The additional multicast unsolicited NAs would proactively create a STALE cache entry on routers, as discussed below. When the router receives the return traffic flows, it does not need to send multicast NSes to the solicited-node multicast address but would be sending unicast NSes instead. Therefore, this procedure would only produce an increase in the overall amount of multicast traffic if no return traffic arrives for the address that sent the unsolicited NA or if the router does not create a STALE entry upon receiving such an NA. The increase would be negligible, as that additional traffic is a few orders of magnitude less than the usual level of Neighbor Discovery multicast traffic.¶
Section 7.2.5 of [RFC4861] states:¶
When a valid Neighbor Advertisement is received (either solicited or unsolicited), the Neighbor Cache is searched for the target's entry. If no entry exists, the advertisement SHOULD be silently discarded. There is no need to create an entry if none exists, since the recipient has apparently not initiated any communication with the target.¶
The reasoning behind dropping unsolicited Neighbor Advertisements ("the recipient has apparently not initiated any communication with the target") is valid for on-link host-to-host communication but, as discussed above, it does not really apply for the scenario when the host is announcing its address to routers. Therefore, it would be beneficial to allow routers to create new entries upon receiving an unsolicited Neighbor Advertisement.¶
This document updates [RFC4861] so that routers create a new Neighbor Cache entry upon receiving an unsolicited Neighbor Advertisement for an address that does not already have a Neighbor Cache entry. These changes do not modify the router behavior specified in [RFC4861] for the scenario when the corresponding Neighbor Cache entry already exists.¶
The next section analyzes various scenarios of duplicated addresses and discusses the potential impact of creating a STALE entry for a duplicated IPv6 address.¶
If nodes following the recommendations in this document are using the DAD mechanism defined in [RFC4862], they would send unsolicited NAs as soon as the address changes the state from tentative to preferred (after its uniqueness has been verified). However, nodes willing to minimize network stack configuration delays might be using Optimistic Addresses, which means there is a possibility of the address not being unique on the link. Section 2.2 of [RFC4429] discusses measures to ensure that ND packets from the Optimistic Address do not override any existing Neighbor Cache entries, as it would cause interruption of the rightful address owner's traffic in the case of an address conflict. As nodes willing to speed up their network stack configuration are most likely to be affected by the problem outlined in this document, it seems reasonable for such hosts to advertise their Optimistic Addresses by sending unsolicited NAs. The main question to consider is the potential risk of overriding the cache entry for the rightful address owner if the Optimistic Address happens to be duplicated.¶
The following sections discuss the address collision scenario when a node sends an unsolicited NA for an address in the Optimistic state, while another node (the rightful owner) already has the same address assigned. This document uses the term "the rightful owner", as the same terminology is used in [RFC4429]. The analysis assumes that the host performs DAD, as Section 5.4 of [RFC4862] requires that DAD MUST be performed on all unicast addresses prior to assigning them to an interface.¶
If the router's Neighbor Cache entry for the target address already exists in any state other than INCOMPLETE, then as per Section 7.2.5 of [RFC4861], an unsolicited NA with the Override flag cleared would change the entry state from REACHABLE to STALE but would not update the entry in any other way. Therefore, even if the host sends an unsolicited NA from its Optimistic Address, the router's cache entry would not be updated with the new link-layer address and no impact on the traffic for the rightful address owner is expected.¶
The return traffic intended for the host with the Optimistic Address would be sent to the rightful owner. However, this is unavoidable with or without the unsolicited NA mechanism.¶
Another corner case is the INCOMPLETE cache entry for the address.¶
As a result, some packets (packets in the buffer at Step 6 and all packets arriving between Step 6 and Step 8) are delivered to the host with the Optimistic Address, while some of them, if not all, are intended for the rightful owner. Without the unsolicited NA, one or more packets that are in the buffer at Step 8 (usually just one packet, but some routers may buffer a few) would have been delivered to the rightful owner and the rest of the packets would have been dropped. However, the probability of such a scenario is rather low, as it would require the following things to happen almost simultaneously (within tens of milliseconds in most cases):¶
It should be noted that in this scenario the rightful owner does not send any unsolicited NAs before sending packets. If the rightful owner implements the functionality described in this document and sends unsolicited NAs upon configuring its address, then the router creates a STALE entry for the address, causing all packets to be delivered to the rightful owner (see Section 5.1). The rightful owner would experience no disruption but might receive some packets intended for the host with an Optimistic Address.¶
This section focuses on the scenario when the solicited NA from the rightful owner arrives after the unsolicited one sent from the Optimistic Address (Step 7 and Step 4, respectively). If the solicited NA arrives first, it changes the NC entry state from INCOMPLETE to REACHABLE. As discussed in Section 5.1, there will be no disruption for the rightful owner if the router already has a REACHABLE entry for the address when an unsolicited NA is received.¶
There are two distinct scenarios that can lead to the situation when the router does not have an NC entry for the IPv6 address:¶
The impact on the rightful owner's traffic flows would be different in those cases.¶
In this scenario, the following events are expected to happen:¶
The rightful owner is not experiencing any disruption, as it does not send any traffic. It would only start receiving packets intended for another host after Step 8 is completed and only if return packets for the communication initiated at Step 2 are still arriving.¶
However, the same behavior would be observed if the changes specified in this document are not implemented. If the host starts sending packets from its Optimistic Address but then changes the address state to Duplicated, the first return packet would trigger the address resolution process and would be buffered until the resolution is completed. The buffered packet(s) and any packets still arriving after the address is resolved would be forwarded to the rightful owner of the address. So, the rightful owner might still receive one or more packets from the flows intended for another host. Therefore, it's safe to conclude that the changes specified in this document do not introduce any disruption for the rightful owner of the duplicated address.¶
In this scenario, the following events are happening:¶
As a result, the traffic for the address rightful owner would be sent to the host with the duplicated address instead. The duration of the disruption can be estimated as DELAY_FIRST_PROBE_TIME*1000 + (MAX_UNICAST_SOLICIT - 1)*RetransTimer milliseconds. As per the constants defined in Section 10 of [RFC4861], this interval is equal to 5*1000 + (3 - 1)*1000 = 7000 milliseconds, or 7 seconds.¶
However, it should be noted that the probability of such a scenario is rather low. Similar to the scenario discussed in Section 5.2, it would require the following things to happen almost simultaneously (within tens of milliseconds in most cases):¶
As discussed in Section 5.2, the disruption for the rightful owner can easily be prevented if that node implements the mechanism described in this document. Sending unsolicited NAs before initiating off-link communication would create a STALE entry in the router's NC and prevent any traffic to that address from being sent to the host with the Optimistic Address (see Section 5.1).¶
All normative text in this memo is contained in this section.¶
This document makes the following changes to Section 7.2.5 of [RFC4861]:¶
The text in RFC 4861 is as follows:¶
When a valid Neighbor Advertisement is received (either solicited or unsolicited), the Neighbor Cache is searched for the target's entry. If no entry exists, the advertisement SHOULD be silently discarded. There is no need to create an entry if none exists, since the recipient has apparently not initiated any communication with the target.¶
This document updates the text as follows:¶
When a valid Neighbor Advertisement is received (either solicited or unsolicited), the Neighbor Cache is searched for the target's entry. If no entry exists:¶
- Hosts SHOULD silently discard the advertisement. There is no need to create an entry if none exists, since the recipient has apparently not initiated any communication with the target.¶
- Routers SHOULD create a new entry for the target address with the link-layer address set to the Target Link-Layer Address Option (if supplied). The entry's reachability state MUST be set to STALE. If the received Neighbor Advertisement does not contain the Target Link-Layer Address Option, the advertisement SHOULD be silently discarded.¶
This document makes the following changes to Section 7.2.6 of [RFC4861]:¶
The text in RFC 4861 is as follows:¶
Also, a node belonging to an anycast address MAY multicast unsolicited Neighbor Advertisements for the anycast address when the node's link-layer address changes.¶
This document updates the text as follows:¶
Also, a node belonging to an anycast address MAY multicast unsolicited Neighbor Advertisements for the anycast address when the node's link-layer address changes.¶
A node may also wish to notify its first-hop routers when it configures a new global IPv6 address so the routers can proactively populate their Neighbor Caches with the corresponding entries. In such cases, a node SHOULD send up to MAX_NEIGHBOR_ADVERTISEMENT Neighbor Advertisement messages. If the address is preferred, then the Override flag SHOULD NOT be set. If the address is in the Optimistic state, then the Override flag MUST NOT be set. The destination address SHOULD be set to the all-routers multicast address. These advertisements MUST be separated by at least RetransTimer seconds. The first advertisement SHOULD be sent as soon as one of the following events happens:¶
The solution described in this document provides some improvement for a node configuring a new IPv6 address and starting to send traffic from it. However, that approach does not completely eliminate the scenario when a router receives some transit traffic for an address without the corresponding Neighbor Cache entry. For example:¶
There are other possible approaches to address the problem. For example:¶
It should be noted that some of those options are already implemented by some vendors. The following sections discuss those approaches and the reasons they were discarded.¶
One of the possible approaches might be to declare that everything is working as intended and let the upper-layer protocols deal with packet loss. The obvious drawbacks include:¶
The most radical approach would be to move away from the reactive ND as defined in [RFC4861] and expand the registration-based ND [RFC6775] [RFC8505] used in IPv6 over Low-Power Wireless Personal Area Networks (6LoWPANs) to the rest of the IPv6 deployments. This option requires some investigation and discussion. However, significant changes to the existing IPv6 implementations would be needed, so an unclear adoption timeline makes this approach less preferable than the approach specified in this document.¶
The host could force the creation of a STALE entry for its GUA in the router's ND cache by sending the following Neighbor Solicitation message:¶
The main disadvantages of this approach are as follows:¶
The host could send a Router Solicitation message to the all-routers multicast address, using its GUA as a source. If the host link-layer address is included in the Source Link-Layer Address Option, the router would create a STALE entry for the host GUA as per Section 6.2.6 of [RFC4861]. However, this approach cannot be used if the GUA is in the Optimistic state: Section 2.2 of [RFC4429] explicitly prohibits using an Optimistic Address as the source address of a Router Solicitation with a SLLAO, as it might cause disruption for the rightful owner of the address in the case of a collision. So, for the Optimistic Addresses, the host can send an RS without a SLLAO included. In that case, the router may respond with either a multicast or a unicast RA (only the latter would create a cache entry).¶
This approach has the following drawbacks:¶
Routers may be able to learn about new addresses by gleaning from the DAD Neighbor Solicitation messages. The router could listen to all solicited-node multicast address groups and, upon receiving a Neighbor Solicitation from the unspecified address, search its Neighbor Cache for the solicitation's Target Address. If no entry exists, the router may create an entry, set its reachability state to INCOMPLETE, and start the address resolution process for that entry.¶
The same solution was proposed in [ND-ADDR-RES]. Some routing vendors already support such optimization. However, this approach has a number of drawbacks and therefore should not be used as the only solution:¶
The host may force the router to start address resolution by sending a data packet such as ping or traceroute to its default router link-local address, using the GUA as a source address. As the RTT to the default router is lower than the RTT to any off-link destinations, it's quite likely that the router would start the Neighbor Discovery process for the host GUA before the first packet of the returning traffic arrives.¶
This approach has the following drawbacks:¶
Theoretically, the probing logic on hosts might be modified to better deal with initial packet loss. For example, only one probe can be sent, or probe retransmit intervals can be reduced. However, this approach has a number of drawbacks:¶
Some implementations need to send multiple probes. Examples include but are not limited to:¶
While it would increase the probability that the probing will complete successfully, there are multiple cases when packet loss would still occur:¶
Increasing the buffer size and buffering more packets would exacerbate issues described in [RFC6583] and make the router more vulnerable to ND-based denial-of-service attacks.¶
When a router receives a transit packet sourced by an on-link neighbor node, it might check for the presence of a Neighbor Cache entry for the packet source address and, if the entry does not exist, start the address resolution process. This approach does ensure that a Neighbor Cache entry is proactively created every time a new, previously unseen GUA is used for sending off-link traffic. However, this approach has a number of limitations. In particular:¶
This document has no IANA actions.¶
One of the potential attack vectors to consider is cache spoofing, where the attacker might try to install a cache entry for the victim's IPv6 address and the attacker's link-layer address. However, it should be noted that this document does not propose any changes for the scenario when the ND cache for a given IPv6 address already exists. Therefore, there are no new vectors for an attacker to override an existing cache entry.¶
Section 5 describes some corner cases when a host with a duplicated Optimistic Address might get some packets intended for the rightful owner of the address. However, such scenarios do not introduce any new attack vectors: even without the changes discussed in this document, an attacker can easily override the router's Neighbor Cache and redirect the traffic by sending NAs with the Solicited flag set. As discussed in Section 5.3.2, the worst-case scenario might cause a disruption for up to 7 seconds. Because this scenario is highly unlikely, this risk of disruption is considered acceptable. More importantly, for all cases described in Section 5, the rightful owner can prevent disruption caused by an accidental address duplication just by implementing the mechanism described in this document. If the rightful owner sends unsolicited NAs before using the address, the STALE entry would be created on the router's NC, and any subsequent unsolicited NAs sent from the host with an Optimistic Address would not override the NC entry.¶
A malicious host could attempt to exhaust the Neighbor Cache on the router by creating a large number of STALE entries. However, this attack vector is not new, and the mechanism specified in this document does not increase the risk of such an attack: the attacker could do it, for example, by sending an NS or RS packet with a SLLAO included. All recommendations from [RFC6583] still apply.¶
Announcing a new address to the all-routers multicast address may inform an on-link attacker about IPv6 addresses assigned to the host. However, hiding information about the specific IPv6 address should not be considered a security measure, as such information is usually disclosed via DAD to all nodes anyway if MLD snooping is not enabled. Network administrators can also mitigate this issue by enabling MLD snooping on the link-layer devices to prevent IPv6 link-local multicast packets from being flooded to all on-link nodes. If peer-to-peer on-link communications are not desirable for a given network segment, they should be prevented by proper Layer 2 security mechanisms. Therefore, the risk of allowing hosts to send unsolicited Neighbor Advertisements to the all-routers multicast address is low.¶
It should be noted that the mechanism discussed in this document allows hosts to proactively inform their routers about global IPv6 addresses existing on-link. Routers could use that information to distinguish between used and unused addresses to mitigate ND cache exhaustion DoS attacks as described in Section 4.3.2 of [RFC3756] and in [RFC6583].¶
Thanks to the following people (in alphabetical order) for their comments, review, and feedback: Mikael Abrahamsson, Stewart Bryant, Lorenzo Colitti, Roman Danyliw, Owen DeLong, Martin Duke, Igor Gashinsky, Carles Gomez, Fernando Gont, Tatuya Jinmei, Benjamin Kaduk, Scott Kelly, Erik Kline, Warren Kumari, Barry Leiba, Jordi Palet Martinez, Erik Nordmark, Michael Richardson, Dan Romascanu, Zaheduzzaman Sarker, Michael Scharf, John Scudder, Mark Smith, Dave Thaler, Pascal Thubert, Loganaden Velvindron, and Éric Vyncke.¶