2. Protocol Overview
Before a host can send IP datagrams beyond its directly-attached subnet, it must discover the address of at least one operational router on that subnet. Typically, this is accomplished by reading a list of one or more router addresses from a (possibly remote) configuration file at startup time. On multicast links, some hosts also discover router addresses by listening to routing protocol traffic. Both of these methods have serious drawbacks: configuration files must be maintained manually -- a significant administrative burden -- and are unable to track dynamic changes in router availability; eavesdropping on routing traffic requires that hosts recognize the particular routing protocols in use, which vary from subnet to subnet and which are subject to change at any time. This document specifies an alternative router discovery method using a pair of ICMP [10] messages, for use on multicast links. It eliminates the need for manual configuration of router addresses and is independent of any specific routing protocol.
The ICMP router discovery messages are called "Router Advertisements" and "Router Solicitations". Each router periodically multicasts a Router Advertisement from each of its multicast interfaces, announcing the IP address(es) of that interface. Hosts discover the addresses of their neighboring routers simply by listening for advertisements. When a host attached to a multicast link starts up, it may multicast a Router Solicitation to ask for immediate advertisements, rather than waiting for the next periodic ones to arrive; if (and only if) no advertisements are forthcoming, the host may retransmit the solicitation a small number of times, but then must desist from sending any more solicitations. Any routers that subsequently start up, or that were not discovered because of packet loss or temporary link partitioning, are eventually discovered by reception of their periodic (unsolicited) advertisements. (Links that suffer high packet loss rates or frequent partitioning are accommodated by increasing the rate of advertisements, rather than increasing the number of solicitations that hosts are permitted to send.)
The router discovery messages do not constitute a routing protocol: they enable hosts to discover the existence of neighboring routers, but not which router is best to reach a particular destination. If a host chooses a poor first-hop router for a particular destination, it should receive an ICMP Redirect from that router, identifying a better one.
A Router Advertisement includes a "preference level" for each advertised router address. When a host must choose a default router address (i.e., when, for a particular destination, the host has not been redirected or configured to use a specific router address), it is expected to choose from those router addresses that have the highest preference level (see Section 3.3.1 in the Host Requirements -- Communication Layers RFC [1]). A network administrator can configure router address preference levels to encourage or discourage the use of particular routers as default routers.
A Router Advertisement also includes a "lifetime" field, specifying the maximum length of time that the advertised addresses are to be considered as valid router addresses by hosts, in the absence of further advertisements. This is used to ensure that hosts eventually forget about routers that fail, become unreachable, or stop acting as routers.
The default advertising rate is once every 7 to 10 minutes, and the default lifetime is 30 minutes. This means that, using the default values, the advertisements are not sufficient as a mechanism for "black hole" detection, i.e., detection of failure of the first hop of an active path -- ideally, black holes should be detected quickly enough to switch to another router before any transport connections or higher-layer sessions time out. It is assumed that hosts already have mechanisms for black hole detection, as required by [1]. Hosts cannot depend on Router Advertisements for this purpose, since they may be unavailable or administratively disabled on any particular link or from any particular router. Therefore, the default advertising rate and lifetime values were chosen simply to make the load imposed on links and hosts by the periodic multicast advertisements negligible, even when there are many routers present. However, a network administrator who wishes to employ advertisements as a supplemental black hole detection mechanism is free to configure smaller values.