1. Field of the Invention
The present invention relates to computer networks. More specifically, the present invention relates to a method and an apparatus for detecting a non-compliant router that improperly responds to ARP requests for IPv4 Link-Local addresses.
2. Related Art
In order to participate in an Internet Protocol (IP) network, a network node, such as a computer or a printer, needs to be configured with an IP address. Additionally, in order communicate with another device using IP over Ethernet or similar media, the network node needs the ability to translate an IP address for the device into the corresponding hardware (e.g. Ethernet) address for the device. The Address Resolution Protocol (ARP) solves this translation problem by providing an address-resolution mechanism which determines the hardware address for a given IP address, thereby enabling a network node to participate in an IP network.
IP addresses can be configured either manually by the user, or automatically with the help of another network node, such as a DHCP server. Unfortunately, a DHCP server may not always be available. Furthermore, it is cumbersome to have the user configure an IP address. Therefore, there is a strong need for a configuration mechanism by which a network node can automatically configure an IP address on its own.
IPv4 Link-local addressing (RFC 3927) provides such a configuration mechanism. In IPv4 link-local addressing, a configuration mechanism within a network node randomly picks a “candidate” IP address in a specified link-local address range and sends an ARP request to check whether the candidate link-local IP address is unique within the scope of the link. If the candidate link-local IP address is already in use by another network node, then the configuration mechanism picks another link-local IP address and checks whether that is unique. Once the configuration mechanism finds a unique link-local IP address, the network node uses it to communicate with other nodes in the network.
Unfortunately, some network routers are misconfigured to respond to all ARP requests, including ARP requests for any link-local IP address. If such a router is attached to a local network, it can interfere with the configuration mechanism by responding to ARP requests sent by the configuration mechanism, making it appear as if every single possible address is already in use. This can prevent the configuration mechanism from selecting an IP address.
For example, FIG. 1 illustrates how a router can interfere with the process of assigning an IP address. During operation, node A selects a candidate IP address (step 102). Next, node A probes for the candidate IP address by performing an ARP request (step 104). The interfering router then responds to the ARP request (step 106). This causes node A to infer that another node already has the IP address, and to select a different candidate IP address (step 108). The system then returns to step 104 and the process repeats indefinitely. Consequently, node A is unable to assign an IP address.
Note that if such a router is configured to ignore ARP “probes,” which are sent by a device that is attempting to assign a link-local IP address, the router can still interfere with normal (non-probe) ARP requests, which are sent to determine an Ethernet address associated with an IP address.
For example, FIG. 2 illustrates how a router can interfere with normal ARP requests. First, a node A sends an ARP request with the IP address of a device that node A wants to communicate with (step 202). Next, a router incorrectly responds to the ARP request, interfering with the response from the actual device that node A wants to communicate with (step 204). This causes node A to obtain the wrong Ethernet address. IP packets are subsequently sent to the router instead of to the desired device, where they are lost because the router either forwards them incorrectly, or simply discards them without forwarding at all.
Hence, what is needed is a method and an apparatus for handling the above-described problems encountered while performing ARP requests.