Network Administration: IP Addresses
An IP address is a number that uniquely identifies every host on an IP network. IP addresses operate at the Network layer of the TCP/IP protocol stack, so they are independent of lower-level Data Link layer MAC addresses, such as Ethernet MAC addresses.
IP addresses are 32-bit binary numbers, which means that theoretically, a maximum of something in the neighborhood of 4 billion unique host addresses can exist throughout the Internet. You’d think that would be enough, but TCP/IP places certain restrictions on how IP addresses are allocated.
These restrictions severely limit the total number of usable IP addresses. However, new techniques for working with IP addresses have helped to alleviate this problem, and a standard for 128-bit IP addresses has been adopted, though it still is not yet in widespread use.
Networks and hosts
IP stands for Internet protocol, and its primary purpose is to enable communications between networks. As a result, a 32-bit IP address actually consists of two parts:
The network ID (or network address): Identifies the network on which a host computer can be found
The host ID (or host address): Identifies a specific device on the network indicated by the network ID
Most of the complexity of working with IP addresses has to do with figuring out which part of the complete 32-bit IP address is the network ID and which part is the host ID, as described in the following sections.
You may notice that two host addresses seem to be unaccounted for. For example, the Class C addressing scheme, which uses eight bits for the host ID, allows only 254 hosts — not the 256 hosts you’d expect. That’s because host 0 (the host ID is all zeros) is always reserved to represent the network itself. The host ID can’t be 255 (the host ID is all ones) because that host ID is reserved for use as a broadcast request that’s intended for all hosts on the network.
The dotted-decimal dance
IP addresses are usually represented in a format known as dotted-decimal notation. In dotted-decimal notation, each group of eight bits — an octet — is represented by its decimal equivalent. For example, consider the following binary IP address:
To convert this value to dotted-decimal notation, first divide it into four octets, as follows:
11000000 10101000 10001000 00011100
Then, convert each of the octets to its decimal equivalent:
11000000 10101000 10001000 00011100 192 168 136 28
Then, use periods to separate the four decimal numbers, like this:
This is the format in which you’ll usually see IP addresses represented.
The following illustration shows how the 32 bits of an IP address are broken down into four octets of eight bits each. As you can see, the four octets of an IP address are often referred to as w, x, y, and z.