ASCII.jp What happens if the IP addresses of computers in the LAN overlap?

An IP address is a 32-bit number used by the Internet Protocol (IP) to identify a communication partner. Windows and other systems have a mechanism for detecting duplicate IP addresses, so normally the same IP address cannot be assigned. So what happens if you dare to assign the same IP address?

What is IP address assignment?

A computer that connects to the Internet needs an IP address. Strictly speaking, however, the MAC address for Ethernet is assigned to the LAN card, while the IP address is assigned to the communication function of the OS. Therefore, when MAC addresses are called "hardware addresses", IP addresses are called "software addresses" to distinguish them.

There are two main ways to assign IP addresses to the communication functions of your OS. The first is manual assignment by users or administrators. In this case, the communication function of the OS checks whether the assigned IP address is duplicated at least within the LAN using ARP (Address Resolution Protocol). ARP is a protocol for checking the MAC address corresponding to a given IP address. It is also used as a mechanism to prevent duplication of IP addresses.

ASCII.jp What happens if the IP addresses overlap?

For example, computer A wants to send a packet to computer B, which has an IP address of "10.20.30.40". However, in Ethernet, which operates below IP, the MAC address is used to identify the communication partner, so it is necessary to find out what the MAC address corresponds to "10.20.30.40". Computer A then broadcasts an ARP message saying "What is the MAC address of the computer assigned the IP address 10.20.30.40?"

Broadcast is a "broadcast" type of communication that does not specify the communication partner, so this ARP message reaches all computers in the subnet. If computer B is in the same subnet, by sending back an ARP message saying "The MAC address corresponding to the IP address 10.20.30.40 is 00:11:22:33:44:55", computer B's Find out the MAC address. This exchange allows computer A to send packets over IP to computer B.

In principle, duplicate IP addresses are automatically detected

The OS uses this ARP to detect duplicate IP addresses. For example, let's say Computer C is assigned the IP address 90.80.70.60. When the computer starts up and the OS's communication functions are initialized, the OS sends an ARP message with the meaning of "What is the MAC address of the computer assigned the IP address 90.80.70.60?" This ARP message differs from the previous ARP message sent by computer A in that the original IP address is its own. Moreover, since 90.80.70.60 is your own IP address, you should know that the MAC address of your own LAN card corresponds.

But what if computer D in the subnet was also assigned the IP address 90.80.70.60? Computer D replies that the MAC address corresponding to that IP address is its own. In other words, if you send an ARP message for your own assigned IP address and get a reply, that IP address is already in use. If there is a device with the same IP address in the subnet, Windows will display a warning and the TCP/IP function will be in a state where no IP address has been assigned (screen 1).

Screen 1 where Windows detects a duplicate IP address. When duplicates are detected by ARP, Windows sets the IP address to "0.0.0.0", so the TCP/IP function cannot be used.