The IPv4 address is the unique identifier that distinguishes a computer from another computer on a network and makes it easier to find that computer on the network. An IP address is required for each computer and network component, such as a router, that communicates using TCP/IP. The IP address identifies the location of a computer on the network, much like a house number identifies a house in a city. Just as the address for a particular house must be unique and follow certain address conventions, an IP address should also be unique and conform to a standard format. An IP address consists of four numbers, each of which can be between 0 and 255.
Just as a postal address consists of two parts (a street with a house number and a postal code), an IP address also has two parts, the host identifier and the network identifier.
The first part of the IP address is the network identifier that identifies the network segment in which the computer is located. The same network identifier is required for all computers in the same segment, just as all houses in a particular county must have the same postal code.
The second part of the IP address is the host identifier, which identifies a computer, router, or other device within a segment. The host identifier must be unique within the network segment, just as the street name for a house within the postcode area must be unique.
It is important to note that two computers with different network identifiers may have the same host identifier, just as two different postcode areas may have the same street. However, the combination of network ID and host ID must be unique for all computers to communicate with each other.