Background: Know: prereq - link-local address, ARP Recognize:
See also: randomness complicates NM
Choosing a Link-Local AddressEdit
Link Local addresses can be configured manually or automatically. Automatic assignment of link-local address is part of autoconfiguration . Autoconfiguration is a process where the host automatically assigns a link-local address to itself.
In IPv4, only one type of address can be configured to a host. A host cannot have a link-local address and a routable address at the same time. That is why an IPv4 enabled host first looks up for a DHCP server and will auto configure a link-local address only if it cannot find any. The address block used in autoconfiguration is 169.254.0.0/16 which is defined in RFC 3330 .
Whereas, IPv6 requires that a link-local address is assigned along with a routable address to each host. This address address is used for IPv6 sublayer operations of the Neighbor Discovery Protocol , as well as for some other IPv6-based protocols, like DHCPv6. The address block used for link-local address in IPv6 is fe80::/10.
Autoconfiguration of a link-local address in IPv4 have three steps - 1. Address Selection 2. Probing Test & 3. Announce Address.
1) Address selection:Edit
When a host wishes to configure an IPv4 Link-local Address, it selects an address using a pseudo-random number generator with a uniform distribution in the range from 169.254.1.0 to 169.254.254.255 inclusive. The pseudo-random number generation algorithm MUST be chosen so that different hosts do not generate the same sequence of numbers.Typically each host uses its own MAC address and a random seed to generate the pseudorandom number. This ensures that each host generates the same number each time which provides consistency in address selection.
2) Probing test:Edit
On a link-layer such as IEEE 802 that supports ARP, conflict detection is done using ARP probes.A host probes to see if an address is already in use by broadcasting an ARP Request for the desired address. The client MUST fill in the 'sender hardware address' field of the ARP Request with the hardware address of the interface through which it is sending the packet. The 'sender IP address' field MUST be set to all zeroes, to avoid polluting ARP caches in other hosts on the same link in the case where the address turns out to be already in use by another host. The 'target hardware address' field is ignored and SHOULD be set to all zeroes. The 'target IP address' field MUST be set to the address being probed. An ARP Request constructed this way with an all-zero 'sender IP address' is referred to as an "ARP Probe".
3) Announce address:Edit
Having probed to determine a unique address to use, the host MUST then announce its claimed address by broadcasting ANNOUNCE_NUM ARP announcements, spaced ANNOUNCE_INTERVAL seconds apart. An ARP announcement is identical to the ARP Probe described above, except that now the sender and target IP addresses are both set to the host's newly selected IPv4 address. The purpose of these ARP announcements is to make sure that other hosts on the link do not have stale ARP cache entries left over from some other host that may previously have been using the same address.