idnits 2.17.1 draft-ietf-ipngwg-discovery-v2-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-27) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: 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. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 524 instances of too long lines in the document, the longest one being 3 characters in excess of 72. == There are 2 instances of lines with non-RFC3849-compliant IPv6 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 3968 has weird spacing: '...k-layer add...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- Couldn't find a document date in the document -- date freshness check skipped. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'ANYCST' is defined on line 3710, but no explicit reference was found in the text == Unused Reference: 'IPv6-SA' is defined on line 3732, but no explicit reference was found in the text ** Obsolete normative reference: RFC 1971 (ref. 'ADDRCONF') (Obsoleted by RFC 2462) -- No information found for - is the name correct? -- Possible downref: Normative reference to a draft: ref. 'ADDR-ARCH' ** Downref: Normative reference to an Informational RFC: RFC 1546 (ref. 'ANYCST') ** Obsolete normative reference: RFC 1885 (ref. 'ICMPv6') (Obsoleted by RFC 2463) ** Obsolete normative reference: RFC 1883 (ref. 'IPv6') (Obsoleted by RFC 2460) ** Obsolete normative reference: RFC 1972 (ref. 'IPv6-ETHER') (Obsoleted by RFC 2464) ** Obsolete normative reference: RFC 1825 (ref. 'IPv6-SA') (Obsoleted by RFC 2401) ** Obsolete normative reference: RFC 1826 (ref. 'IPv6-AUTH') (Obsoleted by RFC 2402) ** Obsolete normative reference: RFC 1827 (ref. 'IPv6-ESP') (Obsoleted by RFC 2406) ** Downref: Normative reference to an Informational RFC: RFC 1620 (ref. 'SH-MEDIA') ** Obsolete normative reference: RFC 1700 (ref. 'ASSIGNED') (Obsoleted by RFC 3232) -- Possible downref: Non-RFC (?) normative reference: ref. 'SYNC' Summary: 19 errors (**), 0 flaws (~~), 6 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 INTERNET-DRAFT Thomas Narten, IBM 3 July 30, 1997 Erik Nordmark, Sun Microsystems 4 W A Simpson, Daydreamer 6 Neighbor Discovery for IP Version 6 (IPv6) | 8 | 10 Status of this Memo 12 This document is an Internet-Draft. Internet-Drafts are working * 13 documents of the Internet Engineering Task Force (IETF), its areas, 14 and its working groups. Note that other groups may also distribute 15 working documents as Internet-Drafts. 17 Internet-Drafts are draft documents valid for a maximum of six months 18 and may be updated, replaced, or obsoleted by other documents at any 19 time. It is inappropriate to use Internet-Drafts as reference 20 material or to cite them other than as ``work in progress.'' 22 To learn the current status of any Internet-Draft, please check the 23 ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow 24 Directories on ds.internic.net (US East Coast), nic.nordu.net 25 (Europe), ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific 26 Rim). 28 Distribution of this memo is unlimited. 30 This Internet Draft expires January 30, 1998. | 32 Abstract 34 This document specifies the Neighbor Discovery protocol for IP * 35 Version 6. IPv6 nodes on the same link use Neighbor Discovery to 36 discover each other's presence, to determine each other's link-layer 37 addresses, to find routers and to maintain reachability information 38 about the paths to active neighbors. * 39 Contents 41 1. INTRODUCTION............................................. 4 * 43 2. TERMINOLOGY.............................................. 5 | 44 2.1. General............................................. 5 | 45 2.2. Link Types.......................................... 8 46 2.3. Addresses........................................... 9 47 2.4. Requirements........................................ 10 49 3. PROTOCOL OVERVIEW........................................ 11 50 3.1. Comparison with IPv4................................ 14 | 51 3.2. Supported Link Types................................ 16 53 4. MESSAGE FORMATS.......................................... 18 54 4.1. Router Solicitation Message Format.................. 18 55 4.2. Router Advertisement Message Format................. 19 56 4.3. Neighbor Solicitation Message Format................ 22 57 4.4. Neighbor Advertisement Message Format............... 23 | 58 4.5. Redirect Message Format............................. 26 59 4.6. Option Formats...................................... 28 60 4.6.1. Source/Target Link-layer Address............... 28 | 61 4.6.2. Prefix Information............................. 29 | 62 4.6.3. Redirected Header.............................. 31 | 63 4.6.4. MTU............................................ 32 | 65 5. CONCEPTUAL MODEL OF A HOST............................... 33 | 66 5.1. Conceptual Data Structures.......................... 34 67 5.2. Conceptual Sending Algorithm........................ 36 68 5.3. Garbage Collection and Timeout Requirements......... 37 | 70 6. ROUTER AND PREFIX DISCOVERY.............................. 38 71 6.1. Message Validation.................................. 39 72 6.1.1. Validation of Router Solicitation Messages..... 39 73 6.1.2. Validation of Router Advertisement Messages.... 40 74 6.2. Router Specification................................ 40 75 6.2.1. Router Configuration Variables................. 40 | 76 6.2.2. Becoming An Advertising Interface.............. 44 77 6.2.3. Router Advertisement Message Content........... 45 78 6.2.4. Sending Unsolicited Router Advertisements...... 46 79 6.2.5. Ceasing To Be An Advertising Interface......... 47 80 6.2.6. Processing Router Solicitations................ 48 | 81 6.2.7. Router Advertisement Consistency............... 49 82 6.2.8. Link-local Address Change...................... 50 | 83 6.3. Host Specification.................................. 50 84 6.3.1. Host Configuration Variables................... 50 85 6.3.2. Host Variables................................. 51 | 86 6.3.3. Interface Initialization....................... 52 | 87 6.3.4. Processing Received Router Advertisements...... 52 | 88 6.3.5. Timing out Prefixes and Default Routers........ 55 | 89 6.3.6. Default Router Selection....................... 55 | 90 6.3.7. Sending Router Solicitations................... 56 | 92 7. ADDRESS RESOLUTION AND NEIGHBOR UNREACHABILITY DETECTION. 58 | 93 7.1. Message Validation.................................. 58 | 94 7.1.1. Validation of Neighbor Solicitations........... 58 | 95 7.1.2. Validation of Neighbor Advertisements.......... 59 | 96 7.2. Address Resolution.................................. 60 | 97 7.2.1. Interface Initialization....................... 60 | 98 7.2.2. Sending Neighbor Solicitations................. 60 | 99 7.2.3. Receipt of Neighbor Solicitations.............. 61 | 100 7.2.4. Sending Solicited Neighbor Advertisements...... 62 | 101 7.2.5. Receipt of Neighbor Advertisements............. 63 | 102 7.2.6. Sending Unsolicited Neighbor Advertisements.... 64 | 103 7.2.7. Anycast Neighbor Advertisements................ 65 | 104 7.2.8. Proxy Neighbor Advertisements.................. 66 | 105 7.3. Neighbor Unreachability Detection................... 67 | 106 7.3.1. Reachability Confirmation...................... 67 | 107 7.3.2. Neighbor Cache Entry States.................... 68 | 108 7.3.3. Node Behavior.................................. 69 | 110 8. REDIRECT FUNCTION........................................ 71 | 111 8.1. Validation of Redirect Messages..................... 72 | 112 8.2. Router Specification................................ 73 | 113 8.3. Host Specification.................................. 74 | 115 9. EXTENSIBILITY - OPTION PROCESSING........................ 75 | 117 10. PROTOCOL CONSTANTS...................................... 76 | 119 11. SECURITY CONSIDERATIONS................................. 77 | 121 12. RENUMBERING CONSIDERATIONS.............................. 79 | 123 REFERENCES................................................... 81 | 125 AUTHORS' ADDRESSES........................................... 82 | 127 APPENDIX A: MULTIHOMED HOSTS................................. 83 | 129 APPENDIX B: FUTURE EXTENSIONS................................ 84 | 131 APPENDIX C: STATE MACHINE FOR THE REACHABILITY STATE......... 85 | 133 APPENDIX D: SUMMARY OF ISROUTER RULES........................ 87 | 134 APPENDIX E: IMPLEMENTATION ISSUES............................ 88 | 136 Appendix E.1: Reachability confirmations.................. 88 | 138 APPENDIX F: CHANGES SINCE RFC 1970........................... 89 | 140 1. INTRODUCTION 142 This specification defines the Neighbor Discovery (ND) protocol for 143 Internet Protocol Version 6 (IPv6). Nodes (hosts and routers) use 144 Neighbor Discovery to determine the link-layer addresses for 145 neighbors known to reside on attached links and to quickly purge 146 cached values that become invalid. Hosts also use Neighbor Discovery 147 to find neighboring routers that are willing to forward packets on 148 their behalf. Finally, nodes use the protocol to actively keep track 149 of which neighbors are reachable and which are not, and to detect 150 changed link-layer addresses. When a router or the path to a router 151 fails, a host actively searches for functioning alternates. 153 Unless specified otherwise (in a document that covers operating IP 154 over a particular link type) this document applies to all link types. 155 However, because ND uses link-layer multicast for some of its 156 services, it is possible that on some link types (e.g., NBMA links) 157 alternative protocols or mechanisms to implement those services will 158 be specified (in the appropriate document covering the operation of 159 IP over a particular link type). The services described in this 160 document that are not directly dependent on multicast, such as 161 Redirects, Next-hop determination, Neighbor Unreachability Detection, 162 etc., are expected to be provided as specified in this document. The 163 details of how one uses ND on NBMA links is an area for further 164 study. 166 The authors would like to acknowledge the contributions of the IPNGWG | 167 working group and, in particular, (in alphabetical order) Ran 168 Atkinson, Jim Bound, Scott Bradner, Alex Conta, Stephen Deering, | 169 Richard Draves, Francis Dupont, Robert Elz, Robert Gilligan, Robert 170 Hinden, Allison Mankin, Dan McDonald, Charles Perkins, Matt Thomas, 171 and Susan Thomson. 173 2. TERMINOLOGY 175 2.1. General 177 IP - Internet Protocol Version 6. The terms IPv4 and 178 IPv6 are used only in contexts where necessary to 179 avoid ambiguity. 181 ICMP - Internet Message Control Protocol for the Internet 182 Protocol Version 6. The terms ICMPv4 and ICMPv6 are 183 used only in contexts where necessary to avoid 184 ambiguity. 186 node - a device that implements IP. 188 router - a node that forwards IP packets not explicitly 189 addressed to itself. 191 host - any node that is not a router. 193 upper layer - a protocol layer immediately above IP. Examples are 194 transport protocols such as TCP and UDP, control 195 protocols such as ICMP, routing protocols such as 196 OSPF, and internet or lower-layer protocols being 197 "tunneled" over (i.e., encapsulated in) IP such as 198 IPX, AppleTalk, or IP itself. 200 link - a communication facility or medium over which nodes 201 can communicate at the link layer, i.e., the layer 202 immediately below IP. Examples are Ethernets 203 (simple or bridged), PPP links, X.25, Frame Relay, 204 or ATM networks as well as internet (or higher) 205 layer "tunnels", such as tunnels over IPv4 or IPv6 206 itself. 208 interface - a node's attachment to a link. 210 neighbors - nodes attached to the same link. 212 address - an IP-layer identifier for an interface or a set of 213 interfaces. 215 anycast address 216 - an identifier for a set of interfaces (typically 217 belonging to different nodes). A packet sent to an 218 anycast address is delivered to one of the 219 interfaces identified by that address (the "nearest" 220 one, according to the routing protocol's measure of 221 distance). See [ADDR-ARCH]. 223 Note that an anycast address is syntactically 224 indistinguishable from a unicast address. Thus, 225 nodes sending packets to anycast addresses don't 226 generally know that an anycast address is being 227 used. Throughout the rest of this document, 228 references to unicast addresses also apply to 229 anycast addresses in those cases where the node is 230 unaware that a unicast address is actually an 231 anycast address. 233 prefix - a bit string that consists of some number of initial 234 bits of an address. 236 link-layer address 237 - a link-layer identifier for an interface. Examples 238 include IEEE 802 addresses for Ethernet links and 239 E.164 addresses for ISDN links. 241 on-link - an address that is assigned to an interface on a 242 specified link. A node considers an address to be 243 on-link if: 245 - it is covered by one of the link's prefixes, or 247 - a neighboring router specifies the address as 248 the target of a Redirect message, or 250 - a Neighbor Advertisement message is received for 251 the (target) address, or 253 - any Neighbor Discovery message is received from 254 the address. 256 off-link - the opposite of "on-link"; an address that is not 257 assigned to any interfaces on the specified link. 259 longest prefix match 260 - The process of determining which prefix (if any) in 261 a set of prefixes covers a target address. A target 262 address is covered by a prefix if all of the bits in 263 the prefix match the left-most bits of the target 264 address. When multiple prefixes cover an address, 265 the longest prefix is the one that matches. 267 reachability 268 - whether or not the one-way "forward" path to a 269 neighbor is functioning properly. In particular, 270 whether packets sent to a neighbor are reaching the 271 IP layer on the neighboring machine and are being 272 processed properly by the receiving IP layer. For 273 neighboring routers, reachability means that packets 274 sent by a node's IP layer are delivered to the 275 router's IP layer, and the router is indeed 276 forwarding packets (i.e., it is configured as a 277 router, not a host). For hosts, reachability means 278 that packets sent by a node's IP layer are delivered 279 to the neighbor host's IP layer. 281 packet - an IP header plus payload. 283 link MTU - the maximum transmission unit, i.e., maximum packet 284 size in octets, that can be conveyed in one piece 285 over a link. 287 target - an address about which address resolution 288 information is sought, or an address which is the 289 new first-hop when being redirected. 291 proxy - a router that responds to Neighbor Discovery query 292 messages on behalf of another node. A router acting 293 on behalf of a mobile node that has moved off-link 294 could potentially act as a proxy for the mobile 295 node. 297 ICMP destination unreachable indication 298 - an error indication returned to the original sender 299 of a packet that cannot be delivered for the reasons 300 outlined in [ICMPv6]. If the error occurs on a node 301 other than the node originating the packet, an ICMP 302 error message is generated. If the error occurs on 303 the originating node, an implementation is not 304 required to actually create and send an ICMP error 305 packet to the source, as long as the upper-layer 306 sender is notified through an appropriate mechanism 307 (e.g., return value from a procedure call). Note, 308 however, that an implementation may find it 309 convenient in some cases to return errors to the 310 sender by taking the offending packet, generating an 311 ICMP error message, and then delivering it (locally) 312 through the generic error handling routines. 314 random delay 315 - when sending out messages, it is sometimes necessary 316 to delay a transmission for a random amount of time 317 in order to prevent multiple nodes from transmitting 318 at exactly the same time, or to prevent long-range 319 periodic transmissions from synchronizing with each 320 other [SYNC]. When a random component is required, 321 a node calculates the actual delay in such a way 322 that the computed delay forms a uniformly- 323 distributed random value that falls between the 324 specified minimum and maximum delay times. The 325 implementor must take care to insure that the 326 granularity of the calculated random component and 327 the resolution of the timer used are both high 328 enough to insure that the probability of multiple 329 nodes delaying the same amount of time is small. 331 random delay seed 332 - If a pseudo-random number generator is used in 333 calculating a random delay component, the generator 334 should be initialized with a unique seed prior to 335 being used. Note that it is not sufficient to use 336 the interface token alone as the seed, since 337 interface tokens will not always be unique. To 338 reduce the probability that duplicate interface 339 tokens cause the same seed to be used, the seed 340 should be calculated from a variety of input sources 341 (e.g., machine components) that are likely to be 342 different even on identical "boxes". For example, 343 the seed could be formed by combining the CPU's 344 serial number with an interface token. 346 2.2. Link Types 348 Different link layers have different properties. The ones of concern 349 to Neighbor Discovery are: 351 multicast - a link that supports a native mechanism at the 352 link layer for sending packets to all (i.e., 353 broadcast) or a subset of all neighbors. 355 point-to-point - a link that connects exactly two interfaces. A 356 point-to-point link is assumed to have multicast 357 capability and have a link-local address. 359 non-broadcast multi-access (NBMA) 360 - a link to which more than two interfaces can 361 attach, but that does not support a native form 362 of multicast or broadcast (e.g., X.25, ATM, frame 363 relay, etc.). Note that all link types 364 (including NBMA) are expected to provide 365 multicast service for IP (e.g., using multicast 366 servers), but it is an issue for further study 367 whether ND should use such facilities or an 368 alternate mechanism that provides the equivalent 369 ND services. 371 shared media - a link that allows direct communication among a 372 number of nodes, but attached nodes are 373 configured in such a way that they do not have 374 complete prefix information for all on-link 375 destinations. That is, at the IP level, nodes on 376 the same link may not know that they are 377 neighbors; by default, they communicate through a 378 router. Examples are large (switched) public 379 data networks such as SMDS and B-ISDN. Also 380 known as "large clouds". See [SH-MEDIA]. 382 variable MTU - a link that does not have a well-defined MTU 383 (e.g., IEEE 802.5 token rings). Many links 384 (e.g., Ethernet) have a standard MTU defined by 385 the link-layer protocol or by the specific 386 document describing how to run IP over the link 387 layer. 389 asymmetric reachability 390 - a link where non-reflexive and/or non-transitive 391 reachability is part of normal operation. (Non- 392 reflexive reachability means packets from A reach 393 B but packets from B don't reach A. Non- 394 transitive reachability means packets from A 395 reach B, and packets from B reach C, but packets 396 from A don't reach C.) Many radio links exhibit 397 these properties. 399 2.3. Addresses 401 Neighbor Discovery makes use of a number of different addresses 402 defined in [ADDR-ARCH], including: 404 all-nodes multicast address 405 - the link-local scope address to reach all nodes. 406 FF02::1 408 all-routers multicast address 409 - the link-local scope address to reach all routers. 410 FF02::2 412 solicited-node multicast address 413 - a link-local scope multicast address that is 414 computed as a function of the solicited target's | 415 address. The function is described in [ADDR-ARCH]. | 416 The function is chosen so that IP addresses which | 417 differ only in the high-order bits, e.g., due to | 418 multiple high-order prefixes associated with 419 different providers, will map to the same 420 solicited-node address thereby reducing the number 421 of multicast addresses a node must join. 423 link-local address 424 - a unicast address having link-only scope that can be 425 used to reach neighbors. All interfaces on routers 426 MUST have a link-local address. Also, [ADDRCONF] 427 requires that interfaces on hosts have a link-local 428 address. 430 unspecified address 431 - a reserved address value that indicates the lack of 432 an address (e.g., the address is unknown). It is 433 never used as a destination address, but may be used 434 as a source address if the sender does not (yet) 435 know its own address (e.g., while verifying an 436 address is unused during address autoconfiguration 437 [ADDRCONF]). The unspecified address has a value of 438 0:0:0:0:0:0:0:0. 440 2.4. Requirements 442 The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, | 443 SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this | 444 document, are to be interpreted as described in [KEYWORDS]. 446 This document also makes use of internal conceptual variables to * 447 describe protocol behavior and external variables that an 448 implementation must allow system administrators to change. The 449 specific variable names, how their values change, and how their 450 settings influence protocol behavior are provided to demonstrate 451 protocol behavior. An implementation is not required to have them in 452 the exact form described here, so long as its external behavior is 453 consistent with that described in this document. 455 3. PROTOCOL OVERVIEW 457 This protocol solves a set of problems related to the interaction 458 between nodes attached to the same link. It defines mechanisms for 459 solving each of the following problems: 461 Router Discovery: How hosts locate routers that reside on an 462 attached link. 464 Prefix Discovery: How hosts discover the set of address prefixes 465 that define which destinations are on-link for an 466 attached link. (Nodes use prefixes to distinguish 467 destinations that reside on-link from those only 468 reachable through a router.) 470 Parameter Discovery: How a node learns such link parameters as 471 the link MTU or such Internet parameters as the hop 472 limit value to place in outgoing packets. 474 Address Autoconfiguration: How nodes automatically configure an 475 address for an interface. 477 Address resolution: How nodes determine the link-layer address of 478 an on-link destination (e.g., a neighbor) given only 479 the destination's IP address. 481 Next-hop determination: The algorithm for mapping an IP 482 destination address into the IP address of the 483 neighbor to which traffic for the destination should 484 be sent. The next-hop can be a router or the 485 destination itself. 487 Neighbor Unreachability Detection: How nodes determine that a 488 neighbor is no longer reachable. For neighbors used 489 as routers, alternate default routers can be tried. 490 For both routers and hosts, address resolution can be 491 performed again. 493 Duplicate Address Detection: How a node determines that an 494 address it wishes to use is not already in use by 495 another node. 497 Redirect: How a router informs a host of a better first-hop node 498 to reach a particular destination. 500 Neighbor Discovery defines five different ICMP packet types: A pair 501 of Router Solicitation and Router Advertisement messages, a pair of 502 Neighbor Solicitation and Neighbor Advertisements messages, and a 503 Redirect message. The messages serve the following purpose: 505 Router Solicitation: When an interface becomes enabled, hosts may 506 send out Router Solicitations that request routers to 507 generate Router Advertisements immediately rather than 508 at their next scheduled time. 510 Router Advertisement: Routers advertise their presence together 511 with various link and Internet parameters either 512 periodically, or in response to a Router Solicitation 513 message. Router Advertisements contain prefixes that 514 are used for on-link determination and/or address 515 configuration, a suggested hop limit value, etc. 517 Neighbor Solicitation: Sent by a node to determine the link-layer 518 address of a neighbor, or to verify that a neighbor is 519 still reachable via a cached link-layer address. 520 Neighbor Solicitations are also used for Duplicate 521 Address Detection. 523 Neighbor Advertisement: A response to a Neighbor Solicitation 524 message. A node may also send unsolicited Neighbor 525 Advertisements to announce a link-layer address 526 change. 528 Redirect: Used by routers to inform hosts of a better first hop 529 for a destination. 531 On multicast-capable links, each router periodically multicasts a 532 Router Advertisement packet announcing its availability. A host 533 receives Router Advertisements from all routers, building a list of 534 default routers. Routers generate Router Advertisements frequently 535 enough that hosts will learn of their presence within a few minutes, 536 but not frequently enough to rely on an absence of advertisements to 537 detect router failure; a separate Neighbor Unreachability Detection 538 algorithm provides failure detection. 540 Router Advertisements contain a list of prefixes used for on-link 541 determination and/or autonomous address configuration; flags 542 associated with the prefixes specify the intended uses of a 543 particular prefix. Hosts use the advertised on-link prefixes to 544 build and maintain a list that is used in deciding when a packet's 545 destination is on-link or beyond a router. Note that a destination 546 can be on-link even though it is not covered by any advertised on- 547 link prefix. In such cases a router can send a Redirect informing 548 the sender that the destination is a neighbor. 550 Router Advertisements (and per-prefix flags) allow routers to inform 551 hosts how to perform Address Autoconfiguration. For example, routers 552 can specify whether hosts should use stateful (DHCPv6) and/or 553 autonomous (stateless) address configuration. The exact semantics 554 and usage of the address configuration-related information is 555 specified in [ADDRCONF]. 557 Router Advertisement messages also contain Internet parameters such 558 as the hop limit that hosts should use in outgoing packets and, 559 optionally, link parameters such as the link MTU. This facilitates 560 centralized administration of critical parameters that can be set on 561 routers and automatically propagated to all attached hosts. 563 Nodes accomplish address resolution by multicasting a Neighbor 564 Solicitation that asks the target node to return its link-layer 565 address. Neighbor Solicitation messages are multicast to the 566 solicited-node multicast address of the target address. The target 567 returns its link-layer address in a unicast Neighbor Advertisement 568 message. A single request-response pair of packets is sufficient for 569 both the initiator and the target to resolve each other's link-layer 570 addresses; the initiator includes its link-layer address in the 571 Neighbor Solicitation. 573 Neighbor Solicitation messages can also be used to determine if more 574 than one node has been assigned the same unicast address. The use of 575 Neighbor Solicitation messages for Duplicate Address Detection is 576 specified in [ADDRCONF]. 578 Neighbor Unreachability Detection detects the failure of a neighbor 579 or the failure of the forward path to the neighbor. Doing so 580 requires positive confirmation that packets sent to a neighbor are 581 actually reaching that neighbor and being processed properly by its 582 IP layer. Neighbor Unreachability Detection uses confirmation from 583 two sources. When possible, upper-layer protocols provide a positive 584 confirmation that a connection is making "forward progress", that is, 585 previously sent data is known to have been delivered correctly (e.g., 586 new acknowledgments were received recently). When positive 587 confirmation is not forthcoming through such "hints", a node sends 588 unicast Neighbor Solicitation messages that solicit Neighbor 589 Advertisements as reachability confirmation from the next hop. To 590 reduce unnecessary network traffic, probe messages are only sent to 591 neighbors to which the node is actively sending packets. 593 In addition to addressing the above general problems, Neighbor 594 Discovery also handles the following situations: 596 Link-layer address change - A node that knows its link-layer 597 address has changed can multicast a few (unsolicited) 598 Neighbor Advertisement packets to all nodes to quickly 599 update cached link-layer addresses that have become 600 invalid. Note that the sending of unsolicited 601 advertisements is a performance enhancement only (e.g., 602 unreliable). The Neighbor Unreachability Detection 603 algorithm ensures that all nodes will reliably discover the 604 new address, though the delay may be somewhat longer. 606 Inbound load balancing - Nodes with replicated interfaces may 607 want to load balance the reception of incoming packets 608 across multiple network interfaces on the same link. Such 609 nodes have multiple link-layer addresses assigned to the 610 same interface. For example, a single network driver could 611 represent multiple network interface cards as a single 612 logical interface having multiple link-layer addresses. 613 Load balancing is handled by allowing routers to omit the 614 source link-layer address from Router Advertisement 615 packets, thereby forcing neighbors to use Neighbor 616 Solicitation messages to learn link-layer addresses of 617 routers. Returned Neighbor Advertisement messages can then 618 contain link-layer addresses that differ depending on who 619 issued the solicitation. 621 Anycast addresses - Anycast addresses identify one of a set of 622 nodes providing an equivalent service, and multiple nodes 623 on the same link may be configured to recognize the same 624 Anycast address. Neighbor Discovery handles anycasts by 625 having nodes expect to receive multiple Neighbor 626 Advertisements for the same target. All advertisements for 627 anycast addresses are tagged as being non-Override 628 advertisements. This invokes specific rules to determine 629 which of potentially multiple advertisements should be 630 used. 632 Proxy advertisements - A router willing to accept packets on 633 behalf of a target address that is unable to respond to 634 Neighbor Solicitations can issue non-Override Neighbor 635 Advertisements. There is currently no specified use of 636 proxy, but proxy advertising could potentially be used to 637 handle cases like mobile nodes that have moved off-link. 638 However, it is not intended as a general mechanism to 639 handle nodes that, e.g., do not implement this protocol. 641 3.1. Comparison with IPv4 643 The IPv6 Neighbor Discovery protocol corresponds to a combination of 644 the IPv4 protocols ARP [ARP], ICMP Router Discovery [RDISC], and ICMP 645 Redirect [ICMPv4]. In IPv4 there is no generally agreed upon 646 protocol or mechanism for Neighbor Unreachability Detection, although 647 Hosts Requirements [HR-CL] does specify some possible algorithms for 648 Dead Gateway Detection (a subset of the problems Neighbor 649 Unreachability Detection tackles). 651 The Neighbor Discovery protocol provides a multitude of improvements 652 over the IPv4 set of protocols: 654 Router Discovery is part of the base protocol set; there is no 655 need for hosts to "snoop" the routing protocols. 657 Router advertisements carry link-layer addresses; no additional 658 packet exchange is needed to resolve the router's link-layer 659 address. 661 Router advertisements carry prefixes for a link; there is no 662 need to have a separate mechanism to configure the "netmask". 664 Router advertisements enable Address Autoconfiguration. 666 Routers can advertise an MTU for hosts to use on the link, 667 ensuring that all nodes use the same MTU value on links lacking 668 a well-defined MTU. 670 Address resolution multicasts are "spread" over 4 billion (2^32) 671 multicast addresses greatly reducing address resolution related 672 interrupts on nodes other than the target. Moreover, non-IPv6 673 machines should not be interrupted at all. 675 Redirects contain the link-layer address of the new first hop; 676 separate address resolution is not needed upon receiving a 677 redirect. 679 Multiple prefixes can be associated with the same link. By 680 default, hosts learn all on-link prefixes from Router 681 Advertisements. However, routers may be configured to omit some 682 or all prefixes from Router Advertisements. In such cases hosts 683 assume that destinations are off-link and send traffic to 684 routers. A router can then issue redirects as appropriate. 686 Unlike IPv4, the recipient of an IPv6 redirect assumes that the 687 new next-hop is on-link. In IPv4, a host ignores redirects 688 specifying a next-hop that is not on-link according to the 689 link's network mask. The IPv6 redirect mechanism is analogous 690 to the XRedirect facility specified in [SH-MEDIA]. It is 691 expected to be useful on non-broadcast and shared media links in 692 which it is undesirable or not possible for nodes to know all 693 prefixes for on-link destinations. 695 Neighbor Unreachability Detection is part of the base 696 significantly improving the robustness of packet delivery in the 697 presence of failing routers, partially failing or partitioned 698 links and nodes that change their link-layer addresses. For 699 instance, mobile nodes can move off-link without losing any 700 connectivity due to stale ARP caches. 702 Unlike ARP, Neighbor Discovery detects half-link failures (using 703 Neighbor Unreachability Detection) and avoids sending traffic to 704 neighbors with which two-way connectivity is absent. 706 Unlike in IPv4 Router Discovery the Router Advertisement 707 messages do not contain a preference field. The preference 708 field is not needed to handle routers of different "stability"; 709 the Neighbor Unreachability Detection will detect dead routers 710 and switch to a working one. 712 The use of link-local addresses to uniquely identify routers 713 (for Router Advertisement and Redirect messages) makes it 714 possible for hosts to maintain the router associations in the 715 event of the site renumbering to use new global prefixes. 717 Using the Hop Limit equal to 255 trick Neighbor Discovery is 718 immune to off-link senders that accidentally or intentionally 719 send ND messages. In IPv4 off-link senders can send both ICMP 720 Redirects and Router Advertisement messages. 722 Placing address resolution at the ICMP layer makes the protocol 723 more media-independent than ARP and makes it possible to use 724 standard IP authentication and security mechanisms as 725 appropriate [IPv6-AUTH, IPv6-ESP]. 727 3.2. Supported Link Types 729 Neighbor Discovery supports links with different properties. In the 730 presence of certain properties only a subset of the ND protocol 731 mechanisms are fully specified in this document: 733 point-to-point - Neighbor Discovery handles such links just like 734 multicast links. (Multicast can be trivially 735 provided on point to point links, and interfaces 736 can be assigned link-local addresses.) Neighbor 737 Discovery should be implemented as described in 738 this document. 740 multicast - Neighbor Discovery should be implemented as 741 described in this document. 743 non-broadcast multiple access (NBMA) 744 - Redirect, Neighbor Unreachability Detection and 745 next-hop determination should be implemented as 746 described in this document. Address resolution, 747 and the mechanism for delivering Router 748 Solicitations and Advertisements on NBMA links is 749 not specified in this document. Note that if 750 hosts support manual configuration of a list of 751 default routers, hosts can dynamically acquire 752 the link-layer addresses for their neighbors from 753 Redirect messages. 755 shared media - The Redirect message is modeled after the 756 XRedirect message in [SH-MEDIA] in order to 757 simplify use of the protocol on shared media 758 links. 760 This specification does not address shared media 761 issues that only relate to routers, such as: 763 - How routers exchange reachability information 764 on a shared media link. 766 - How a router determines the link-layer address 767 of a host, which it needs to send redirect 768 messages to the host. 770 - How a router determines that it is the first- 771 hop router for a received packet. 773 The protocol is extensible (through the 774 definition of new options) so that other 775 solutions might be possible in the future. 777 variable MTU - Neighbor Discovery allows routers to specify a 778 MTU for the link, which all nodes then use. All 779 nodes on a link must use the same MTU (or Maximum 780 Receive Unit) in order for multicast to work 781 properly. Otherwise when multicasting a sender, 782 which can not know which nodes will receive the 783 packet, could not determine a minimum packet size 784 all receivers can process. 786 asymmetric reachability 787 - Neighbor Discovery detects the absence of 788 symmetric reachability; a node avoids paths to a 789 neighbor with which it does not have symmetric 790 connectivity. 792 The Neighbor Unreachability Detection will 793 typically identify such half-links and the node 794 will refrain from using them. 796 The protocol can presumably be extended in the 797 future to find viable paths in environments that 798 lack reflexive and transitive connectivity. 800 4. MESSAGE FORMATS 802 4.1. Router Solicitation Message Format 804 Hosts send Router Solicitations in order to prompt routers to 805 generate Router Advertisements quickly. 807 0 1 2 3 808 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 809 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 810 | Type | Code | Checksum | 811 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 812 | Reserved | 813 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 814 | Options ... 815 +-+-+-+-+-+-+-+-+-+-+-+- 817 IP Fields: 819 Source Address 820 An IP address assigned to the sending interface, or 821 the unspecified address if no address is assigned 822 to the sending interface. 824 Destination Address 825 Typically the all-routers multicast address. 827 Hop Limit 255 829 Authentication Header * 830 If a Security Association for the IP Authentication 831 Header exists between the sender and the 832 destination address, then the sender SHOULD include 833 this header. 835 ICMP Fields: 837 Type 133 839 Code 0 841 Checksum The ICMP checksum. See [ICMPv6]. 843 Reserved This field is unused. It MUST be initialized to 844 zero by the sender and MUST be ignored by the 845 receiver. 847 Valid Options: 849 Source link-layer address 850 The link-layer address of the sender, if known. | 851 MUST NOT be included if the Source Address is the | 852 unspecified address. Otherwise it SHOULD be | 853 included on link layers that have addresses. 855 Future versions of this protocol may define new option types. 856 Receivers MUST silently ignore any options they do not recognize 857 and continue processing the message. 859 4.2. Router Advertisement Message Format 861 Routers send out Router Advertisement message periodically, or in 862 response to a Router Solicitation. 864 0 1 2 3 865 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 866 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 867 | Type | Code | Checksum | 868 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 869 | Cur Hop Limit |M|O| Reserved | Router Lifetime | 870 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 871 | Reachable Time | 872 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 873 | Retrans Timer | 874 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 875 | Options ... 876 +-+-+-+-+-+-+-+-+-+-+-+- 878 IP Fields: 880 Source Address 881 MUST be the link-local address assigned to the 882 interface from which this message is sent. 884 Destination Address 885 Typically the Source Address of an invoking Router 886 Solicitation or the all-nodes multicast address. 888 Hop Limit 255 890 Authentication Header * 891 If a Security Association for the IP Authentication 892 Header exists between the sender and the 893 destination address, then the sender SHOULD include 894 this header. 896 ICMP Fields: 898 Type 134 900 Code 0 902 Checksum The ICMP checksum. See [ICMPv6]. 904 Cur Hop Limit 8-bit unsigned integer. The default value that 905 should be placed in the Hop Count field of the IP 906 header for outgoing IP packets. A value of zero 907 means unspecified (by this router). 909 M 1-bit "Managed address configuration" flag. When 910 set, hosts use the administered (stateful) protocol 911 for address autoconfiguration in addition to any 912 addresses autoconfigured using stateless address 913 autoconfiguration. The use of this flag is 914 described in [ADDRCONF]. 916 O 1-bit "Other stateful configuration" flag. When 917 set, hosts use the administered (stateful) protocol 918 for autoconfiguration of other (non-address) 919 information. The use of this flag is described in 920 [ADDRCONF]. 922 Reserved A 6-bit unused field. It MUST be initialized to 923 zero by the sender and MUST be ignored by the 924 receiver. 926 Router Lifetime 927 16-bit unsigned integer. The lifetime associated 928 with the default router in units of seconds. The 929 maximum value corresponds to 18.2 hours. A 930 Lifetime of 0 indicates that the router is not a 931 default router and SHOULD NOT appear on the default 932 router list. The Router Lifetime applies only to 933 the router's usefulness as a default router; it 934 does not apply to information contained in other 935 message fields or options. Options that need time 936 limits for their information include their own 937 lifetime fields. 939 Reachable Time 32-bit unsigned integer. The time, in 940 milliseconds, that a node assumes a neighbor is 941 reachable after having received a reachability 942 confirmation. Used by the Neighbor Unreachability 943 Detection algorithm (see Section 7.3). A value of 944 zero means unspecified (by this router). 946 Retrans Timer 32-bit unsigned integer. The time, in 947 milliseconds, between retransmitted Neighbor 948 Solicitation messages. Used by address resolution 949 and the Neighbor Unreachability Detection algorithm 950 (see Sections 7.2 and 7.3). A value of zero means 951 unspecified (by this router). 953 Possible options: 955 Source link-layer address 956 The link-layer address of the interface from which 957 the Router Advertisement is sent. Only used on 958 link layers that have addresses. A router MAY omit 959 this option in order to enable inbound load sharing 960 across multiple link-layer addresses. 962 MTU SHOULD be sent on links that have a variable MTU 963 (as specified in the document that describes how to 964 run IP over the particular link type). MAY be sent 965 on other links. 967 Prefix Information 968 These options specify the prefixes that are on-link 969 and/or are used for address autoconfiguration. A 970 router SHOULD include all its on-link prefixes 971 (except the link-local prefix) so that multihomed 972 hosts have complete prefix information about on- 973 link destinations for the links to which they 974 attach. If complete information is lacking, a 975 multihomed host may not be able to chose the 976 correct outgoing interface when sending traffic to 977 its neighbors. 979 Future versions of this protocol may define new option types. 980 Receivers MUST silently ignore any options they do not recognize 981 and continue processing the message. 983 4.3. Neighbor Solicitation Message Format 985 Nodes send Neighbor Solicitations to request the link-layer address 986 of a target node while also providing their own link-layer address to 987 the target. Neighbor Solicitations are multicast when the node needs 988 to resolve an address and unicast when the node seeks to verify the 989 reachability of a neighbor. 991 0 1 2 3 992 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 993 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 994 | Type | Code | Checksum | 995 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 996 | Reserved | 997 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 998 | | 999 + + 1000 | | 1001 + Target Address + 1002 | | 1003 + + 1004 | | 1005 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1006 | Options ... 1007 +-+-+-+-+-+-+-+-+-+-+-+- 1009 IP Fields: 1011 Source Address 1012 Either an address assigned to the interface from 1013 which this message is sent or (if Duplicate Address 1014 Detection is in progress [ADDRCONF]) the 1015 unspecified address. 1017 Destination Address 1018 Either the solicited-node multicast address 1019 corresponding to the target address, or the target 1020 address. 1022 Hop Limit 255 1024 Authentication Header * 1025 If a Security Association for the IP Authentication 1026 Header exists between the sender and the 1027 destination address, then the sender SHOULD include 1028 this header. 1030 ICMP Fields: 1032 Type 135 1034 Code 0 1036 Checksum The ICMP checksum. See [ICMPv6]. 1038 Reserved This field is unused. It MUST be initialized to 1039 zero by the sender and MUST be ignored by the 1040 receiver. 1042 Target Address 1043 The IP address of the target of the solicitation. 1044 It MUST NOT be a multicast address. 1046 Possible options: 1048 Source link-layer address 1049 The link-layer address for the sender. MUST NOT be | 1050 included when the source link-layer address is the | 1051 unspecified address. Otherwise, on link layers | 1052 that have addresses this option MUST be included in 1053 multicast solicitations and SHOULD be included in 1054 unicast solicitations. 1056 Future versions of this protocol may define new option types. 1057 Receivers MUST silently ignore any options they do not recognize 1058 and continue processing the message. 1060 4.4. Neighbor Advertisement Message Format 1062 A node sends Neighbor Advertisements in response to Neighbor 1063 Solicitations and sends unsolicited Neighbor Advertisements in order 1064 to (unreliably) propagate new information quickly. 1066 0 1 2 3 1067 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1068 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1069 | Type | Code | Checksum | 1070 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1071 |R|S|O| Reserved | 1072 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1073 | | 1074 + + 1075 | | 1076 + Target Address + 1077 | | 1078 + + 1079 | | 1080 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1081 | Options ... 1082 +-+-+-+-+-+-+-+-+-+-+-+- 1084 IP Fields: 1086 Source Address 1087 An address assigned to the interface from which the 1088 advertisement is sent. 1090 Destination Address 1091 For solicited advertisements, the Source Address of 1092 an invoking Neighbor Solicitation or, if the 1093 solicitation's Source Address is the unspecified 1094 address, the all-nodes multicast address. 1096 For unsolicited advertisements typically the all- 1097 nodes multicast address. 1099 Hop Limit 255 1101 Authentication Header * 1102 If a Security Association for the IP Authentication 1103 Header exists between the sender and the 1104 destination address, then the sender SHOULD include 1105 this header. 1107 ICMP Fields: 1109 Type 136 1111 Code 0 1113 Checksum The ICMP checksum. See [ICMPv6]. 1115 R Router flag. When set, the R-bit indicates that 1116 the sender is a router. The R-bit is used by 1117 Neighbor Unreachability Detection to detect a 1118 router that changes to a host. 1120 S Solicited flag. When set, the S-bit indicates that 1121 the advertisement was sent in response to a 1122 Neighbor Solicitation from the Destination address. 1123 The S-bit is used as a reachability confirmation 1124 for Neighbor Unreachability Detection. It MUST NOT 1125 be set in multicast advertisements or in 1126 unsolicited unicast advertisements. 1128 O Override flag. When set, the O-bit indicates that 1129 the advertisement should override an existing cache 1130 entry and update the cached link-layer address. 1131 When it is not set the advertisement will not 1132 update a cached link-layer address though it will 1133 update an existing Neighbor Cache entry for which 1134 no link-layer address is known. It SHOULD NOT be 1135 set in solicited advertisements for anycast 1136 addresses and in solicited proxy advertisements. 1137 It SHOULD be set in other solicited advertisements 1138 and in unsolicited advertisements. 1140 Reserved 29-bit unused field. It MUST be initialized to 1141 zero by the sender and MUST be ignored by the 1142 receiver. 1144 Target Address 1145 For solicited advertisements, the Target Address 1146 field in the Neighbor Solicitation message that 1147 prompted this advertisement. For an unsolicited 1148 advertisement, the address whose link-layer address 1149 has changed. The Target Address MUST NOT be a 1150 multicast address. 1152 Possible options: 1154 Target link-layer address 1155 The link-layer address for the target, i.e., the 1156 sender of the advertisement. MUST be included on | 1157 link layers that have addresses. The link-layer | 1158 address is included to ensure that the peer always | 1159 receives a link-layer address in Neighbor | 1160 Advertisements, to avoid the need for different | 1161 processing rules depending on whether the address | 1162 is provided. 1164 Future versions of this protocol may define new option types. 1165 Receivers MUST silently ignore any options they do not recognize 1166 and continue processing the message. 1168 4.5. Redirect Message Format 1170 Routers send Redirect packets to inform a host of a better first-hop 1171 node on the path to a destination. Hosts can be redirected to a 1172 better first-hop router but can also be informed by a redirect that 1173 the destination is in fact a neighbor. The latter is accomplished by 1174 setting the ICMP Target Address equal to the ICMP Destination 1175 Address. 1177 0 1 2 3 1178 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1179 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1180 | Type | Code | Checksum | 1181 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1182 | Reserved | 1183 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1184 | | 1185 + + 1186 | | 1187 + Target Address + 1188 | | 1189 + + 1190 | | 1191 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1192 | | 1193 + + 1194 | | 1195 + Destination Address + 1196 | | 1197 + + 1198 | | 1199 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1200 | Options ... 1201 +-+-+-+-+-+-+-+-+-+-+-+- 1203 IP Fields: 1205 Source Address 1206 MUST be the link-local address assigned to the 1207 interface from which this message is sent. 1209 Destination Address 1210 The Source Address of the packet that triggered the 1211 redirect. 1213 Hop Limit 255 1215 Authentication Header * 1216 If a Security Association for the IP Authentication 1217 Header exists between the sender and the 1218 destination address, then the sender SHOULD include 1219 this header. 1221 ICMP Fields: 1223 Type 137 1225 Code 0 1227 Checksum The ICMP checksum. See [ICMPv6]. 1229 Reserved This field is unused. It MUST be initialized to 1230 zero by the sender and MUST be ignored by the 1231 receiver. 1233 Target Address An IP address that is a better first hop to use for 1234 the ICMP Destination Address. When the target is 1235 the actual endpoint of communication, i.e., the 1236 destination is a neighbor, the Target Address field 1237 MUST contain the same value as the ICMP Destination 1238 Address field. Otherwise the target is a better 1239 first-hop router and the Target Address MUST be the 1240 router's link-local address so that hosts can 1241 uniquely identify routers. 1243 Destination Address 1244 The IP address of the destination which is 1245 redirected to the target. 1247 Possible options: 1249 Target link-layer address 1250 The link-layer address for the target. It SHOULD 1251 be included (if known). Note that on NBMA links, 1252 hosts may rely on the presence of the Target Link- 1253 Layer Address option in Redirect messages as the 1254 means for determining the link-layer addresses of 1255 neighbors. In such cases, the option MUST be 1256 included in Redirect messages. 1258 Redirected Header 1259 As much as possible of the IP packet that triggered 1260 the sending of the Redirect without making the 1261 redirect packet exceed 576 octets. 1263 4.6. Option Formats 1265 Neighbor Discovery messages include zero or more options, some of 1266 which may appear multiple times in the same message. All options are 1267 of the form: 1269 0 1 2 3 1270 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1271 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1272 | Type | Length | ... | 1273 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1274 ~ ... ~ 1275 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1277 Fields: 1279 Type 8-bit identifier of the type of option. The 1280 options defined in this document are: 1282 Option Name Type 1284 Source Link-Layer Address 1 1285 Target Link-Layer Address 2 1286 Prefix Information 3 1287 Redirected Header 4 1288 MTU 5 1290 Length 8-bit unsigned integer. The length of the option 1291 in units of 8 octets. The value 0 is invalid. 1292 Nodes MUST silently discard an ND packet that 1293 contains an option with length zero. 1295 4.6.1. Source/Target Link-layer Address 1296 0 1 2 3 1297 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1298 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1299 | Type | Length | Link-Layer Address ... 1300 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1302 Fields: 1304 Type 1305 1 for Source Link-layer Address 1306 2 for Target Link-layer Address 1308 Length The length of the option in units of 8 octets. For 1309 example, the length for IEEE 802 addresses is 1 1310 [IPv6-ETHER]. 1312 Link-Layer Address 1313 The variable length link-layer address. 1315 The content and format of this field (including 1316 byte and bit ordering) is expected to be specified 1317 in specific documents that describe how IPv6 1318 operates over different link layers. For instance, 1319 [IPv6-ETHER]. 1321 Description 1322 The Source Link-Layer Address option contains the 1323 link-layer address of the sender of the packet. It 1324 is used in the Neighbor Solicitation, Router 1325 Solicitation, and Router Advertisement packets. 1327 The Target Link-Layer Address option contains the 1328 link-layer address of the target. It is used in 1329 Neighbor Advertisement and Redirect packets. 1331 These options MUST be silently ignored for other 1332 Neighbor Discovery messages. 1334 4.6.2. Prefix Information 1335 0 1 2 3 1336 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1337 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1338 | Type | Length | Prefix Length |L|A| Reserved1 | 1339 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1340 | Valid Lifetime | 1341 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1342 | Preferred Lifetime | 1343 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1344 | Reserved2 | 1345 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1346 | | 1347 + + 1348 | | 1349 + Prefix + 1350 | | 1351 + + 1352 | | 1353 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1355 Fields: 1357 Type 3 1359 Length 4 1361 Prefix Length 8-bit unsigned integer. The number of leading bits 1362 in the Prefix that are valid. The value ranges 1363 from 0 to 128. 1365 L 1-bit on-link flag. When set, indicates that this 1366 prefix can be used for on-link determination. When 1367 not set the advertisement makes no statement about 1368 on-link or off-link properties of the prefix. For 1369 instance, the prefix might be used for address 1370 configuration with some of the addresses belonging 1371 to the prefix being on-link and others being off- 1372 link. 1374 A 1-bit autonomous address-configuration flag. When 1375 set indicates that this prefix can be used for 1376 autonomous address configuration as specified in 1377 [ADDRCONF]. 1379 Reserved1 6-bit unused field. It MUST be initialized to zero 1380 by the sender and MUST be ignored by the receiver. 1382 Valid Lifetime 1383 32-bit unsigned integer. The length of time in 1384 seconds (relative to the time the packet is sent) 1385 that the prefix is valid for the purpose of on-link 1386 determination. A value of all one bits 1387 (0xffffffff) represents infinity. The Valid 1388 Lifetime is also used by [ADDRCONF]. 1390 Preferred Lifetime 1391 32-bit unsigned integer. The length of time in 1392 seconds (relative to the time the packet is sent) 1393 that addresses generated from the prefix via 1394 stateless address autoconfiguration remain 1395 preferred [ADDRCONF]. A value of all one bits 1396 (0xffffffff) represents infinity. See [ADDRCONF]. 1398 Reserved2 This field is unused. It MUST be initialized to 1399 zero by the sender and MUST be ignored by the 1400 receiver. 1402 Prefix An IP address or a prefix of an IP address. The 1403 Prefix Length field contains the number of valid 1404 leading bits in the prefix. The bits in the prefix 1405 after the prefix length are reserved and MUST be 1406 initialized to zero by the sender and ignored by 1407 the receiver. A router SHOULD NOT send a prefix 1408 option for the link-local prefix and a host SHOULD 1409 ignore such a prefix option. 1411 Description 1412 The Prefix Information option provide hosts with 1413 on-link prefixes and prefixes for Address 1414 Autoconfiguration. 1416 The Prefix Information option appears in Router 1417 Advertisement packets and MUST be silently ignored 1418 for other messages. 1420 4.6.3. Redirected Header 1421 0 1 2 3 1422 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1423 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1424 | Type | Length | Reserved | 1425 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1426 | Reserved | 1427 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1428 | | 1429 ~ IP header + data ~ 1430 | | 1431 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1433 Fields: 1435 Type 4 1437 Length The length of the option in units of 8 octets. 1439 Reserved These fields are unused. They MUST be initialized 1440 to zero by the sender and MUST be ignored by the 1441 receiver. 1443 IP header + data 1444 The original packet truncated to ensure that the 1445 size of the redirect message does not exceed 576 1446 octets. 1448 Description 1449 The Redirected Header option is used in Redirect 1450 messages and contains all or part of the packet 1451 that is being redirected. 1453 This option MUST be silently ignored for other 1454 Neighbor Discovery messages. 1456 4.6.4. MTU 1458 0 1 2 3 1459 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 1460 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1461 | Type | Length | Reserved | 1462 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1463 | MTU | 1464 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1466 Fields: 1468 Type 5 1470 Length 1 1472 Reserved This field is unused. It MUST be initialized to 1473 zero by the sender and MUST be ignored by the 1474 receiver. 1476 MTU 32-bit unsigned integer. The recommended MTU for 1477 the link. 1479 Description 1480 The MTU option is used in Router Advertisement 1481 messages to insure that all nodes on a link use the 1482 same MTU value in those cases where the link MTU is 1483 not well known. 1485 This option MUST be silently ignored for other 1486 Neighbor Discovery messages. 1488 In configurations in which heterogeneous 1489 technologies are bridged together, the maximum 1490 supported MTU may differ from one segment to 1491 another. If the bridges do not generate ICMP 1492 Packet Too Big messages, communicating nodes will 1493 be unable to use Path MTU to dynamically determine 1494 the appropriate MTU on a per-neighbor basis. In 1495 such cases, routers use the MTU option to specify 1496 an MTU value supported by all segments. 1498 5. CONCEPTUAL MODEL OF A HOST 1500 This section describes a conceptual model of one possible data 1501 structure organization that hosts (and to some extent routers) will 1502 maintain in interacting with neighboring nodes. The described 1503 organization is provided to facilitate the explanation of how the 1504 Neighbor Discovery protocol should behave. This document does not 1505 mandate that implementations adhere to this model as long as their 1506 external behavior is consistent with that described in this document. 1508 This model is only concerned with the aspects of host behavior 1509 directly related to Neighbor Discovery. In particular, it does not 1510 concern itself with such issues as source address selection or the 1511 selecting of an outgoing interface on a multihomed host. 1513 5.1. Conceptual Data Structures 1515 Hosts will need to maintain the following pieces of information for 1516 each interface: 1518 Neighbor Cache 1519 - A set of entries about individual neighbors to 1520 which traffic has been sent recently. Entries are 1521 keyed on the neighbor's on-link unicast IP address 1522 and contain such information as its link-layer 1523 address, a flag indicating whether the neighbor is 1524 a router or a host (called IsRouter in this 1525 document), a pointer to any queued packets waiting 1526 for address resolution to complete, etc. 1528 A Neighbor Cache entry also contains information 1529 used by the Neighbor Unreachability Detection 1530 algorithm, including the reachability state, the 1531 number of unanswered probes, and the time the next 1532 Neighbor Unreachability Detection event is 1533 scheduled to take place. 1535 Destination Cache 1536 - A set of entries about destinations to which 1537 traffic has been sent recently. The Destination 1538 Cache includes both on-link and off-link 1539 destinations and provides a level of indirection 1540 into the Neighbor Cache; the Destination Cache maps 1541 a destination IP address to the IP address of the 1542 next-hop neighbor. This cache is updated with 1543 information learned from Redirect messages. 1544 Implementations may find it convenient to store 1545 additional information not directly related to 1546 Neighbor Discovery in Destination Cache entries, 1547 such as the Path MTU (PMTU) and round trip timers 1548 maintained by transport protocols. 1550 Prefix List - A list of the prefixes that define a set of 1551 addresses that are on-link. Prefix List entries 1552 are created from information received in Router 1553 Advertisements. Each entry has an associated 1554 invalidation timer value (extracted from the 1555 advertisement) used to expire prefixes when they 1556 become invalid. A special "infinity" timer value 1557 specifies that a prefix remains valid forever, 1558 unless a new (finite) value is received in a 1559 subsequent advertisement. 1561 The link-local prefix is considered to be on the 1562 prefix list with an infinite invalidation timer 1563 regardless of whether routers are advertising a 1564 prefix for it. Received Router Advertisements 1565 SHOULD NOT modify the invalidation timer for the 1566 link-local prefix. 1568 Default Router List 1569 - A list of routers to which packets may be sent. 1570 Router list entries point to entries in the 1571 Neighbor Cache; the algorithm for selecting a 1572 default router favors routers known to be reachable 1573 over those whose reachability is suspect. Each 1574 entry also has an associated invalidation timer 1575 value (extracted from Router Advertisements) used 1576 to delete entries that are no longer advertised. 1578 Note that the above conceptual data structures can be implemented 1579 using a variety of techniques. One possible implementation is to use 1580 a single longest-match routing table for all of the above data 1581 structures. Regardless of the specific implementation, it is 1582 critical that the Neighbor Cache entry for a router is shared by all 1583 Destination Cache entries using that router in order to prevent 1584 redundant Neighbor Unreachability Detection probes. 1586 Note also that other protocols (e.g., IPv6 Mobility) might add | 1587 additional conceptual data structures. An implementation is at | 1588 liberty to implement such data structures in any way it pleases. For | 1589 example, an implementation could merge all conceptual data structures | 1590 into a single routing table. 1592 The Neighbor Cache contains information maintained by the Neighbor 1593 Unreachability Detection algorithm. A key piece of information is a 1594 neighbor's reachability state, which is one of five possible values. 1595 The following definitions are informal; precise definitions can be 1596 found in Section 7.3.2. 1598 INCOMPLETE Address resolution is in progress and the link-layer 1599 address of the neighbor has not yet been determined. 1601 REACHABLE Roughly speaking, the neighbor is known to have been 1602 reachable recently (within tens of seconds ago). 1604 STALE The neighbor is no longer known to be reachable but 1605 until traffic is sent to the neighbor, no attempt 1606 should be made to verify its reachability. 1608 DELAY The neighbor is no longer known to be reachable, and 1609 traffic has recently be sent to the neighbor. Rather 1610 than probe the neighbor immediately, however, delay 1611 sending probes for a short while in order to give 1612 upper layer protocols a chance to provide reachability 1613 confirmation. 1615 PROBE The neighbor is no longer known to be reachable, and 1616 unicast Neighbor Solicitation probes are being sent to 1617 verify reachability. 1619 5.2. Conceptual Sending Algorithm 1621 When sending a packet to a destination, a node uses a combination of 1622 the Destination Cache, the Prefix List, and the Default Router List 1623 to determine the IP address of the appropriate next hop, an operation 1624 known as "next-hop determination". Once the IP address of the next 1625 hop is known, the Neighbor Cache is consulted for link-layer 1626 information about that neighbor. 1628 Next-hop determination for a given unicast destination operates as 1629 follows. The sender performs a longest prefix match against the 1630 Prefix List to determine whether the packet's destination is on- or 1631 off-link. If the destination is on-link, the next-hop address is the 1632 same as the packet's destination address. Otherwise, the sender 1633 selects a router from the Default Router List (following the rules 1634 described in Section 6.3.6). If the Default Router List is empty, 1635 the sender assumes that the destination is on-link. 1637 For efficiency reasons, next-hop determination is not performed on 1638 every packet that is sent. Instead, the results of next-hop 1639 determination computations are saved in the Destination Cache (which 1640 also contains updates learned from Redirect messages). When the 1641 sending node has a packet to send, it first examines the Destination 1642 Cache. If no entry exists for the destination, next-hop 1643 determination is invoked to create a Destination Cache entry. 1645 Once the IP address of the next-hop node is known, the sender 1646 examines the Neighbor Cache for link-layer information about that 1647 neighbor. If no entry exists, the sender creates one, sets its state 1648 to INCOMPLETE, initiates Address Resolution, and then queues the data 1649 packet pending completion of address resolution. For multicast- 1650 capable interfaces Address Resolution consists of sending a Neighbor 1651 Solicitation message and waiting for a Neighbor Advertisement. When 1652 a Neighbor Advertisement response is received, the link-layer 1653 addresses is entered in the Neighbor Cache entry and the queued 1654 packet is transmitted. The address resolution mechanism is described 1655 in detail in Section 7.2. 1657 For multicast packets the next-hop is always the (multicast) 1658 destination address and is considered to be on-link. The procedure 1659 for determining the link-layer address corresponding to a given IP 1660 multicast address can be found in a separate document that covers 1661 operating IP over a particular link type (e.g., [IPv6-ETHER]). 1663 Each time a Neighbor Cache entry is accessed while transmitting a 1664 unicast packet, the sender checks Neighbor Unreachability Detection 1665 related information according to the Neighbor Unreachability 1666 Detection algorithm (Section 7.3). This unreachability check might 1667 result in the sender transmitting a unicast Neighbor Solicitation to 1668 verify that the neighbor is still reachable. 1670 Next-hop determination is done the first time traffic is sent to a 1671 destination. As long as subsequent communication to that destination 1672 proceeds successfully, the Destination Cache entry continues to be 1673 used. If at some point communication ceases to proceed, as 1674 determined by the Neighbor Unreachability Detection algorithm, next- 1675 hop determination may need to be performed again. For example, 1676 traffic through a failed router should be switched to a working 1677 router. Likewise, it may be possible to reroute traffic destined for 1678 a mobile node to a "mobility agent". 1680 Note that when a node redoes next-hop determination there is no need 1681 to discard the complete Destination Cache entry. In fact, it is 1682 generally beneficial to retain such cached information as the PMTU 1683 and round trip timer values that may also be kept in the Destination 1684 Cache entry. 1686 Routers and multihomed hosts have multiple interfaces. The remainder 1687 of this document assumes that all sent and received Neighbor 1688 Discovery messages refer to the interface of appropriate context. 1689 For example, when responding to a Router Solicitation, the 1690 corresponding Router Advertisement is sent out the interface on which 1691 the solicitation was received. 1693 5.3. Garbage Collection and Timeout Requirements 1695 The conceptual data structures described above use different 1696 mechanisms for discarding potentially stale or unused information. 1698 From the perspective of correctness there is no need to periodically 1699 purge Destination and Neighbor Cache entries. Although stale 1700 information can potentially remain in the cache indefinitely, the 1701 Neighbor Unreachability Detection algorithm ensures that stale 1702 information is purged quickly if it is actually being used. 1704 To limit the storage needed for the Destination and Neighbor Caches, 1705 a node may need to garbage-collect old entries. However, care must 1706 be taken to insure that sufficient space is always present to hold 1707 the working set of active entries. A small cache may result in an 1708 excessive number of Neighbor Discovery messages if entries are 1709 discarded and rebuilt in quick succession. Any LRU-based policy that 1710 only reclaims entries that have not been used in some time (e.g., ten 1711 minutes or more) should be adequate for garbage-collecting unused 1712 entries. 1714 A node should retain entries in the Default Router List and the 1715 Prefix List until their lifetimes expire. However, a node may 1716 garbage collect entries prematurely if it is low on memory. If not 1717 all routers are kept on the Default Router list, a node should retain 1718 at least two entries in the Default Router List (and preferably more) 1719 in order to maintain robust connectivity for off-link destinations. 1721 When removing an entry from the Prefix List there is no need to purge 1722 any entries from the Destination or Neighbor Caches. Neighbor 1723 Unreachability Detection will efficiently purge any entries in these 1724 caches that have become invalid. When removing an entry from the 1725 Default Router List, however, any entries in the Destination Cache 1726 that go through that router must perform next-hop determination again 1727 to select a new default router. 1729 6. ROUTER AND PREFIX DISCOVERY 1731 This section describes router and host behavior related to the Router 1732 Discovery portion of Neighbor Discovery. Router Discovery is used to 1733 locate neighboring routers as well as learn prefixes and 1734 configuration parameters related to address autoconfiguration. 1736 Prefix Discovery is the process through which hosts learn the ranges 1737 of IP addresses that reside on-link and can be reached directly 1738 without going through a router. Routers send Router Advertisements 1739 that indicate whether the sender is willing to be a default router. 1740 Router Advertisements also contain Prefix Information options that 1741 list the set of prefixes that identify on-link IP addresses. 1743 Stateless Address Autoconfiguration must also obtain subnet prefixes 1744 as part of configuring addresses. Although the prefixes used for 1745 address autoconfiguration are logically distinct from those used for 1746 on-link determination, autoconfiguration information is piggybacked 1747 on Router Discovery messages to reduce network traffic. Indeed, the 1748 same prefixes can be advertised for on-link determination and address 1749 autoconfiguration by specifying the appropriate flags in the Prefix 1750 Information options. See [ADDRCONF] for details on how 1751 autoconfiguration information is processed. 1753 6.1. Message Validation 1755 6.1.1. Validation of Router Solicitation Messages 1757 Hosts MUST silently discard any received Router Solicitation 1758 Messages. 1760 A router MUST silently discard any received Router Solicitation 1761 messages that do not satisfy all of the following validity checks: 1763 - The IP Hop Limit field has a value of 255, i.e., the packet 1764 could not possibly have been forwarded by a router. 1766 - If the message includes an IP Authentication Header, the message 1767 authenticates correctly. 1769 - ICMP Checksum is valid. 1771 - ICMP Code is 0. 1773 - ICMP length (derived from the IP length) is 8 or more octets. 1775 - All included options have a length that is greater than zero. 1777 - If the IP source address is the unspecified address, there is no | 1778 source link-layer address option in the message. | 1780 The contents of the Reserved field, and of any unrecognized options, 1781 MUST be ignored. Future, backward-compatible changes to the protocol 1782 may specify the contents of the Reserved field or add new options; 1783 backward-incompatible changes may use different Code values. 1785 The contents of any defined options that are not specified to be used 1786 with Router Solicitation messages MUST be ignored and the packet 1787 processed as normal. The only defined option that may appear is the 1788 Source Link-Layer Address option. 1790 A solicitation that passes the validity checks is called a "valid 1791 solicitation". 1793 6.1.2. Validation of Router Advertisement Messages 1795 A node MUST silently discard any received Router Advertisement 1796 messages that do not satisfy all of the following validity checks: 1798 - IP Source Address is a link-local address. Routers must use 1799 their link-local address as the source for Router Advertisement 1800 and Redirect messages so that hosts can uniquely identify 1801 routers. 1803 - The IP Hop Limit field has a value of 255, i.e., the packet 1804 could not possibly have been forwarded by a router. 1806 - If the message includes an IP Authentication Header, the message 1807 authenticates correctly. 1809 - ICMP Checksum is valid. 1811 - ICMP Code is 0. 1813 - ICMP length (derived from the IP length) is 16 or more octets. 1815 - All included options have a length that is greater than zero. 1817 The contents of the Reserved field, and of any unrecognized options, 1818 MUST be ignored. Future, backward-compatible changes to the protocol 1819 may specify the contents of the Reserved field or add new options; 1820 backward-incompatible changes may use different Code values. 1822 The contents of any defined options that are not specified to be used 1823 with Router Advertisement messages MUST be ignored and the packet 1824 processed as normal. The only defined options that may appear are 1825 the Source Link-Layer Address, Prefix Information and MTU options. 1827 An advertisement that passes the validity checks is called a "valid 1828 advertisement". 1830 6.2. Router Specification 1832 6.2.1. Router Configuration Variables 1834 A router MUST allow for the following conceptual variables to be 1835 configured by system management. The specific variable names are 1836 used for demonstration purposes only, and an implementation is not 1837 required to have them, so long as its external behavior is consistent 1838 with that described in this document. Default values are specified 1839 to simplify configuration in common cases. 1841 The default values for some of the variables listed below may be 1842 overridden by specific documents that describe how IPv6 operates over 1843 different link layers. This rule simplifies the configuration of 1844 Neighbor Discovery over link types with widely differing performance 1845 characteristics. 1847 For each multicast interface: 1849 AdvSendAdvertisements 1850 A flag indicating whether or not the router sends 1851 periodic Router Advertisements and responds to 1852 Router Solicitations. 1854 Default: FALSE 1856 Note that AdvSendAdvertisements MUST be false by 1857 default so that a node will not accidentally 1858 start acting as a router unless it is explicitly 1859 configured by system management to send Router 1860 Advertisements. 1862 MaxRtrAdvInterval 1863 The maximum time allowed between sending 1864 unsolicited multicast Router Advertisements from 1865 the interface, in seconds. MUST be no less than 1866 4 seconds and no greater than 1800 seconds. 1868 Default: 600 seconds 1870 MinRtrAdvInterval 1871 The minimum time allowed between sending 1872 unsolicited multicast Router Advertisements from 1873 the interface, in seconds. MUST be no less than 1874 3 seconds and no greater than .75 * 1875 MaxRtrAdvInterval. 1877 Default: 0.33 * MaxRtrAdvInterval 1879 AdvManagedFlag 1880 The true/false value to be placed in the "Managed 1881 address configuration" flag field in the Router 1882 Advertisement. See [ADDRCONF]. 1884 Default: FALSE 1886 AdvOtherConfigFlag 1887 The true/false value to be placed in the "Other 1888 stateful configuration" flag field in the Router 1889 Advertisement. See [ADDRCONF]. 1891 Default: FALSE 1893 AdvLinkMTU The value to be placed in MTU options sent by the 1894 router. A value of zero indicates that no MTU 1895 options are sent. 1897 Default: 0 1899 AdvReachableTime 1900 The value to be placed in the Reachable Time 1901 field in the Router Advertisement messages sent 1902 by the router. The value zero means unspecified 1903 (by this router). MUST be no greater than 1904 3,600,000 milliseconds (1 hour). 1906 Default: 0 1908 AdvRetransTimer 1909 The value to be placed in the Retrans Timer field 1910 in the Router Advertisement messages sent by the 1911 router. The value zero means unspecified (by 1912 this router). 1914 Default: 0 1916 AdvCurHopLimit 1917 The default value to be placed in the Cur Hop 1918 Limit field in the Router Advertisement messages 1919 sent by the router. The value should be set to 1920 that current diameter of the Internet. The value 1921 zero means unspecified (by this router). 1923 Default: The value specified in the "Assigned 1924 Numbers" RFC [ASSIGNED] that was in effect at the 1925 time of implementation. 1927 AdvDefaultLifetime 1928 The value to be placed in the Router Lifetime 1929 field of Router Advertisements sent from the 1930 interface, in seconds. MUST be either zero or 1931 between MaxRtrAdvInterval and 9000 seconds. A 1932 value of zero indicates that the router is not to 1933 be used as a default router. 1935 Default: 3 * MaxRtrAdvInterval 1937 AdvPrefixList 1938 A list of prefixes to be placed in Prefix 1939 Information options in Router Advertisement 1940 messages sent from the interface. 1942 Default: all prefixes that the router advertises 1943 via routing protocols as being on-link for the 1944 interface from which the advertisement is sent. 1945 The link-local prefix SHOULD NOT be included in 1946 the list of advertised prefixes. 1948 Each prefix has an associated: 1950 AdvValidLifetime 1951 The value to be placed in the Valid 1952 Lifetime in the Prefix Information 1953 option, in seconds. The designated value | 1954 of all 1's (0xffffffff) represents | 1955 infinity. Implementations MUST allow | 1956 AdvValidLifetime to be specified in two | 1957 ways: 1959 - a time that decrements in real time, | 1960 that is, one that will result in a | 1961 Lifetime of zero at the specified | 1962 time in the future, or | 1964 - a fixed time that stays the same in | 1965 consecutive advertisements. | 1967 Default: infinity. 1969 AdvOnLinkFlag 1970 The value to be placed in the on-link 1971 flag ("L-bit") field in the Prefix 1972 Information option. 1974 Default: TRUE 1976 Automatic address configuration [ADDRCONF] 1977 defines additional information associated with 1978 each the prefixes: 1980 AdvPreferredLifetime 1981 The value to be placed in the Preferred 1982 Lifetime in the Prefix Information 1983 option, in seconds. The designated value 1984 of all 1's (0xffffffff) represents 1985 infinity. See [ADDRCONF] for details on | 1986 how this value is used. Implementations | 1987 MUST allow AdvPreferredLifetime to be | 1988 specified in two ways: 1990 - a time that decrements in real time, | 1991 that is, one that will result in a | 1992 Lifetime of zero at a specified time | 1993 in the future, or | 1995 - a fixed time that stays the same in | 1996 consecutive advertisements. | 1998 Default: 604800 seconds (7 days), fixed | 1999 (i.e., stays the same in consecutive | 2000 advertisements). 2002 AdvAutonomousFlag 2003 The value to be placed in the Autonomous 2004 Flag field in the Prefix Information 2005 option. See [ADDRCONF]. 2007 Default: TRUE 2009 The above variables contain information that is placed in outgoing 2010 Router Advertisement messages. Hosts use the received information to 2011 initialize a set of analogous variables that control their external 2012 behavior (see Section 6.3.2). Some of these host variables (e.g., 2013 CurHopLimit, RetransTimer, and ReachableTime) apply to all nodes 2014 including routers. In practice, these variables may not actually be 2015 present on routers, since their contents can be derived from the 2016 variables described above. However, external router behavior MUST be 2017 the same as host behavior with respect to these variables. In 2018 particular, this includes the occasional randomization of the 2019 ReachableTime value as described in Section 6.3.2. 2021 Protocol constants are defined in Section 10. 2023 6.2.2. Becoming An Advertising Interface 2025 The term "advertising interface" refers to any functioning and 2026 enabled multicast interface that has at least one unicast IP address 2027 assigned to it and whose corresponding AdvSendAdvertisements flag is 2028 TRUE. A router MUST NOT send Router Advertisements out any interface 2029 that is not an advertising interface. 2031 An interface may become an advertising interface at times other than 2032 system startup. For example: 2034 - changing the AdvSendAdvertisements flag on an enabled interface 2035 from FALSE to TRUE, or 2037 - administratively enabling the interface, if it had been 2038 administratively disabled, and its AdvSendAdvertisements flag is 2039 TRUE, or 2041 - enabling IP forwarding capability (i.e., changing the system 2042 from being a host to being a router), when the interface's 2043 AdvSendAdvertisements flag is TRUE. 2045 A router MUST join the all-routers multicast address on an 2046 advertising interface. Routers respond to Router Solicitations sent 2047 to the all-routers address and verify the consistency of Router 2048 Advertisements sent by neighboring routers. 2050 6.2.3. Router Advertisement Message Content 2052 A router sends periodic as well as solicited Router Advertisements 2053 out its advertising interfaces. Outgoing Router Advertisements are 2054 filled with the following values consistent with the message format 2055 given in Section 4.2: 2057 - In the Router Lifetime field: the interface's configured 2058 AdvDefaultLifetime. 2060 - In the M and O flags: the interface's configured AdvManagedFlag 2061 and AdvOtherConfigFlag, respectively. See [ADDRCONF]. 2063 - In the Cur Hop Limit field: the interface's configured 2064 CurHopLimit. 2066 - In the Reachable Time field: the interface's configured 2067 AdvReachableTime. 2069 - In the Retrans Timer field: the interface's configured 2070 AdvRetransTimer. 2072 - In the options: 2074 o Source Link-Layer Address option: link-layer address of the 2075 sending interface. This option MAY be omitted to 2076 facilitate in-bound load balancing over replicated 2077 interfaces. 2079 o MTU option: the interface's configured AdvLinkMTU value if 2080 the value is non-zero. If AdvLinkMTU is zero the MTU 2081 option is not sent. 2083 o Prefix Information options: one Prefix Information option 2084 for each prefix listed in AdvPrefixList with the option 2085 fields set from the information in the AdvPrefixList entry 2086 as follows: 2088 - In the "on-link" flag: the entry's AdvOnLinkFlag. 2090 - In the Valid Lifetime field: the entry's 2091 AdvValidLifetime. 2093 - In the "Autonomous address configuration" flag: the 2094 entry's AdvAutonomousFlag. 2096 - In the Preferred Lifetime field: the entry's 2097 AdvPreferredLifetime. 2099 A router might want to send Router Advertisements without advertising 2100 itself as a default router. For instance, a router might advertise 2101 prefixes for address autoconfiguration while not wishing to forward 2102 packets. Such a router sets the Router Lifetime field in outgoing 2103 advertisements to zero. 2105 A router MAY choose not to include some or all options when sending 2106 unsolicited Router Advertisements. For example, if prefix lifetimes 2107 are much longer than AdvDefaultLifetime, including them every few 2108 advertisements may be sufficient. However, when responding to a 2109 Router Solicitation or while sending the first few initial 2110 unsolicited advertisements, a router SHOULD include all options so 2111 that all information (e.g., prefixes) is propagated quickly during 2112 system initialization. 2114 If including all options causes the size of an advertisement to 2115 exceed the link MTU, multiple advertisements can be sent, each 2116 containing a subset of the options. 2118 6.2.4. Sending Unsolicited Router Advertisements 2120 A host MUST NOT send Router Advertisement messages at any time. 2122 Unsolicited Router Advertisements are not strictly periodic: the 2123 interval between subsequent transmissions is randomized to reduce the 2124 probability of synchronization with the advertisements from other 2125 routers on the same link [SYNC]. Each advertising interface has its 2126 own timer. Whenever a multicast advertisement is sent from an 2127 interface, the timer is reset to a uniformly-distributed random value 2128 between the interface's configured MinRtrAdvInterval and 2129 MaxRtrAdvInterval; expiration of the timer causes the next 2130 advertisement to be sent and a new random value to be chosen. 2132 For the first few advertisements (up to 2133 MAX_INITIAL_RTR_ADVERTISEMENTS) sent from an interface when it 2134 becomes an advertising interface, if the randomly chosen interval is 2135 greater than MAX_INITIAL_RTR_ADVERT_INTERVAL, the timer SHOULD be set 2136 to MAX_INITIAL_RTR_ADVERT_INTERVAL instead. Using a smaller interval 2137 for the initial advertisements increases the likelihood of a router 2138 being discovered quickly when it first becomes available, in the 2139 presence of possible packet loss. 2141 The information contained in Router Advertisements may change through 2142 actions of system management. For instance, the lifetime of 2143 advertised prefixes may change, new prefixes could be added, a router 2144 could cease to be a router (i.e., switch from being a router to being 2145 a host), etc. In such cases, the router MAY transmit up to 2146 MAX_INITIAL_RTR_ADVERTISEMENTS unsolicited advertisements, using the 2147 same rules as when an interface becomes an advertising interface. 2149 6.2.5. Ceasing To Be An Advertising Interface 2151 An interface may cease to be an advertising interface, through 2152 actions of system management such as: 2154 - changing the AdvSendAdvertisements flag of an enabled interface 2155 from TRUE to FALSE, or 2157 - administratively disabling the interface, or 2159 - shutting down the system. 2161 In such cases the router SHOULD transmit one or more (but not more 2162 than MAX_FINAL_RTR_ADVERTISEMENTS) final multicast Router 2163 Advertisements on the interface with a Router Lifetime field of zero. 2164 In the case of a router becoming a host, the system SHOULD also 2165 depart from the all-routers IP multicast group on all interfaces on 2166 which the router supports IP multicast (whether or not they had been 2167 advertising interfaces). In addition, the host MUST insure that 2168 subsequent Neighbor Advertisement messages sent from the interface 2169 have the Router flag set to zero. 2171 Note that system management may disable a router's IP forwarding 2172 capability (i.e., changing the system from being a router to being a 2173 host), a step that does not necessarily imply that the router's 2174 interfaces stop being advertising interfaces. In such cases, 2175 subsequent Router Advertisements MUST set the Router Lifetime field | 2176 to zero. 2178 6.2.6. Processing Router Solicitations 2180 A host MUST silently discard any received Router Solicitation 2181 messages. 2183 In addition to sending periodic, unsolicited advertisements, a router 2184 sends advertisements in response to valid solicitations received on 2185 an advertising interface. A router MAY choose to unicast the 2186 response directly to the soliciting host's address (if the 2187 solicitation's source address is not the unspecified address), but 2188 the usual case is to multicast the response to the all-nodes group. 2189 In the latter case, the interface's interval timer is reset to a new 2190 random value, as if an unsolicited advertisement had just been sent 2191 (see Section 6.2.4). 2193 In all cases, Router Advertisements sent in response to a Router 2194 Solicitation MUST be delayed by a random time between 0 and 2195 MAX_RA_DELAY_TIME seconds. (If a single advertisement is sent in 2196 response to multiple solicitations, the delay is relative to the 2197 first solicitation.) In addition, consecutive Router Advertisements 2198 sent to the all-nodes multicast address MUST be rate limited to no 2199 more than one advertisement every MIN_DELAY_BETWEEN_RAS seconds. 2201 A router might process Router Solicitations as follows: 2203 - Upon receipt of a Router Solicitation, compute a random delay 2204 within the range 0 through MAX_RA_DELAY_TIME. If the computed 2205 value corresponds to a time later than the time the next multicast 2206 Router Advertisement is scheduled to be sent, ignore the random 2207 delay and send the advertisement at the already-scheduled time. 2209 - If the router sent a multicast Router Advertisement (solicited or 2210 unsolicited) within the last MIN_DELAY_BETWEEN_RAS seconds, 2211 schedule the advertisement to be sent at a time corresponding to 2212 MIN_DELAY_BETWEEN_RAS plus the random value after the previous 2213 advertisement was sent. This ensures that the multicast Router 2214 Advertisements are rate limited. 2216 - Otherwise, schedule the sending of a Router Advertisement at the 2217 time given by the random value. 2219 Note that a router is permitted to send multicast Router 2220 Advertisements more frequently than indicated by the 2221 MinRtrAdvInterval configuration variable so long as the more frequent 2222 advertisements are responses to Router Solicitations. In all cases, 2223 however, unsolicited multicast advertisements MUST NOT be sent more 2224 frequently than indicated by MinRtrAdvInterval. 2226 Router Solicitations in which the Source Address is the unspecified | 2227 address MUST NOT update the router's Neighbor Cache; solicitations | 2228 with a proper source address update the Neighbor Cache as follows. | 2229 If the router already has a Neighbor Cache entry for the | 2230 solicitation's sender, the solicitation contains a Source Link-Layer | 2231 Address option, and the received link-layer address differs from that | 2232 already in the cache, the link-layer address SHOULD be updated in the | 2233 appropriate Neighbor Cache entry, and its reachability state MUST | 2234 also be set to STALE. If there is no existing Neighbor Cache entry | 2235 for the solicitation's sender, the router creates one, installs the | 2236 link-layer address and sets its reachability state to STALE as | 2237 specified in Section 7.3.3. In both cases the entry's IsRouter flag | 2238 SHOULD be set to false. 2240 If the Source Address is the unspecified address the router MUST NOT 2241 create or update the Neighbor Cache entry. 2243 6.2.7. Router Advertisement Consistency 2245 Routers SHOULD inspect valid Router Advertisements sent by other 2246 routers and verify that the routers are advertising consistent 2247 information on a link. Detected inconsistencies indicate that one or 2248 more routers might be misconfigured and SHOULD be logged to system or 2249 network management. The minimum set of information to check 2250 includes: 2252 - Cur Hop Limit values (except for the unspecified value of zero). 2254 - Values of the M or O flags. 2256 - Reachable Time values (except for the unspecified value of zero). 2258 - Retrans Timer values (except for the unspecified value of zero). 2260 - Values in the MTU options. 2262 - Preferred and Valid Lifetimes for the same prefix. 2264 Note that it is not an error for different routers to advertise 2265 different sets of prefixes. Also, some routers might leave some 2266 fields as unspecified, i.e., with the value zero, while other routers 2267 specify values. The logging of errors SHOULD be restricted to 2268 conflicting information that causes hosts to switch from one value to 2269 another with each received advertisement. 2271 Any other action on reception of Router Advertisement messages by a 2272 router is beyond the scope of this document. 2274 6.2.8. Link-local Address Change 2276 The link-local address on a router SHOULD change rarely, if ever. 2277 Nodes receiving Neighbor Discovery messages use the source address to 2278 identify the sender. If multiple packets from the same router 2279 contain different source addresses, nodes will assume they come from 2280 different routers, leading to undesirable behavior. For example, a 2281 node will ignore Redirect messages that are believed to have been 2282 sent by a router other than the current first-hop router. Thus the 2283 source address used in Router Advertisements sent by a particular 2284 router must be identical to the target address in a Redirect message 2285 when redirecting to that router. 2287 Using the link-local address to uniquely identify routers on the link 2288 has the benefit that the address a router is known by should not 2289 change when a site renumbers. 2291 If a router changes the link-local address for one of its interfaces, 2292 it SHOULD inform hosts of this change. The router SHOULD multicast a 2293 few Router Advertisements from the old link-local address with the 2294 Router Lifetime field set to zero and also multicast a few Router 2295 Advertisements from the new link-local address. The overall effect 2296 should be the same as if one interface ceases being an advertising 2297 interface, and a different one starts being an advertising interface. 2299 6.3. Host Specification 2301 6.3.1. Host Configuration Variables 2303 None. 2305 6.3.2. Host Variables 2307 A host maintains certain Neighbor Discovery related variables in 2308 addition to the data structures defined in Section 5.1. The specific 2309 variable names are used for demonstration purposes only, and an 2310 implementation is not required to have them, so long as its external 2311 behavior is consistent with that described in this document. 2313 These variables have default values that are overridden by 2314 information received in Router Advertisement messages. The default 2315 values are used when there is no router on the link or when all 2316 received Router Advertisements have left a particular value 2317 unspecified. 2319 The default values in this specification may be overridden by 2320 specific documents that describe how IP operates over different link 2321 layers. This rule allows Neighbor Discovery to operate over links 2322 with widely varying performance characteristics. 2324 For each interface: 2326 LinkMTU The MTU of the link. 2328 Default: The valued defined in the specific 2329 document that describes how IPv6 operates over 2330 the particular link layer (e.g., [IPv6-ETHER]). 2332 CurHopLimit The default hop limit to be used when sending 2333 (unicast) IP packets. 2335 Default: The value specified in the "Assigned 2336 Numbers" RFC [ASSIGNED] that was in effect at the 2337 time of implementation. 2339 BaseReachableTime 2340 A base value used for computing the random 2341 ReachableTime value. 2343 Default: REACHABLE_TIME milliseconds. 2345 ReachableTime The time a neighbor is considered reachable after 2346 receiving a reachability confirmation. 2348 This value should be a uniformly-distributed 2349 random value between MIN_RANDOM_FACTOR and 2350 MAX_RANDOM_FACTOR times BaseReachableTime 2351 milliseconds. A new random value should be 2352 calculated when BaseReachableTime changes (due to 2353 Router Advertisements) or at least every few 2354 hours even if no Router Advertisements are 2355 received. 2357 RetransTimer The time between retransmissions of Neighbor 2358 Solicitation messages to a neighbor when 2359 resolving the address or when probing the 2360 reachability of a neighbor. 2362 Default: RETRANS_TIMER milliseconds 2364 6.3.3. Interface Initialization 2366 The host joins the all-nodes multicast address on all multicast- 2367 capable interfaces. 2369 6.3.4. Processing Received Router Advertisements 2371 When multiple routers are present, the information advertised 2372 collectively by all routers may be a superset of the information 2373 contained in a single Router Advertisement. Moreover, information 2374 may also be obtained through other dynamic means, such as stateful 2375 autoconfiguration. Hosts accept the union of all received 2376 information; the receipt of a Router Advertisement MUST NOT 2377 invalidate all information received in a previous advertisement or 2378 from another source. However, when received information for a 2379 specific parameter (e.g., Link MTU) or option (e.g., Lifetime on a 2380 specific Prefix) differs from information received earlier, and the 2381 parameter/option can only have one value, the most recently-received 2382 information is considered authoritative. 2384 Some Router Advertisement fields (e.g., Cur Hop Limit, Reachable Time 2385 and Retrans Timer) may contain a value denoting unspecified. In such 2386 cases, the parameter should be ignored and the host should continue 2387 using whatever value it is already using. In particular, a host MUST 2388 NOT interpret the unspecified value as meaning change back to the 2389 default value that was in use before the first Router Advertisement 2390 was received. This rule prevents hosts from continually changing an 2391 internal variable when one router advertises a specific value, but 2392 other routers advertise the unspecified value. 2394 On receipt of a valid Router Advertisement, a host extracts the 2395 source address of the packet and does the following: 2397 - If the address is not already present in the host's Default 2398 Router List, and the advertisement's Router Lifetime is non- 2399 zero, create a new entry in the list, and initialize its 2400 invalidation timer value from the advertisement's Router 2401 Lifetime field. 2403 - If the address is already present in the host's Default Router 2404 List as a result of a previously-received advertisement, reset 2405 its invalidation timer to the Router Lifetime value in the 2406 newly-received advertisement. 2408 - If the address is already present in the host's Default Router 2409 List and the received Router Lifetime value is zero, immediately 2410 time-out the entry as specified in Section 6.3.5. 2412 To limit the storage needed for the Default Router List, a host MAY 2413 choose not to store all of the router addresses discovered via 2414 advertisements. However, a host MUST retain at least two router 2415 addresses and SHOULD retain more. Default router selections are made 2416 whenever communication to a destination appears to be failing. Thus, 2417 the more routers on the list, the more likely an alternative working 2418 router can be found quickly (e.g., without having to wait for the 2419 next advertisement to arrive). 2421 If the received Cur Hop Limit value is non-zero the host SHOULD set 2422 its CurHopLimit variable to the received value. 2424 If the received Reachable Time value is non-zero the host SHOULD set 2425 its BaseReachableTime variable to the received value. If the new 2426 value differs from the previous value, the host SHOULD recompute a 2427 new random ReachableTime value. ReachableTime is computed as a 2428 uniformly-distributed random value between MIN_RANDOM_FACTOR and 2429 MAX_RANDOM_FACTOR times the BaseReachableTime. Using a random 2430 component eliminates the possibility Neighbor Unreachability 2431 Detection messages synchronize with each other. 2433 In most cases, the advertised Reachable Time value will be the same 2434 in consecutive Router Advertisements and a host's BaseReachableTime 2435 rarely changes. In such cases, an implementation SHOULD insure that 2436 a new random value gets recomputed at least once every few hours. 2438 The RetransTimer variable SHOULD be copied from the Retrans Timer 2439 field, if the received value is non-zero. 2441 After extracting information from the fixed part of the Router 2442 Advertisement message, the advertisement is scanned for valid 2443 options. If the advertisement contains a Source Link-Layer Address 2444 option the link-layer address SHOULD be recorded in the Neighbor 2445 Cache entry for the router (creating an entry if necessary) and the 2446 IsRouter flag in the Neighbor Cache entry MUST be set to true. The 2447 IsRouter flag is used by Neighbor Unreachability Detection to 2448 determine when a router changes to being a host (i.e., no longer 2449 capable of forwarding packets). If a Neighbor Cache entry is created 2450 for the router its reachability state MUST be set to STALE as 2451 specified in Section 7.3.3. If a cache entry already exists and is 2452 updated with a different link-layer address the reachability state 2453 MUST also be set to STALE. 2455 If the MTU option is present, hosts SHOULD copy the option's value | 2456 into LinkMTU so long as the value is greater than or equal to the | 2457 minimum link MTU [IPv6] and does not exceed the default LinkMTU value 2458 specified in the link type specific document (e.g., [IPv6-ETHER]). 2460 Prefix Information options that have the "on-link" (L) flag set 2461 indicate a prefix identifying a range of addresses that should be 2462 considered on-link. Note, however, that a Prefix Information option 2463 with the on-link flag set to zero conveys no information concerning 2464 on-link determination and MUST NOT be interpreted to mean that 2465 addresses covered by the prefix are off-link. The default behavior 2466 (see Section 5.2) when no information is known about an address is to 2467 send the packets to a default router and the reception of a Prefix 2468 Information option with the "on-link " (L) flag set to zero does not 2469 change this behavior. The reasons for an address being treated as 2470 on-link is specified in the definition of "on-link" in Section 2.1. 2471 Prefixes with the on-link flag set to zero would normally have the 2472 autonomous flag set and be used by [ADDRCONF]. 2474 For each Prefix Information option with the on-link flag set, a host 2475 does the following: 2477 - If the prefix is the link-local prefix, silently ignore the 2478 Prefix Information option. 2480 - If the prefix is not already present in the Prefix List, and the 2481 Prefix Information option's Valid Lifetime field is non-zero, 2482 create a new entry for the prefix and initialize its 2483 invalidation timer to the Valid Lifetime value in the Prefix 2484 Information option. 2486 - If the prefix is already present in the host's Prefix List as 2487 the result of a previously-received advertisement, reset its 2488 invalidation timer to the Valid Lifetime value in the Prefix 2489 Information option. If the new Lifetime value is zero, time-out 2490 the prefix immediately (see Section 6.3.5). 2492 - If the Prefix Information option's Valid Lifetime field is zero, 2493 and the prefix is not present in the host's Prefix List, 2494 silently ignore the option. 2496 Stateless address autoconfiguration [ADDRCONF] ignores certain Valid | 2497 (and Preferred) Lifetimes that are below some limit in order to | 2498 prevent a particular denial of service attack. However, since the | 2499 effect of the same denial of service against the on-link prefix list | 2500 is not catastrophic - hosts would send packets to a default router | 2501 and receive a redirect rather than sending packets directly to a | 2502 neighbor - the ND protocol does not impose such a check on the prefix | 2503 lifetime values. | 2505 Note: Implementations can choose to process the on-link aspects of 2506 the prefixes separately from the address autoconfiguration aspects 2507 of the prefixes by, e.g., passing a copy of each valid Router 2508 Advertisement message to both an "on-link" and an "addrconf" 2509 function. Each function can then operate independently on the 2510 prefixes that have the appropriate flag set. 2512 6.3.5. Timing out Prefixes and Default Routers 2514 Whenever the invalidation timer expires for a Prefix List entry, that 2515 entry is discarded. No existing Destination Cache entries need be 2516 updated, however. Should a reachability problem arise with an 2517 existing Neighbor Cache entry, Neighbor Unreachability Detection will 2518 perform any needed recovery. 2520 Whenever the Lifetime of an entry in the Default Router List expires, 2521 that entry is discarded. When removing a router from the Default 2522 Router list, the node MUST update the Destination Cache in such a way 2523 that all entries using the router perform next-hop determination 2524 again rather than continue sending traffic to the (deleted) router. 2526 6.3.6. Default Router Selection 2528 The algorithm for selecting a router depends in part on whether or 2529 not a router is known to be reachable. The exact details of how a 2530 node keeps track of a neighbor's reachability state are covered in 2531 Section 7.3. The algorithm for selecting a default router is invoked 2532 during next-hop determination when no Destination Cache entry exists 2533 for an off-link destination or when communication through an existing 2534 router appears to be failing. Under normal conditions, a router 2535 would be selected the first time traffic is sent to a destination, 2536 with subsequent traffic for that destination using the same router as 2537 indicated in the Destination Cache modulo any changes to the 2538 Destination Cache caused by Redirect messages. 2540 The policy for selecting routers from the Default Router List is as 2541 follows: 2543 1) Routers that are reachable or probably reachable (i.e., in any 2544 state other than INCOMPLETE) SHOULD be preferred over routers 2545 whose reachability is unknown or suspect (i.e., in the 2546 INCOMPLETE state, or for which no Neighbor Cache entry exists). 2547 An implementation may choose to always return the same router or 2548 cycle through the router list in a round-robin fashion as long 2549 as it always returns a reachable or a probably reachable router 2550 when one is available. 2552 2) When no routers on the list are known to be reachable or 2553 probably reachable, routers SHOULD be selected in a round-robin 2554 fashion, so that subsequent requests for a default router do not 2555 return the same router until all other routers have been 2556 selected. 2558 Cycling through the router list in this case ensures that all 2559 available routers are actively probed by the Neighbor 2560 Unreachability Detection algorithm. A request for a default 2561 router is made in conjunction with the sending of a packet to a 2562 router, and the selected router will be probed for reachability 2563 as a side effect. 2565 3) If the Default Router List is empty, assume that all 2566 destinations are on-link as specified in Section 5.2. 2568 6.3.7. Sending Router Solicitations 2570 When an interface becomes enabled, a host may be unwilling to wait 2571 for the next unsolicited Router Advertisement to locate default 2572 routers or learn prefixes. To obtain Router Advertisements quickly, 2573 a host SHOULD transmit up to MAX_RTR_SOLICITATIONS Router 2574 Solicitation messages each separated by at least 2575 RTR_SOLICITATION_INTERVAL seconds. Router Solicitations may be sent 2576 after any of the following events: 2578 - The interface is initialized at system startup time. 2580 - The interface is reinitialized after a temporary interface 2581 failure or after being temporarily disabled by system 2582 management. 2584 - The system changes from being a router to being a host, by 2585 having its IP forwarding capability turned off by system 2586 management. 2588 - The host attaches to a link for the first time. 2590 - The host re-attaches to a link after being detached for some 2591 time. 2593 A host sends Router Solicitations to the All-Routers multicast | 2594 address. The IP source address is set to either one of the 2595 interface's unicast addresses or the unspecified address. The Source 2596 Link-Layer Address option SHOULD be set to the host's link-layer 2597 address, if the IP source address is not the unspecified address. | 2599 Before a host sends an initial solicitation, it SHOULD delay the 2600 transmission for a random amount of time between 0 and 2601 MAX_RTR_SOLICITATION_DELAY. This serves to alleviate congestion when 2602 many hosts start up on a link at the same time, such as might happen 2603 after recovery from a power failure. If a host has already performed 2604 a random delay since the interface became (re)enabled (e.g., as part 2605 of Duplicate Address Detection [ADDRCONF]) there is no need to delay 2606 again before sending the first Router Solicitation message. 2608 Once the host sends a Router Solicitation, and receives a valid 2609 Router Advertisement with a non-zero Router Lifetime, the host MUST 2610 desist from sending additional solicitations on that interface, until 2611 the next time one of the above events occurs. Moreover, a host 2612 SHOULD send at least one solicitation in the case where an 2613 advertisement is received prior to having sent a solicitation. 2614 Unsolicited Router Advertisements may be incomplete (see Section 2615 6.2.3); solicited advertisements are expected to contain complete 2616 information. 2618 If a host sends MAX_RTR_SOLICITATIONS solicitations, and receives no 2619 Router Advertisements after having waited MAX_RTR_SOLICITATION_DELAY 2620 seconds after sending the last solicitation, the host concludes that 2621 there are no routers on the link for the purpose of [ADDRCONF]. 2622 However, the host continues to receive and process Router 2623 Advertisements messages in the event that routers appear on the link. 2625 7. ADDRESS RESOLUTION AND NEIGHBOR UNREACHABILITY DETECTION 2627 This section describes the functions related to Neighbor Solicitation 2628 and Neighbor Advertisement messages and includes descriptions of 2629 address resolution and the Neighbor Unreachability Detection 2630 algorithm. 2632 Neighbor Solicitation and Advertisement messages are also used for 2633 Duplicate Address Detection as specified by [ADDRCONF]. In 2634 particular, Duplicate Address Detection sends Neighbor Solicitation 2635 messages with an unspecified source address targeting its own 2636 "tentative" address. Such messages trigger nodes already using the 2637 address to respond with a multicast Neighbor Advertisement indicating 2638 that the address is in use. 2640 7.1. Message Validation 2642 7.1.1. Validation of Neighbor Solicitations 2644 A node MUST silently discard any received Neighbor Solicitation 2645 messages that do not satisfy all of the following validity checks: 2647 - The IP Hop Limit field has a value of 255, i.e., the packet 2648 could not possibly have been forwarded by a router. 2650 - If the message includes an IP Authentication Header, the message 2651 authenticates correctly. 2653 - ICMP Checksum is valid. 2655 - ICMP Code is 0. 2657 - ICMP length (derived from the IP length) is 24 or more octets. 2659 - Target Address is not a multicast address. 2661 - All included options have a length that is greater than zero. 2663 - If the IP source address is the unspecified address, the IP | 2664 destination address is a solicited-node multicast address. | 2666 - If the IP source address is the unspecified address, there is no | 2667 source link-layer address option in the message. | 2669 The contents of the Reserved field, and of any unrecognized options, 2670 MUST be ignored. Future, backward-compatible changes to the protocol 2671 may specify the contents of the Reserved field or add new options; 2672 backward-incompatible changes may use different Code values. 2674 The contents of any defined options that are not specified to be used 2675 with Neighbor Solicitation messages MUST be ignored and the packet 2676 processed as normal. The only defined option that may appear is the 2677 Source Link-Layer Address option. 2679 A Neighbor Solicitation that passes the validity checks is called a 2680 "valid solicitation". 2682 7.1.2. Validation of Neighbor Advertisements 2684 A node MUST silently discard any received Neighbor Advertisement 2685 messages that do not satisfy all of the following validity checks: 2687 - The IP Hop Limit field has a value of 255, i.e., the packet 2688 could not possibly have been forwarded by a router. 2690 - If the message includes an IP Authentication Header, the message 2691 authenticates correctly. 2693 - ICMP Checksum is valid. 2695 - ICMP Code is 0. 2697 - ICMP length (derived from the IP length) is 24 or more octets. 2699 - Target Address is not a multicast address. 2701 - If the IP Destination Address is a multicast address the 2702 Solicited flag is zero. 2704 - All included options have a length that is greater than zero. 2706 The contents of the Reserved field, and of any unrecognized options, 2707 MUST be ignored. Future, backward-compatible changes to the protocol 2708 may specify the contents of the Reserved field or add new options; 2709 backward-incompatible changes may use different Code values. 2711 The contents of any defined options that are not specified to be used 2712 with Neighbor Advertisement messages MUST be ignored and the packet 2713 processed as normal. The only defined option that may appear is the 2714 Target Link-Layer Address option. 2716 A Neighbor Advertisements that passes the validity checks is called a 2717 "valid advertisement". 2719 7.2. Address Resolution 2721 Address resolution is the process through which a node determines the 2722 link-layer address of a neighbor given only its IP address. Address 2723 resolution is performed only on addresses that are determined to be 2724 on-link and for which the sender does not know the corresponding 2725 link-layer address. Address resolution is never performed on 2726 multicast addresses. 2728 7.2.1. Interface Initialization 2730 When a multicast-capable interface becomes enabled the node MUST join 2731 the all-nodes multicast address on that interface, as well as the 2732 solicited-node multicast address corresponding to each of the IP 2733 addresses assigned to the interface. 2735 The set of addresses assigned to an interface may change over time. 2736 New addresses might be added and old addresses might be removed 2737 [ADDRCONF]. In such cases the node MUST join and leave the 2738 solicited-node multicast address corresponding to the new and old 2739 addresses, respectively. Note that multiple unicast addresses may 2740 map into the same solicited-node multicast address; a node MUST NOT 2741 leave the solicited-node multicast group until all assigned addresses 2742 corresponding to that multicast address have been removed. 2744 7.2.2. Sending Neighbor Solicitations 2746 When a node has a unicast packet to send to a neighbor, but does not 2747 know the neighbor's link-layer address, it performs address 2748 resolution. For multicast-capable interfaces this entails creating a 2749 Neighbor Cache entry in the INCOMPLETE state and transmitting a 2750 Neighbor Solicitation message targeted at the neighbor. The 2751 solicitation is sent to the solicited-node multicast address 2752 corresponding to the target address. 2754 If the source address of the packet prompting the solicitation is the 2755 same as one of the addresses assigned to the outgoing interface, that 2756 address SHOULD be placed in the IP Source Address of the outgoing 2757 solicitation. Otherwise, any one of the addresses assigned to the 2758 interface should be used. Using the prompting packet's source 2759 address when possible insures that the recipient of the Neighbor 2760 Solicitation installs in its Neighbor Cache the IP address that is 2761 highly likely to be used in subsequent return traffic belonging to 2762 the prompting packet's "connection". 2764 If the solicitation is being sent to a solicited-node multicast 2765 address, the sender MUST include its link-layer address (if it has 2766 one) as a Source Link-Layer Address option. Otherwise, the sender 2767 SHOULD include its link-layer address (if it has one) as a Source 2768 Link-Layer Address option. Including the source link-layer address 2769 in a multicast solicitation is required to give the target an address 2770 to which it can send the Neighbor Advertisement. 2772 While waiting for address resolution to complete, the sender MUST, 2773 for each neighbor, retain a small queue of packets waiting for 2774 address resolution to complete. The queue MUST hold at least one 2775 packet, and MAY contain more. However, the number of queued packets 2776 per neighbor SHOULD be limited to some small value. When a queue 2777 overflows, the new arrival SHOULD replace the oldest entry. Once 2778 address resolution completes, the node transmits any queued packets. 2780 While awaiting a response, the sender SHOULD retransmit Neighbor 2781 Solicitation messages approximately every RetransTimer milliseconds, 2782 even in the absence of additional traffic to the neighbor. 2783 Retransmissions MUST be rate-limited to at most one solicitation per 2784 neighbor every RetransTimer milliseconds. 2786 If no Neighbor Advertisement is received after MAX_MULTICAST_SOLICIT 2787 solicitations, address resolution has failed. The sender MUST return 2788 ICMP destination unreachable indications with code 3 (Address 2789 Unreachable) for each packet queued awaiting address resolution. 2791 7.2.3. Receipt of Neighbor Solicitations 2793 A valid Neighbor Solicitation that does not meet any the following | 2794 requirements MUST be silently ignored: | 2796 - The Target Address is a unicast or anycast address assigned to the | 2797 receiving interface, | 2799 - The Target Address is a unicast address for which the node is | 2800 offering proxy service, or | 2802 - The Target Address is a "tentative" address on which Duplicate | 2803 Address Detection is being performed [ADDRCONF]. | 2805 If the Target Address is tentative, the Neighbor Solicitation should | 2806 be processed as described in [ADDRCONF]. Otherwise, the following | 2807 description applies. If the Source Address is not the unspecified | 2808 address the recipient SHOULD update the Neighbor Cache entry for the | 2809 IP Source Address of the solicitation. If an entry does not already | 2810 exist, the node SHOULD create a new one and set its reachability | 2811 state to STALE as specified in Section 7.3.3. If a cache entry 2812 already exists and is updated with a different link-layer address its 2813 reachability state MUST be set to STALE. If the solicitation 2814 contains a Source Link-Layer Address option, the entry's cached 2815 link-layer address should be replaced with the one in the 2816 solicitation. 2818 If a Neighbor Cache entry is created the IsRouter flag SHOULD be set | 2819 to false. This will be the case even if the Neighbor Solicitation is | 2820 sent by a router since the Neighbor Solicitation messages do not | 2821 contain an indication of whether or not the sender is a router. In | 2822 the event that the sender is a router, subsequent Neighbor | 2823 Advertisement or Router Advertisement messages will set the correct | 2824 IsRouter value. If a Neighbor Cache entry already exists its | 2825 IsRouter flag MUST NOT be modified. | 2827 If the Source Address is the unspecified address the node MUST NOT 2828 create or update the Neighbor Cache entry. 2830 After any updates to the Neighbor Cache, the node sends a Neighbor 2831 Advertisement response as described in the next section. 2833 7.2.4. Sending Solicited Neighbor Advertisements 2835 A node sends a Neighbor Advertisement in response to a valid Neighbor 2836 Solicitation targeting one of the node's assigned addresses. The 2837 Target Address of the advertisement is copied from the Target Address 2838 of the solicitation. If the solicitation's IP Destination Address is 2839 a unicast or anycast address, the Target Link-Layer Address option 2840 SHOULD NOT be included; the neighboring node's cached value must 2841 already be current in order for the solicitation to have been 2842 received. If the solicitation's IP Destination Address is a 2843 solicited-node multicast address, the Target Link-Layer option MUST 2844 be included in the advertisement. If the node is a router, it MUST 2845 set the Router flag to one; otherwise it MUST set the flag to zero. 2847 If the Target Address is either an anycast address or a unicast 2848 address for which the node is providing proxy service, or the Target 2849 Link-Layer Address option is not included in the outgoing 2850 advertisement, the Override flag SHOULD be set to zero. Otherwise, 2851 it SHOULD be set to one. Proper setting of the Override flag insures 2852 that nodes give preference to non-proxy advertisements, even when 2853 received after proxy advertisements, but that the first advertisement 2854 for an anycast address "wins". 2856 If the source of the solicitation is the unspecified address, the 2857 node MUST set the Solicited flag to zero and multicast the 2858 advertisement to the all-nodes address. Otherwise, the node MUST set 2859 the Solicited flag to one and unicast the advertisement to the Source 2860 Address of the solicitation. 2862 If the Target Address is an anycast address the sender SHOULD delay 2863 sending a response for a random time between 0 and 2864 MAX_ANYCAST_DELAY_TIME seconds. 2866 7.2.5. Receipt of Neighbor Advertisements 2868 When a valid Neighbor Advertisement is received (either solicited or 2869 unsolicited), the Neighbor Cache is searched for the target's entry. 2870 If no entry exists, the advertisement SHOULD be silently discarded. | 2871 There is no need to create an entry if none exists, since the | 2872 recipient has apparently not initiated any communication with the | 2873 target. 2875 Once the appropriate Neighbor Cache entry has been located, the 2876 specific actions taken depend on the state of the Neighbor Cache | 2877 entry, the flags in the advertisement and the actual link-layer | 2878 address supplied. 2880 If the target's Neighbor Cache entry is in the INCOMPLETE state when | 2881 the advertisement is received, the receiving node performs the | 2882 following steps: | 2884 - It records the link-layer address in the Neighbor Cache entry. | 2886 - If the advertisements Solicited flag is set, the state of the | 2887 entry is set to REACHABLE, otherwise it is set to STALE. | 2889 - It sets the IsRouter flag in the cache entry based on the Router | 2890 flag in the received advertisement. | 2892 - It sends any packets queued for the neighbor awaiting address | 2893 resolution. | 2895 Note that the Override flag is ignored if the entry is in the | 2896 INCOMPLETE state. 2898 If the target's Neighbor Cache entry is in any state other than | 2899 INCOMPLETE when the advertisement is received, processing becomes | 2900 quite a bit more complex. If the Override flag is clear and the | 2901 supplied link-layer address differs from that in the cache, the | 2902 received advertisement should be ignored and MUST NOT update the | 2903 cache. If either the Override flag is set, or the Override flag is | 2904 clear and the supplied link-layer address is the same as that in the | 2905 cache, however, the received advertisement MUST update the Neighbor | 2906 Cache entry as follows: | 2908 - The link-layer address in the Target Link-Layer Address option | 2909 MUST be inserted in the cache (if different than the already | 2910 recorded address). | 2912 - If the Solicited flag is set, the state of the entry MUST be set | 2913 to REACHABLE. If the Solicited flag is zero and the link-layer | 2914 address was updated with a different address the state MUST be set | 2915 to STALE. Otherwise, the entry's state remains unchanged. | 2917 An advertisement's Solicited flag should only be set if the 2918 advertisement is a response to a Neighbor Solicitation. Because | 2919 Neighbor Unreachability Detection Solicitations are sent to the | 2920 cached link-layer address, receipt of a solicited advertisement | 2921 indicates that the forward path is working. Receipt of an 2922 unsolicited advertisement, however, suggests that a neighbor has 2923 urgent information to announce (e.g., a changed link-layer | 2924 address). If the urgent information indicates a change from what | 2925 a node is currently using, the node should verify the reachability | 2926 of the (new) path when it sends the next packet. There is no need | 2927 to update the state for unsolicited advertisements that do not | 2928 change the contents of the cache. 2930 - The IsRouter flag in the cache entry MUST be set based on the | 2931 Router flag in the received advertisement. In those cases where | 2932 the IsRouter flag changes from true to false as a result of this | 2933 update, the node MUST remove that router from the Default Router | 2934 List and update the Destination Cache entries for all destinations | 2935 using that neighbor as a router as specified in Section 7.3.3. | 2936 This is needed to detect when a node that is used as a router | 2937 stops forwarding packets due to being configured as a host. | 2939 The above rules ensure that the cache is updated either when the | 2940 Neighbor Advertisement takes precedence (i.e., the Override flag is | 2941 set) or when the Neighbor Advertisement refers to the same link-layer | 2942 address that is currently recorded in the cache. If none of the | 2943 above apply the advertisement does not update the cache entry. | 2945 7.2.6. Sending Unsolicited Neighbor Advertisements 2947 In some cases a node may be able to determine that its link-layer 2948 address has changed (e.g., hot-swap of an interface card) and may 2949 wish to inform its neighbors of the new link-layer address quickly. 2950 In such cases a node MAY send up to MAX_NEIGHBOR_ADVERTISEMENT 2951 unsolicited Neighbor Advertisement messages to the all-nodes 2952 multicast address. These advertisements MUST be separated by at 2953 least RetransTimer seconds. 2955 The Target Address field in the unsolicited advertisement is set to 2956 an IP address of the interface, and the Target Link-Layer Address 2957 option is filled with the new link-layer address. The Solicited flag 2958 MUST be set to zero, in order to avoid confusing the Neighbor 2959 Unreachability Detection algorithm. If the node is a router, it MUST 2960 set the Router flag to one; otherwise it MUST set it to zero. The 2961 Override flag MAY be set to either zero or one. In either case, 2962 neighboring nodes will immediately change the state of their Neighbor 2963 Cache entries for the Target Address to STALE, prompting them to 2964 verify the path for reachability. If the Override flag is set to 2965 one, neighboring nodes will install the new link-layer address in 2966 their caches. Otherwise, they will ignore the new link-layer 2967 address, choosing instead to probe the cached address. 2969 A node that has multiple IP addresses assigned to an interface MAY 2970 multicast a separate Neighbor Advertisement for each address. In 2971 such a case the node SHOULD introduce a small delay between the 2972 sending of each advertisement to reduce the probability of the 2973 advertisements being lost due to congestion. 2975 A proxy MAY multicast Neighbor Advertisements when its link-layer 2976 address changes or when it is configured (by system management or 2977 other mechanisms) to proxy for an address. If there are multiple 2978 nodes that are providing proxy services for the same set of addresses 2979 the proxies SHOULD provide a mechanism that prevents multiple proxies 2980 from multicasting advertisements for any one address, in order to 2981 reduce the risk of excessive multicast traffic. 2983 Also, a node belonging to an anycast address MAY multicast 2984 unsolicited Neighbor Advertisements for the anycast address when the 2985 node's link-layer address changes. 2987 Note that because unsolicited Neighbor Advertisements do not reliably 2988 update caches in all nodes (the advertisements might not be received 2989 by all nodes), they should only be viewed as a performance 2990 optimization to quickly update the caches in most neighbors. The 2991 Neighbor Unreachability Detection algorithm ensures that all nodes 2992 obtain a reachable link-layer address, though the delay may be 2993 slightly longer. 2995 7.2.7. Anycast Neighbor Advertisements 2997 From the perspective of Neighbor Discovery, anycast addresses are 2998 treated just like unicast addresses in most cases. Because an 2999 anycast address is syntactically the same as a unicast address, nodes 3000 performing address resolution or Neighbor Unreachability Detection on 3001 an anycast address treat it as if it were a unicast address. No 3002 special processing takes place. 3004 Nodes that have an anycast address assigned to an interface treat 3005 them exactly the same as if they were unicast addresses with two 3006 exceptions. First, Neighbor Advertisements sent in response to a 3007 Neighbor Solicitation SHOULD be delayed by a random time between 0 3008 and MAX_ANYCAST_DELAY_TIME to reduce the probability of network 3009 congestion. Second, the Override flag in Neighbor Advertisements 3010 SHOULD be set to 0, so that when multiple advertisements are 3011 received, the first received advertisement is used rather than the 3012 most recently received advertisement. 3014 As with unicast addresses, Neighbor Unreachability Detection ensures 3015 that a node quickly detects when the current binding for an anycast 3016 address becomes invalid. 3018 7.2.8. Proxy Neighbor Advertisements 3020 Under limited circumstances, a router MAY proxy for one or more other 3021 nodes, that is, through Neighbor Advertisements indicate that it is 3022 willing to accept packets not explicitly addressed to itself. For 3023 example, a router might accept packets on behalf of a mobile node 3024 that has moved off-link. The mechanisms used by proxy are identical 3025 to the mechanisms used with anycast addresses. 3027 A proxy MUST join the solicited-node multicast address(es) that 3028 correspond to the IP address(es) assigned to the node for which it is 3029 proxying. 3031 All solicited proxy Neighbor Advertisement messages MUST have the 3032 Override flag set to zero. This ensures that if the node itself is 3033 present on the link its Neighbor Advertisement (with the Override 3034 flag set to one) will take precedence of any advertisement received 3035 from a proxy. A proxy MAY send unsolicited advertisements with the 3036 Override flag set to one as specified in Section 7.2.6, but doing so 3037 may cause the proxy advertisement to override a valid entry created 3038 by the node itself. 3040 Finally, when sending a proxy advertisement in response to a Neighbor 3041 Solicitation, the sender should delay its response by a random time 3042 between 0 and MAX_ANYCAST_DELAY_TIME seconds. 3044 7.3. Neighbor Unreachability Detection 3046 Communication to or through a neighbor may fail for numerous reasons 3047 at any time, including hardware failure, hot-swap of an interface | 3048 card, etc. If the destination has failed, no recovery is possible 3049 and communication fails. On the other hand, if it is the path that 3050 has failed, recovery may be possible. Thus, a node actively tracks 3051 the reachability "state" for the neighbors to which it is sending 3052 packets. 3054 Neighbor Unreachability Detection is used for all paths between hosts 3055 and neighboring nodes, including host-to-host, host-to-router, and 3056 router-to-host communication. Neighbor Unreachability Detection may 3057 also be used between routers, but is not required if an equivalent 3058 mechanism is available, for example, as part of the routing 3059 protocols. 3061 When a path to a neighbor appears to be failing, the specific 3062 recovery procedure depends on how the neighbor is being used. If the 3063 neighbor is the ultimate destination, for example, address resolution 3064 should be performed again. If the neighbor is a router, however, 3065 attempting to switch to another router would be appropriate. The 3066 specific recovery that takes place is covered under next-hop 3067 determination; Neighbor Unreachability Detection signals the need for 3068 next-hop determination by deleting a Neighbor Cache entry. 3070 Neighbor Unreachability Detection is performed only for neighbors to 3071 which unicast packets are sent; it is not used when sending to 3072 multicast addresses. 3074 7.3.1. Reachability Confirmation 3076 A neighbor is considered reachable if the node has recently received 3077 a confirmation that packets sent recently to the neighbor were 3078 received by its IP layer. Positive confirmation can be gathered in 3079 two ways: hints from upper layer protocols that indicate a connection 3080 is making "forward progress", or receipt of a Neighbor Advertisement 3081 message that is a response to a Neighbor Solicitation message. 3083 A connection makes "forward progress" if the packets received from a 3084 remote peer can only be arriving if recent packets sent to that peer 3085 are actually reaching it. In TCP, for example, receipt of a (new) 3086 acknowledgement indicates that previously sent data reached the peer. 3087 Likewise, the arrival of new (non-duplicate) data indicates that 3088 earlier acknowledgements are being delivered to the remote peer. If 3089 packets are reaching the peer, they must also be reaching the 3090 sender's next-hop neighbor; thus "forward progress" is a confirmation 3091 that the next-hop neighbor is reachable. For off-link destinations, 3092 forward progress implies that the first-hop router is reachable. 3093 When available, this upper-layer information SHOULD be used. 3095 In some cases (e.g., UDP-based protocols and routers forwarding 3096 packets to hosts) such reachability information may not be readily 3097 available from upper-layer protocols. When no hints are available 3098 and a node is sending packets to a neighbor, the node actively probes 3099 the neighbor using unicast Neighbor Solicitation messages to verify 3100 that the forward path is still working. 3102 The receipt of a solicited Neighbor Advertisement serves as 3103 reachability confirmation, since advertisements with the Solicited 3104 flag set to one are sent only in response to a Neighbor Solicitation. 3105 Receipt of other Neighbor Discovery messages such as Router 3106 Advertisements and Neighbor Advertisement with the Solicited flag set 3107 to zero MUST NOT be treated as a reachability confirmation. Receipt 3108 of unsolicited messages only confirm the one-way path from the sender 3109 to the recipient node. In contrast, Neighbor Unreachability 3110 Detection requires that a node keep track of the reachability of the 3111 forward path to a neighbor from the its perspective, not the 3112 neighbor's perspective. Note that receipt of a solicited 3113 advertisement indicates that a path is working in both directions. 3114 The solicitation must have reached the neighbor, prompting it to 3115 generate an advertisement. Likewise, receipt of an advertisement 3116 indicates that the path from the sender to the recipient is working. 3117 However, the latter fact is known only to the recipient; the 3118 advertisement's sender has no direct way of knowing that the 3119 advertisement it sent actually reached a neighbor. From the 3120 perspective of Neighbor Unreachability Detection, only the 3121 reachability of the forward path is of interest. 3123 7.3.2. Neighbor Cache Entry States 3125 A Neighbor Cache entry can be in one of five states: 3127 INCOMPLETE Address resolution is being performed on the entry. 3128 Specifically, a Neighbor Solicitation has been sent to 3129 the solicited-node multicast address of the target, 3130 but the corresponding Neighbor Advertisement has not 3131 yet been received. 3133 REACHABLE Positive confirmation was received within the last 3134 ReachableTime milliseconds that the forward path to 3135 the neighbor was functioning properly. While 3136 REACHABLE, no special action takes place as packets 3137 are sent. 3139 STALE More than ReachableTime milliseconds have elapsed 3140 since the last positive confirmation was received that 3141 the forward path was functioning properly. While 3142 stale, no action takes place until a packet is sent. 3144 The STALE state is entered upon receiving an 3145 unsolicited Neighbor Discovery message that updates 3146 the cached link-layer address. Receipt of such a 3147 message does not confirm reachability, and entering 3148 the STALE state insures reachability is verified 3149 quickly if the entry is actually being used. However, 3150 reachability is not actually verified until the entry 3151 is actually used. 3153 DELAY More than ReachableTime milliseconds have elapsed 3154 since the last positive confirmation was received that 3155 the forward path was functioning properly, and a 3156 packet was sent within the last DELAY_FIRST_PROBE_TIME 3157 seconds. If no reachability confirmation is received 3158 within DELAY_FIRST_PROBE_TIME seconds of entering the 3159 DELAY state, send a Neighbor Solicitation and change 3160 the state to PROBE. 3162 The DELAY state is an optimization that gives upper- 3163 layer protocols additional time to provide 3164 reachability confirmation in those cases where 3165 ReachableTime milliseconds have passed since the last 3166 confirmation due to lack of recent traffic. Without 3167 this optimization the opening of a TCP connection 3168 after a traffic lull would initiate probes even though 3169 the subsequent three-way handshake would provide a 3170 reachability confirmation almost immediately. 3172 PROBE A reachability confirmation is actively sought by 3173 retransmitting Neighbor Solicitations every 3174 RetransTimer milliseconds until a reachability 3175 confirmation is received. 3177 7.3.3. Node Behavior 3179 Neighbor Unreachability Detection operates in parallel with the 3180 sending of packets to a neighbor. While reasserting a neighbor's 3181 reachability, a node continues sending packets to that neighbor using 3182 the cached link-layer address. If no traffic is sent to a neighbor, 3183 no probes are sent. 3185 When a node needs to perform address resolution on a neighboring 3186 address, it creates an entry in the INCOMPLETE state and initiates 3187 address resolution as specified in Section 7.2. If address 3188 resolution fails, the entry SHOULD be deleted, so that subsequent 3189 traffic to that neighbor invokes the next-hop determination procedure 3190 again. Invoking next-hop determination at this point insures that 3191 alternate default routers are tried. 3193 When a reachability confirmation is received (either through upper- 3194 layer advice or a solicited Neighbor Advertisement) an entry's state 3195 changes to REACHABLE. The one exception is that upper-layer advice 3196 has no effect on entries in the INCOMPLETE state (e.g., for which no 3197 link-layer address is cached). 3199 When ReachableTime milliseconds have passed since receipt of the last 3200 reachability confirmation for a neighbor, the Neighbor Cache entry's 3201 state changes from REACHABLE to STALE. 3203 Note: An implementation may actually defer changing the state from 3204 REACHABLE to STALE until a packet is sent to the neighbor, i.e., 3205 there need not be an explicit timeout event associated with the 3206 expiration of ReachableTime. 3208 The first time a node sends a packet to a neighbor whose entry is 3209 STALE, the sender changes the state to DELAY and a sets a timer to 3210 expire in DELAY_FIRST_PROBE_TIME seconds. If the entry is still in 3211 the DELAY state when the timer expires, the entry's state changes to 3212 PROBE. If reachability confirmation is received, the entry's state 3213 changes to REACHABLE. 3215 Upon entering the PROBE state, a node sends a unicast Neighbor 3216 Solicitation message to the neighbor using the cached link-layer 3217 address. While in the PROBE state, a node retransmits Neighbor 3218 Solicitation messages every RetransTimer milliseconds until 3219 reachability confirmation is obtained. Probes are retransmitted even 3220 if no additional packets are sent to the neighbor. If no response is 3221 received after waiting RetransTimer milliseconds after sending the 3222 MAX_UNICAST_SOLICIT solicitations, retransmissions cease and the 3223 entry SHOULD be deleted. Subsequent traffic to that neighbor will 3224 recreate the entry and performs address resolution again. 3226 Note that all Neighbor Solicitations are rate-limited on a per- 3227 neighbor basis. A node MUST NOT send Neighbor Solicitations to the 3228 same neighbor more frequently than once every RetransTimer 3229 milliseconds. 3231 A Neighbor Cache entry enters the STALE state when created as a 3232 result of receiving packets other than solicited Neighbor 3233 Advertisements (i.e., Router Solicitations, Router Advertisements, 3234 Redirects, and Neighbor Solicitations). These packets contain the 3235 link-layer address of either the sender or, in the case of Redirect, 3236 the redirection target. However, receipt of these link-layer 3237 addresses does not confirm reachability of the forward-direction path 3238 to that node. Placing a newly created Neighbor Cache entry for which 3239 the link-layer address is known in the STALE state provides assurance 3240 that path failures are detected quickly. In addition, should a 3241 cached link-layer address be modified due to receiving one of the 3242 above messages the state SHOULD also be set to STALE to provide 3243 prompt verification that the path to the new link-layer address is 3244 working. 3246 To properly detect the case where a router switches from being a 3247 router to being a host (e.g., if its IP forwarding capability is 3248 turned off by system management), a node MUST compare the Router flag 3249 field in all received Neighbor Advertisement messages with the 3250 IsRouter flag recorded in the Neighbor Cache entry. When a node 3251 detects that a neighbor has changed from being a router to being a 3252 host, the node MUST remove that router from the Default Router List 3253 and update the Destination Cache as described in Section 6.3.5. Note 3254 that a router may not be listed in the Default Router List, even 3255 though a Destination Cache entry is using it (e.g., a host was 3256 redirected to it). In such cases, all Destination Cache entries that 3257 reference the (former) router must perform next-hop determination 3258 again before using the entry. 3260 In some cases, link-specific information may indicate that a path to 3261 a neighbor has failed (e.g., the resetting of a virtual circuit). In 3262 such cases, link-specific information may be used to purge Neighbor 3263 Cache entries before the Neighbor Unreachability Detection would do 3264 so. However, link-specific information MUST NOT be used to confirm 3265 the reachability of a neighbor; such information does not provide 3266 end-to-end confirmation between neighboring IP layers. 3268 8. REDIRECT FUNCTION 3270 This section describes the functions related to the sending and 3271 processing of Redirect messages. 3273 Redirect messages are sent by routers to redirect a host to a better 3274 first-hop router for a specific destination or to inform hosts that a 3275 destination is in fact a neighbor (i.e., on-link). The latter is 3276 accomplished by having the ICMP Target Address be equal to the ICMP 3277 Destination Address. 3279 A router MUST be able to determine the link-local address for each of 3280 its neighboring routers in order to ensure that the target address in 3281 a Redirect message identifies the neighbor router by its link-local 3282 address. For static routing this requirement implies that the next- 3283 hop router's address should be specified using the link-local address 3284 of the router. For dynamic routing this requirement implies that all 3285 IPv6 routing protocols must somehow exchange the link-local addresses 3286 of neighboring routers. | 3288 8.1. Validation of Redirect Messages 3290 A host MUST silently discard any received Redirect message that does 3291 not satisfy all of the following validity checks: 3293 - IP Source Address is a link-local address. Routers must use 3294 their link-local address as the source for Router Advertisement 3295 and Redirect messages so that hosts can uniquely identify 3296 routers. 3298 - The IP Hop Limit field has a value of 255, i.e., the packet 3299 could not possibly have been forwarded by a router. 3301 - If the message includes an IP Authentication Header, the message 3302 authenticates correctly. 3304 - ICMP Checksum is valid. 3306 - ICMP Code is 0. 3308 - ICMP length (derived from the IP length) is 40 or more octets. 3310 - The IP source address of the Redirect is the same as the current 3311 first-hop router for the specified ICMP Destination Address. 3313 - The ICMP Destination Address field in the redirect message does 3314 not contain a multicast address. 3316 - The ICMP Target Address is either a link-local address (when 3317 redirected to a router) or the same as the ICMP Destination 3318 Address (when redirected to the on-link destination). 3320 - All included options have a length that is greater than zero. 3322 The contents of the Reserved field, and of any unrecognized options 3323 MUST be ignored. Future, backward-compatible changes to the protocol 3324 may specify the contents of the Reserved field or add new options; 3325 backward-incompatible changes may use different Code values. 3327 The contents of any defined options that are not specified to be used 3328 with Redirect messages MUST be ignored and the packet processed as 3329 normal. The only defined options that may appear are the Target 3330 Link-Layer Address option and the Redirected Header option. 3332 A host MUST NOT consider a redirect invalid just because the Target 3333 Address of the redirect is not covered under one of the link's 3334 prefixes. Part of the semantics of the Redirect message is that the 3335 Target Address is on-link. 3337 A redirect that passes the validity checks is called a "valid 3338 redirect". 3340 8.2. Router Specification 3342 A router SHOULD send a redirect message, subject to rate limiting, 3343 whenever it forwards a packet that is not explicitly addressed to 3344 itself (i.e. a packet that is not source routed through the router) 3345 in which: 3347 - the Source Address field of the packet identifies a neighbor, 3348 and 3350 - the router determines that a better first-hop node resides on 3351 the same link as the sending node for the Destination Address of 3352 the packet being forwarded, and 3354 - the Destination Address of the packet is not a multicast 3355 address, and 3357 The transmitted redirect packet contains, consistent with the message 3358 format given in Section 4.5: 3360 - In the Target Address field: the address to which subsequent 3361 packets for the destination SHOULD be sent. If the target is a 3362 router, that router's link-local address MUST be used. If the 3363 target is a host the target address field MUST be set to the 3364 same value as the Destination Address field. 3366 - In the Destination Address field: the destination address of the 3367 invoking IP packet. 3369 - In the options: 3371 o Target Link-Layer Address option: link-layer address of the 3372 target, if known. 3374 o Redirected Header: as much of the forwarded packet as can 3375 fit without the redirect packet exceeding 576 octets in 3376 size. 3378 A router MUST limit the rate at which Redirect messages are sent, in 3379 order to limit the bandwidth and processing costs incurred by the 3380 Redirect messages when the source does not correctly respond to the 3381 Redirects, or the source chooses to ignore unauthenticated Redirect 3382 messages. More details on the rate-limiting of ICMP error messages 3383 can be found in [ICMPv6]. 3385 A router MUST NOT update its routing tables upon receipt of a 3386 Redirect. 3388 8.3. Host Specification 3390 A host receiving a valid redirect SHOULD update its Destination Cache 3391 accordingly so that subsequent traffic goes to the specified target. 3392 If no Destination Cache entry exists for the destination, an 3393 implementation SHOULD create such an entry. 3395 If the redirect contains a Target Link-Layer Address option the host 3396 either creates or updates the Neighbor Cache entry for the target. 3397 In both cases the cached link-layer address is copied from the Target 3398 Link-Layer Address option. If a Neighbor Cache entry is created for 3399 the target its reachability state MUST be set to STALE as specified 3400 in Section 7.3.3. If a cache entry already existed and it is updated 3401 with a different link-layer address, its reachability state MUST also | 3402 be set to STALE. If the link-layer address is the same as that | 3403 already in the cache, the cache entry's state remains unchanged. 3405 If the Target and Destination Addresses are the same, the host MUST | 3406 treat the Target as on-link. If the Target Address is not the same | 3407 as the Destination Address, the host MUST set IsRouter to true for | 3408 the target. If the Target and Destination Addresses are the same, | 3409 however, one cannot reliably determine whether the Target Address is | 3410 a router. Consequently, newly created Neighbor Cache entries should | 3411 set the IsRouter flag to false, while existing cache entries should | 3412 leave the flag unchanged. If the Target is a router, subsequent | 3413 Neighbor Advertisement or Router Advertisement messages will update | 3414 IsRouter accordingly. 3416 Redirect messages apply to all flows that are being sent to a given 3417 destination. That is, upon receipt of a Redirect for a Destination 3418 Address, all Destination Cache entries to that address should be 3419 updated to use the specified next-hop, regardless of the contents of 3420 the Flow Label field that appears in the Redirected Header option. 3422 A host MAY have a configuration switch that can be set to make it 3423 ignore a Redirect message that does not have an IP Authentication 3424 header. 3426 A host MUST NOT send Redirect messages. 3428 9. EXTENSIBILITY - OPTION PROCESSING 3430 Options provide a mechanism for encoding variable length fields, 3431 fields that may appear multiple times in the same packet, or 3432 information that may not appear in all packets. Options can also be 3433 used to add additional functionality to future versions of ND. 3435 In order to ensure that future extensions properly coexist with 3436 current implementations, all nodes MUST silently ignore any options 3437 they do not recognize in received ND packets and continue processing 3438 the packet. All options specified in this document MUST be 3439 recognized. A node MUST NOT ignore valid options just because the ND 3440 message contains unrecognized ones. 3442 The current set of options is defined in such a way that receivers 3443 can process multiple options in the same packet independently of each 3444 other. In order to maintain these properties future options SHOULD 3445 follow the simple rule: 3447 The option MUST NOT depend on the presence or absence of any 3448 other options. The semantics of an option should depend only on 3449 the information in the fixed part of the ND packet and on the 3450 information contained in the option itself. 3452 Adhering to the above rule has the following benefits: 3454 1) Receivers can process options independently of one another. For 3455 example, an implementation can choose to process the Prefix 3456 Information option contained in a Router Advertisement message 3457 in a user-space process while the link-layer address option in 3458 the same message is processed by routines in the kernel. 3460 2) Should the number of options cause a packet to exceed a link's 3461 MTU, multiple packets can carry subsets of the options without 3462 any change in semantics. 3464 3) Senders MAY send a subset of options in different packets. For 3465 instance, if a prefix's Valid and Preferred Lifetime are high 3466 enough, it might not be necessary to include the Prefix 3467 Information option in every Router Advertisement. In addition, 3468 different routers might send different sets of options. Thus, a 3469 receiver MUST NOT associate any action with the absence of an 3470 option in a particular packet. This protocol specifies that 3471 receivers should only act on the expiration of timers and on the 3472 information that is received in the packets. 3474 Options in Neighbor Discovery packets can appear in any order; 3475 receivers MUST be prepared to process them independently of their 3476 order. There can also be multiple instances of the same option in a 3477 message (e.g., Prefix Information options). 3479 If the number of included options in a Router Advertisement causes 3480 the advertisement's size to exceed the link MTU, the router can send 3481 multiple separate advertisements each containing a subset of the 3482 options. 3484 The amount of data to include in the Redirected Header option MUST be 3485 limited so that the entire redirect packet does not exceed 576 3486 octets. 3488 All options are a multiple of 8 octets of length, ensuring 3489 appropriate alignment without any "pad" options. The fields in the 3490 options (as well as the fields in ND packets) are defined to align on 3491 their natural boundaries (e.g., a 16-bit field is aligned on a 16-bit 3492 boundary) with the exception of the 128-bit IP addresses/prefixes, 3493 which are aligned on a 64-bit boundary. The link-layer address field 3494 contains an uninterpreted octet string; it is aligned on an 8-bit 3495 boundary. 3497 The size of an ND packet including the IP header is limited to the 3498 link MTU (which is at least 576 octets). When adding options to an 3499 ND packet a node MUST NOT exceed the link MTU. 3501 Future versions of this protocol may define new option types. 3502 Receivers MUST silently ignore any options they do not recognize and 3503 continue processing the message. 3505 10. PROTOCOL CONSTANTS 3507 Router constants: 3509 MAX_INITIAL_RTR_ADVERT_INTERVAL 16 seconds 3511 MAX_INITIAL_RTR_ADVERTISEMENTS 3 transmissions 3513 MAX_FINAL_RTR_ADVERTISEMENTS 3 transmissions 3514 MIN_DELAY_BETWEEN_RAS 3 seconds 3516 MAX_RA_DELAY_TIME .5 seconds 3518 Host constants: 3520 MAX_RTR_SOLICITATION_DELAY 1 second 3522 RTR_SOLICITATION_INTERVAL 4 seconds 3524 MAX_RTR_SOLICITATIONS 3 transmissions 3526 Node constants: 3528 MAX_MULTICAST_SOLICIT 3 transmissions 3530 MAX_UNICAST_SOLICIT 3 transmissions 3532 MAX_ANYCAST_DELAY_TIME 1 second 3534 MAX_NEIGHBOR_ADVERTISEMENT 3 transmissions 3536 REACHABLE_TIME 30,000 milliseconds 3538 RETRANS_TIMER 1,000 milliseconds 3540 DELAY_FIRST_PROBE_TIME 5 seconds 3542 MIN_RANDOM_FACTOR .5 3544 MAX_RANDOM_FACTOR 1.5 3546 Additional protocol constants are defined with the message formats in 3547 Section 4. 3549 All protocol constants are subject to change in future revisions of 3550 the protocol. 3552 The constants in this specification may be overridden by specific 3553 documents that describe how IPv6 operates over different link layers. 3554 This rule allows Neighbor Discovery to operate over links with widely 3555 varying performance characteristics. 3557 11. SECURITY CONSIDERATIONS 3559 Neighbor Discovery is subject to attacks that cause IP packets to 3560 flow to unexpected places. Such attacks can be used to cause denial 3561 of service but also allow nodes to intercept and optionally modify 3562 packets destined for other nodes. 3564 The protocol reduces the exposure to such threats in the absence of 3565 authentication by ignoring ND packets received from off-link senders. 3566 The Hop Limit field of all received packets is verified to contain 3567 255, the maximum legal value. Because routers decrement the Hop 3568 Limit on all packets they forward, received packets containing a Hop 3569 Limit of 255 must have originated from a neighbor. 3571 An example of denial of service attacks is that a node on the link | 3572 that can send packets with an arbitrary IP source address can both | 3573 advertise itself as a default router and also send "forged" Router | 3574 Advertisement messages that immediately time out all other default | 3575 routers as well as all on-link prefixes. An intruder can achieve | 3576 this by sending out multiple Router Advertisements, one for each | 3577 legitimate router, with the source address set to the address of | 3578 another router, the Router Lifetime field set to zero, and the | 3579 Preferred and Valid lifetimes set to zero for all the prefixes. Such | 3580 an attack would cause all packets, for both on-link and off-link | 3581 destinations, to go to the rogue router. That router can then | 3582 selectively examine, modify or drop all packets sent on the link. | 3583 The Neighbor Unreachability Detection will not detect such a black | 3584 hole as long as the rogue router politely answers the NUD probes with | 3585 a Neighbor Advertisement with the R-bit set. | 3587 Many link layers are also subject to different denial of service | 3588 attacks such as continuously occupying the link in CSMA/CD networks | 3589 (e.g., by sending packets closely back-to-back or asserting the | 3590 collision signal on the link), or originating packets with somebody | 3591 else's source MAC address to confuse, e.g., Ethernet switches. | 3593 The trust model for redirects is the same as in IPv4. A redirect is 3594 accepted only if received from the same router that is currently 3595 being used for that destination. It is natural to trust the routers 3596 on the link. If a host has been redirected to another node (i.e., 3597 the destination is on-link) there is no way to prevent the target 3598 from issuing another redirect to some other destination. However, 3599 this exposure is no worse than it was; the target host, once 3600 subverted, could always act as a hidden router to forward traffic 3601 elsewhere. 3603 The protocol contains no mechanism to determine which neighbors are 3604 authorized to send a particular type of message e.g. Router 3605 Advertisements; any neighbor, presumably even in the presence of 3606 authentication, can send Router Advertisement messages thereby being 3607 able to cause denial of service. Furthermore, any neighbor can send 3608 proxy Neighbor Advertisements as well as unsolicited Neighbor 3609 Advertisements as a potential denial of service attack. 3611 Neighbor Discovery protocol packet exchanges can be authenticated 3612 using the IP Authentication Header [IPv6-AUTH]. A node SHOULD 3613 include an Authentication Header when sending Neighbor Discovery 3614 packets if a security association for use with the IP Authentication 3615 Header exists for the destination address. The security associations 3616 may have been created through manual configuration or through the 3617 operation of some key management protocol. 3619 Received Authentication Headers in Neighbor Discovery packets MUST be 3620 verified for correctness and packets with incorrect authentication 3621 MUST be ignored. 3623 It SHOULD be possible for the system administrator to configure a 3624 node to ignore any Neighbor Discovery messages that are not 3625 authenticated using either the Authentication Header or Encapsulating 3626 Security Payload. The configuration technique for this MUST be 3627 documented. Such a switch SHOULD default to allowing unauthenticated 3628 messages. 3630 Confidentiality issues are addressed by the IP Security Architecture 3631 and the IP Encapsulating Security Payload documents [IPv6-SA, IPv6- 3632 ESP]. 3634 12. RENUMBERING CONSIDERATIONS | 3636 The Neighbor Discovery protocol together with IPv6 Address | 3637 Autoconfiguration [ADDRCONF] provides mechanisms to aid in | 3638 renumbering - new prefixes and addresses can be introduced and old | 3639 ones can be deprecated and removed. | 3641 The robustness of these mechanisms is based on all the nodes on the | 3642 link receiving the Router Advertisement messages in a timely manner. | 3643 However, a host might be turned off or be unreachable for an extended | 3644 period of time (i.e., a machine is powered down for months after a | 3645 project terminates). It is possible to preserve robust renumbering | 3646 in such cases but it does place some constraints on how long prefixes | 3647 must be advertised. | 3649 For example, if a prefix is initially advertised with a lifetime of 2 | 3650 months, and on August 1st it is determined that the prefix needs to | 3651 be deprecated and removed due to renumbering by September 1st. This | 3652 can be done by reducing the advertised lifetime to 1 week starting on | 3653 August 1st and as the cutoff gets closer the lifetimes can be made | 3654 shorter until by September 1st the prefix is advertised with a zero | 3655 lifetime. The point is that, if one or more nodes were unplugged | 3656 from the link prior to September 1st they might still think that the | 3657 prefix is valid since the last lifetime they received was 2 months. | 3658 Thus if a node was unplugged on July 31st it thinks the prefix is | 3659 valid until September 30th. If that node is plugged back in prior to | 3660 September 30th it may continue to use the old prefix. The only way | 3661 to force a node to stop using a prefix that was previously advertised | 3662 with a long Lifetime is to have that node receive an advertisement | 3663 for that prefix that changes the lifetime downward. The solution in | 3664 this example is simple: continue advertising the prefix with a small | 3665 lifetime (i.e., 2 hours [ADDRCONF]) until October 1st. | 3667 In general, in order to be robust against nodes that might be | 3668 unplugged from the link it is important to track the furthest into | 3669 the future a particular prefix can be viewed valid by any node on the | 3670 link. The prefix must then be advertised at least until that point | 3671 in time using a 0-hour lifetime once the prefix should no longer be | 3672 used. This "furthest into the future" time is simply the maximum, | 3673 over all Router Advertisements, of the time the advertisement was | 3674 sent plus the prefix's Lifetime contained in the advertisement. | 3676 The above has an important implication on using infinite lifetimes. | 3677 If a prefix is advertised with an infinite lifetime, and that prefix | 3678 later needs to be renumbered, it is undesirable to continue | 3679 advertising that prefix with a zero lifetime forever. Thus either | 3680 infinite lifetimes should be avoided or there must be a limit on how | 3681 long time a node can be unplugged from the link before it is plugged | 3682 back in again. However, it is unclear how the network administrator | 3683 can enforce a limit on how long time hosts such as laptops can be | 3684 unplugged from the link. | 3686 Network administrators should give serious consideration to using | 3687 relatively short lifetimes (i.e., no more than a few weeks). While | 3688 it might appear that using long lifetimes would help insure | 3689 robustness, in reality a host will be unable to communicate in the | 3690 absence of properly functioning routers. Such routers will be | 3691 sending Router Advertisements that contain appropriate (and current) | 3692 prefixes. A host connected to a network that has no functioning | 3693 routers is likely to have more serious problems than just a lack of a | 3694 valid prefix. | 3696 The above discussion does not distinguish between the preferred and | 3697 valid lifetimes. For all practical purposes it is probably | 3698 sufficient to track the valid lifetime since the preferred lifetime | 3699 will not exceed the valid lifetime. | 3701 REFERENCES 3703 [ADDRCONF] S. Thomson, T. Narten, "IPv6 Address Autoconfiguration", | 3704 RFC 1971, August 1996. 3706 [ADDR-ARCH] S. Deering, R. Hinden, Editors, "IP Version 6 Addressing | 3707 Architecture", Work in progress (update to RFC 1884), draft- | 3708 ietf-ipngwg-addr-arch-v2-02.txt. 3710 [ANYCST] C. Partridge, T. Mendez, and W. Milliken, "Host Anycasting 3711 Service", RFC 1546, November 1993. 3713 [ARP] D. Plummer, "An Ethernet Address Resolution Protocol", STD 37, 3714 RFC 826, November 1982. 3716 [HR-CL] R. Braden, Editor, "Requirements for Internet Hosts -- 3717 Communication Layers", STD 3, RFC 1122, October 1989. 3719 [ICMPv4] J. Postel, "Internet Control Message Protocol", STD 5, RFC 3720 792, September 1981. 3722 [ICMPv6] A. Conta, and S. Deering, "Internet Control Message Protocol 3723 (ICMPv6) for the Internet Protocol Version 6 (IPv6)", RFC 3724 1885, January 1996. 3726 [IPv6] S. Deering, R. Hinden, Editors, "Internet Protocol, Version 6 | 3727 (IPv6) Specification", RFC 1883, January 1996. 3729 [IPv6-ETHER] M. Crawford. "A Method for the Transmission of IPv6 3730 Packets over Ethernet Networks", RFC 1972, August 1996. | 3732 [IPv6-SA] R. Atkinson. "Security Architecture for the Internet 3733 Protocol". RFC 1825, August 1995. 3735 [IPv6-AUTH] R. Atkinson. "IP Authentication Header", RFC 1826, August | 3736 1995. 3738 [IPv6-ESP] R. Atkinson. "IP Encapsulating Security Payload (ESP)", 3739 RFC 1827, August 1995. 3741 [KEYWORDS] S. Bradner, "Key words for use in RFCs to Indicate | 3742 Requirement Levels", RFC 2119, March 1997. | 3744 [RDISC] S. Deering, "ICMP Router Discovery Messages", RFC 1256, 3745 September 1991. 3747 [SH-MEDIA] R. Braden, J. Postel, Y. Rekhter, "Internet Architecture 3748 Extensions for Shared Media", RFC 1620, May 1994. 3750 [ASSIGNED] J. Reynolds, J. Postel, "ASSIGNED NUMBERS", RFC 1700, 3751 October 1994. 3753 [SYNC] S. Floyd, V. Jacobsen, "The Synchronization of Periodic Routing 3754 Messages", IEEE/ACM Transactions on Networking, April 1994. 3755 ftp://ftp.ee.lbl.gov/papers/sync_94.ps.Z 3757 AUTHORS' ADDRESSES 3759 Erik Nordmark Thomas Narten 3760 Sun Microsystems, Inc. IBM Corporation 3761 901 San Antonio Road P.O. Box 12195 | 3762 Palo Alto, CA 94303 Research Triangle Park, NC 27709-2195 | 3763 USA USA 3765 phone: +1 415 786 5166 phone: +1 919 254 7798 3766 fax: +1 415 786 5896 fax: +1 919 254 4027 3767 email: nordmark@sun.com email: narten@vnet.ibm.com 3769 William Allen Simpson 3770 Daydreamer 3771 Computer Systems Consulting Services 3772 1384 Fontaine 3773 Madison Heights, Michigan 48071 3774 USA 3776 email: Bill.Simpson@um.cc.umich.edu 3777 bsimpson@MorningStar.com 3779 APPENDIX A: MULTIHOMED HOSTS | 3781 There are a number of complicating issues that arise when Neighbor 3782 Discovery is used by hosts that have multiple interfaces. This 3783 section does not attempt to define the proper operation of multihomed 3784 hosts with regard to Neighbor Discovery. Rather, it identifies 3785 issues that require further study. Implementors are encouraged to 3786 experiment with various approaches to making Neighbor Discovery work 3787 on multihomed hosts and to report their experiences. 3789 If a multihomed host receives Router Advertisements on all of its 3790 interfaces, it will (probably) have learned on-link prefixes for the 3791 addresses residing on each link. When a packet must be sent through 3792 a router, however, selecting the "wrong" router can result in a 3793 suboptimal or non-functioning path. There are number of issues to 3794 consider: 3796 1) In order for a router to send a redirect, it must determine that 3797 the packet it is forwarding originates from a neighbor. The 3798 standard test for this case is to compare the source address of 3799 the packet to the list of on-link prefixes associated with the 3800 interface on which the packet was received. If the originating 3801 host is multihomed, however, the source address it uses may 3802 belong to an interface other than the interface from which it 3803 was sent. In such cases, a router will not send redirects, and 3804 suboptimal routing is likely. In order to be redirected, the 3805 sending host must always send packets out the interface 3806 corresponding to the outgoing packet's source address. Note 3807 that this issue never arises with non-multihomed hosts; they 3808 only have one interface. 3810 2) If the selected first-hop router does not have a route at all 3811 for the destination, it will be unable to deliver the packet. 3812 However, the destination may be reachable through a router on 3813 one of the other interfaces. Neighbor Discovery does not 3814 address this scenario; it does not arise in the non-multihomed 3815 case. 3817 3) Even if the first-hop router does have a route for a 3818 destination, there may be a better route via another interface. 3819 No mechanism exists for the multihomed host to detect this 3820 situation. 3822 If a multihomed host fails to receive Router Advertisements on one or 3823 more of its interfaces, it will not know (in the absence of 3824 configured information) which destinations are on-link on the 3825 affected interface(s). This leads to a number of problems: 3827 1) If no Router Advertisement is received on any interfaces, a 3828 multihomed host will have no way of knowing which interface to 3829 send packets out on, even for on-link destinations. Under 3830 similar conditions in the non-multihomed host case, a node 3831 treats all destinations as residing on-link, and communication 3832 proceeds. In the multihomed case, however, additional 3833 information is needed to select the proper outgoing interface. 3834 Alternatively, a node could attempt to perform address 3835 resolution on all interfaces, a step involving significant 3836 complexity that is not present in the non-multihomed host case. 3838 2) If Router Advertisements are received on some, but not all 3839 interfaces, a multihomed host could choose to only send packets 3840 out on the interfaces on which it has received Router 3841 Advertisements. A key assumption made here, however, is that 3842 routers on those other interfaces will be able to route packets 3843 to the ultimate destination, even when those destinations reside 3844 on the subnet to which the sender connects, but has no on-link 3845 prefix information. Should the assumption be false, 3846 communication would fail. Even if the assumption holds, packets 3847 will traverse a sub-optimal path. 3849 APPENDIX B: FUTURE EXTENSIONS | 3851 Possible extensions for future study are: 3853 o Using dynamic timers to be able to adapt to links with widely 3854 varying delay. Measuring round trip times, however, requires 3855 acknowledgments and sequence numbers in order to match received 3856 Neighbor Advertisements with the actual Neighbor Solicitation that 3857 triggered the advertisement. Implementors wishing to experiment 3858 with such a facility could do so in a backwards-compatible way by 3859 defining a new option carrying the necessary information. Nodes 3860 not understanding the option would simply ignore it. 3862 o Adding capabilities to facilitate the operation over links that 3863 currently require hosts to register with an address resolution 3864 server. This could for instance enable routers to ask hosts to 3865 send them periodic unsolicited advertisements. Once again this 3866 can be added using a new option sent in the Router Advertisements. 3868 o Adding additional procedures for links where asymmetric and non- 3869 transitive reachability is part of normal operations. Such 3870 procedures might allow hosts and routers to find usable paths on, 3871 e.g., radio links. 3873 APPENDIX C: STATE MACHINE FOR THE REACHABILITY STATE | 3875 This appendix contains a summary of the rules specified in Sections 3876 7.2 and 7.3. This document does not mandate that implementations 3877 adhere to this model as long as their external behavior is consistent 3878 with that described in this document. 3880 When performing address resolution and Neighbor Unreachability 3881 Detection the following state transitions apply using the conceptual 3882 model: 3884 State Event Action New state 3886 - Packet to send. Create entry. INCOMPLETE 3887 Send multicast NS. 3888 Start retransmit timer 3890 INCOMPLETE Retransmit timeout, Retransmit NS INCOMPLETE 3891 less than N Start retransmit timer 3892 retransmissions. 3894 INCOMPLETE Retransmit timeout, Discard entry - 3895 N or more Send ICMP error 3896 retransmissions. 3898 INCOMPLETE NA, Solicited=0, Record link-layer STALE 3899 Override=any address. Send queued 3900 packets. 3902 INCOMPLETE NA, Solicited=1, Record link-layer REACHABLE 3903 Override=any address. Send queued 3904 packets. 3906 !INCOMPLETE NA, Solicited=1, - REACHABLE 3907 Override=0 3908 Same link-layer | 3909 address as cached. | 3911 !INCOMPLETE NA, Solicited=1, - unchanged| 3912 Override=0 | 3913 Different link-layer | 3914 address than cached. | 3916 !INCOMPLETE NA, Solicited=1, Record link-layer REACHABLE 3917 Override=1 address (if | 3918 different). | 3920 !INCOMPLETE NA, Solicited=0, - unchanged| 3921 Override=0 3923 !INCOMPLETE NA, Solicited=0, - unchanged| 3924 Override=1 | 3925 Same link-layer | 3926 address as cached. | 3928 !INCOMPLETE NA, Solicited=0, Record link-layer STALE 3929 Override=1 address. 3930 Different link-layer | 3931 address than cached. | 3933 !INCOMPLETE upper-layer reachability - REACHABLE 3934 confirmation 3936 REACHABLE timeout, more than - STALE 3937 N seconds since 3938 reachability confirm. 3940 STALE Sending packet Start delay timer DELAY 3942 DELAY Delay timeout Send unicast NS probe PROBE 3943 Start retransmit timer 3945 PROBE Retransmit timeout, Retransmit NS PROBE 3946 less than N 3947 retransmissions. 3949 PROBE Retransmit timeout, Discard entry - 3950 N or more 3951 retransmissions. 3953 The state transitions for receiving unsolicited information other 3954 than Neighbor Advertisement messages apply to either the source of 3955 the packet (for Neighbor Solicitation, Router Solicitation, and 3956 Router Advertisement messages) or the target address (for Redirect 3957 messages) as follows: 3959 State Event Action New state 3961 - NS, RS, RA, Redirect Create entry. STALE 3963 INCOMPLETE NS, RS, RA, Redirect Record link-layer STALE 3964 address. Send queued 3965 packets. 3967 !INCOMPLETE NS, RS, RA, Redirect Update link-layer STALE 3968 Different link-layer address 3969 address than cached. 3971 !INCOMPLETE NS, RS, RA, Redirect - unchanged 3972 Same link-layer 3973 address as cached. 3975 APPENDIX D: SUMMARY OF ISROUTER RULES | 3977 This appendix presents a summary of the rules for maintaining the | 3978 IsRouter flag as specified in this document. | 3980 The background for these rules is that the ND messages contain, | 3981 either implicitly or explicitly, information that indicates whether | 3982 or not the sender (or Target Address) is a host or a router. The | 3983 following assumptions are used: | 3985 - The sender of a Router Solicitation is implicitly assumed to be a | 3986 host since there is no need for routers to send such messages. | 3988 - The sender of a Router Advertisement is implicitly assumed to be a | 3989 router. | 3991 - Neighbor Solicitation messages do not contain either an implicit | 3992 or explicit indication about the sender. Both hosts and routers | 3993 send such messages. | 3995 - Neighbor Advertisement messages contain an explicit "IsRouter | 3996 flag", the R-bit. | 3998 - The target of the redirect, when the target differs from the | 3999 destination address in the packet being redirected, is implicitly | 4000 assumed to be a router. This is a natural assumption since that | 4001 node is expected to be able to forward the packets towards the | 4002 destination. | 4004 - The target of the redirect, when the target is the same as the | 4005 destination, does not carry any host vs. router information. All | 4006 that is known is that the destination (i.e. target) is on-link but | 4007 it could be either a host or a router. | 4009 The rules for setting the IsRouter flag are based on the information | 4010 content above. If an ND message contains explicit or implicit | 4011 information the receipt of the message will cause the IsRouter flag | 4012 to be updated. But when there is no host vs. router information in | 4013 the ND message the receipt of the message MUST NOT cause a change to | 4014 the IsRouter state. When the receipt of such a message causes a | 4015 Neighbor Cache entry to be created this document specifies that the | 4016 IsRouter flag be set to false. There is greater potential for | 4017 mischief when a node incorrectly thinks a host is a router, than the | 4018 other way around. In these cases a subsequent Neighbor Advertisement | 4019 or Router Advertisement message will set the correct IsRouter value. | 4021 APPENDIX E: IMPLEMENTATION ISSUES | 4023 Appendix E.1: Reachability confirmations | 4025 Neighbor Unreachability Detection requires explicit confirmation that 4026 a forward-path is functioning properly. To avoid the need for 4027 Neighbor Solicitation probe messages, upper layer protocols should 4028 provide such an indication when the cost of doing so is small. 4029 Reliable connection-oriented protocols such as TCP are generally 4030 aware when the forward-path is working. When TCP sends (or receives) 4031 data, for instance, it updates its window sequence numbers, sets and 4032 cancels retransmit timers, etc. Specific scenarios that usually 4033 indicate a properly functioning forward-path include: 4035 - Receipt of an acknowledgement that covers a sequence number (e.g., 4036 data) not previously acknowledged indicates that the forward path 4037 was working at the time the data was sent. 4039 - Completion of the initial three-way handshake is a special case of 4040 the previous rule; although no data is sent during the handshake, 4041 the SYN flags are counted as data from the sequence number 4042 perspective. This applies to both the SYN+ACK for the active open 4043 the ACK of that packet on the passively opening peer. 4045 - Receipt of new data (i.e., data not previously received) indicates 4046 that the forward-path was working at the time an acknowledgement 4047 was sent that advanced the peer's send window that allowed the new 4048 data to be sent. 4050 To minimize the cost of communicating reachability information 4051 between the TCP and IP layers, an implementation may wish to rate- 4052 limit the reachability confirmations its sends IP. One possibility 4053 is to process reachability only every few packets. For example, one 4054 might update reachability information once per round trip time, if an 4055 implementation only has one round trip timer per connection. For 4056 those implementations that cache Destination Cache entries within 4057 control blocks, it may be possible to update the Neighbor Cache entry 4058 directly (i.e., without an expensive lookup) once the TCP packet has 4059 been demultiplexed to its corresponding control block. For other 4060 implementation it may be possible to piggyback the reachability 4061 confirmation on the next packet submitted to IP assuming that the 4062 implementation guards against the piggybacked confirmation becoming 4063 stale when no packets are sent to IP for an extended period of time. 4065 TCP must also guard against thinking "stale" information indicates 4066 current reachability. For example, new data received 30 minutes 4067 after a window has opened up does not constitute a confirmation that 4068 the path is currently working. In merely indicates that 30 minutes 4069 ago the window update reached the peer i.e. the path was working at 4070 that point in time. An implementation must also take into account 4071 TCP zero-window probes that are sent even if the path is broken and 4072 the window update did not reach the peer. 4074 For UDP based applications (RPC, DNS) it is relatively simple to make 4075 the client send reachability confirmations when the response packet 4076 is received. It is more difficult and in some cases impossible for 4077 the server to generate such confirmations since there is no flow 4078 control, i.e., the server can not determine whether a received 4079 request indicates that a previous response reached the client. 4081 Note that an implementation can not use negative upper-layer advise 4082 as a replacement for the Neighbor Unreachability Detection algorithm. 4083 Negative advise (e.g. from TCP when there are excessive 4084 retransmissions) could serve as a hint that the forward path from the 4085 sender of the data might not be working. But it would fail to detect 4086 when the path from the receiver of the data is not functioning 4087 causing, none of the acknowledgement packets to reach the sender. | 4089 APPENDIX F: CHANGES SINCE RFC 1970 | 4091 The following changes, which are also marked with change bars ('|' or | 4092 '*') in the right margin, have been made since RFC 1970: | 4094 o Removed all references to the IPv6 priority field. | 4096 o Replaced definition of solicited node MC address with a reference | 4097 to the [ADDR-ARCH] specification. That specification says that | 4098 "the solicited-node multicast address is formed by taking the | 4099 low-order 24 bits of the address (unicast or anycast) and | 4100 appending those bits to the prefix FF02:0:0:0:0:1:FF00::/104". | 4102 o Updated the references section to list (new) RFC numbers. | 4103 o Updated the text in section 7.2.5 and the tables in appendix C to | 4104 have the receipt of a NS only update the state of an existing | 4105 neighbor cache entry if the link-layer address is different than | 4106 the recorded link-layer address. | 4108 o Updated the text in section 4.4 to clearly state that an NA must | 4109 contain a target link-layer address when the NS was multicast in | 4110 order to avoid a potential NS "war" where neither side is able to | 4111 send a NA because neither ever obtains the link-layer address of | 4112 its peer. | 4114 o Added check in section 7.1.1 that received NS from an unsolicited | 4115 address are sent to solicited-node multicast address; if sent to | 4116 unicast destination, silently discard. | 4118 o Added requirement in section 6.2.1 that Lifetimes be configurable | 4119 in either of two ways: as a fixed value that doesn't change over | 4120 time, or one that decrements in real time. | 4122 o Added text to section 6.3.4 to point out that [ADDRCONF] might | 4123 ignore short lifetimes but that ND does not ignore short prefix | 4124 lifetimes. | 4126 o Clarified the rules for RS and NS packets with the unspecified | 4127 source. MUST NOT include source link-layer address option and | 4128 this is verified by the receivers. | 4130 o Clarified in section 7.2.3 that addresses for which the node | 4131 proxies are acceptable in NS messages. Previously the text only | 4132 talk about unicast and anycast addresses assigned to the interface | 4133 which would not include proxy addresses. | 4135 o Tightened up ambiguities an inconsistencies regarding when to set | 4136 the IsRouter flag in Neighbor Cache entries. Added an appendix to | 4137 summarize these rules. | 4139 o Added a section on renumbering considerations to clarify how long | 4140 prefixes have to be advertised when the lifetime(s) are reduced. |