What happens if the IP addresses of...

31
03

What happens if the IP addresses of the PCs in the LAN overlap?

An IP address is a 32-bit number used by IP (Internet Protocol) to identify a communication partner. Since Windows etc. have a mechanism to detect duplicate IP addresses, it is usually not possible to assign the same IP address. So what happens if you dare to assign the same IP address?

What is IP address assignment?

Computers that connect to the Internet need an IP address. However, strictly speaking, 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 the MAC address is called "hardware address", the IP address is called "software address" to distinguish it.

LAN内のパソコンのIPアドレスが重なるとどうなる?

There are two main ways to assign an IP address to the communication function of the OS. One is for users and administrators to manually assign. In this case, the communication function of the OS checks whether the assigned IP address is at least duplicated in the LAN by "ARP (Address Resolution Protocol)". ARP is a protocol for finding the MAC address corresponding to a certain IP address. It is also used as a mechanism to prevent duplicate IP addresses.

For example, suppose computer A wants to send a packet to computer B, which has an IP address of "10.20.30.40". However, since Ethernet operating under IP uses the MAC address to identify the communication partner, it is necessary to find out what the MAC address corresponding to "10.20.30.40" is. Computer A then broadcasts an ARP message that means "What is the MAC address of the computer assigned the IP address 10.20.30.40?".

Since broadcast is a "broadcast" type of communication that does not identify the other party, this ARP message reaches all computers in the subnet. If computer B is in the same subnet, computer B's will be sent back with an ARP message that means "The MAC address corresponding to the IP address 10.20.30.40 is 00: 11: 22: 33: 44: 55". The MAC address is known. This exchange allows Computer A to send packets to Computer B over IP.

In principle, duplicate IP addresses are automatically detected.

The OS uses this ARP to detect duplicate IP addresses. For example, suppose computer C is assigned the IP address "90.80.70.60". When the computer is started and the communication function of the OS is initialized, the OS sends an ARP message meaning "What is the MAC address of the computer to which the IP address 90.80.70.60 is assigned?". This ARP message differs from the ARP message sent by Computer A earlier in that the underlying IP address is itself. Moreover, since 90.80.70.60 is your IP address, you should know that the MAC address of your own LAN card is compatible.

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 itself. In other words, it sends an ARP message about the IP address assigned to itself, and if there is a reply, that IP address is already in use. If there are devices 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 is assigned (Screen 1).

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