An IP address is a 32-bit binary address. This 32-bit address is subdivided into four 8-bit segments called octets. Humans do not work well with 32-bit binary addresses or even 8-bit binary octets, so the IP address is almost always expressed in what is called dotted decimal format. In dotted decimal format, each octet is given as an equivalent decimal number. The four decimal values (4 x 8 = 32 bits) are then separated with periods. Eight binary bits can represent any whole number from 0 to 255, so the segments of a dotted decimal address are decimal numbers from 0 to 255. You have probably seen examples of dotted decimal IP addresses on your computer, in this book, or in other TCP/IP documents. A dotted decimal IP address looks like this: 209.121.131.14.
Part of the IP address is used for the network ID, and part of the address is used for the host ID. One complication is that the portion of the address allotted to the network ID varies, depending on the address. Most IP addresses fall into the following address classes:
-
Class A addresses— The first 8 bits of the IP address are used for the network ID. The final 24 bits are used for the host ID.
-
Class B addresses— The first 16 bits of the IP address are used for the network ID. The final 16 bits are used for the host ID.
-
Class C addresses— The first 24 bits of the IP address are used for the network ID. The final 8 bits are used for the host ID.
More bits lead to more bit combinations. As you might guess, the Class A format provides a small number of possible network IDs and a huge number of possible host IDs for each network. A Class A network can support approximately 224, or 16,777,216 hosts. A Class C network, on the other hand, can provide host IDs for only a small number of hosts (approximately 28, or 256), but many more combinations of network IDs are available in the Class C format.
You might be wondering how a computer or router knows whether to interpret an IP address as a Class A, Class B, or Class C address. The designers of TCP/IP wrote the address rules such that the class of an address is obvious from the address itself. The first few bits of the binary address specify whether the address should be interpreted as a Class A, Class B, or Class C address (see Table 4.1). The rules for interpreting addresses are as follows:
-
If the 32-bit binary address starts with a 0 bit, the address is a Class A address.
-
If the 32-bit binary address starts with the bits 10, the address is a Class B address.
-
If the 32-bit binary address starts with the bits 110, the address is a Class C address.
This scheme (thankfully) is easy to convert to dotted decimal notation because these rules have the effect of limiting the range of values for the first term in the dotted decimal address. For instance, because a Class A address must have a 0 bit in the leftmost place of the first octet, the first term in a Class A dotted decimal address cannot be higher than 127. You'll learn more about converting binary numbers to decimal later in this hour. For purposes of this discussion, Table 4.1 shows the address ranges for Class A, B, and C networks. Note that some address ranges are listed as excluded addresses. Certain IP address ranges are not assigned to networks because they are reserved for special uses. You'll learn more about special IP addresses later in this hour.
Table 4.1. Address Ranges for Class A, B, and C Networks
A | 0 | 0 to 127 | 10.0.0.0 to 10.255.255.255 127.0.0.0 to 127.255.255.255 |
B | 10 | 128 to 191 | 172.16.0.0 to 172.31.255.255 |
C | 110 | 192 to 223 | 192.168.0.0 to 192.168.255.255 |