Calculate the Number of Hosts (8.3.7)–Cisco The Internet Protocol
The subnet masks seen most often with home and small business networking are 255.0.0.0 (8 bits), 255.255.0.0 (16 bits), and 255.255.255.0 (24 bits). A subnet mask of 255.255.255.0 (decimal) or 11111111.11111111.1111111.00000000 (binary) uses 24 bits to identify the network number, which leaves 8 bits to number the hosts on that network, as shown in Figure 8-6.
Figure 8-6 Calculating the Number of Hosts
To calculate the number of hosts that can be on that network, take the number 2 to the power of the number of host bits (28 = 256). From this number, you must subtract 2 (256–2). The reason you subtract 2 is that all ones within the host portion of an IPv4 address indicate a broadcast address for that network and cannot be assigned to a specific host. All zeros within the host portion indicate the network ID and, again, cannot be assigned to a specific host. Powers of 2 can be calculated easily with the calculator that comes with any Windows operating system.
Another way to determine the number of hosts available is to add up the values of the available host bits (128+64+32+16+8+4+2+1 = 255). From this number, subtract 1 (255–1 = 254), because the host bits cannot be all ones. It is not necessary to subtract 2 because the value of all zeros is 0 and is not included in the addition.
With a 16-bit mask, there are 16 bits (two octets) for host addresses, and a host address could have all ones (255) in one of the octets. This might appear to be a broadcast, but as long as the other octet is not all ones, it is a valid host address. Remember that the host looks at all host bits together, not at octet values.
Video—Network, Host, and Broadcast Addresses (8.3.8)
Refer to the online course to view this video.
Classful IPv4 Addressing (8.4)
Classful addressing is a legacy method of how IPv4 addresses were automatically assigned subnet masks based on the first several bits of the address. Although classful addressing has been made obsolete by classless addressing, it is important to understand the differences.
Classful and Classless Addressing (8.4.1)
In 1981, Internet IPv4 addresses were assigned using classful addressing. Customers were allocated a network address based on one of three classes—A, B, or C. The addresses were divided into the following ranges or classes:
- Class A (0.0.0.0/8 to 127.0.0.0/8)—Designed to support extremely large networks with more than 16 million host addresses. It used a fixed /8 prefix (255.0.0.0) with the first octet to indicate the network address and the remaining three octets for host addresses.
- Class B (128.0.0.0 /16 to 191.255.0.0 /16)—Designed to support the needs of moderate to large size networks with up to approximately 65,000 host addresses. It used a fixed /16 prefix (255.255.0.0) with the two high-order octets to indicate the network address and the remaining two octets for host addresses.
- Class C (192.0.0.0 /24 to 223.255.255.0 /24)—Designed to support small networks with a maximum of 254 hosts. It used a fixed /24 prefix (255.255.255.0) with the first three octets to indicate the network and the remaining octet for the host addresses.
A Class D multicast block consists of 224.0.0.0 to 239.0.0.0, and a Class E experimental address block consists of 240.0.0.0 to 255.0.0.0.
As shown in Figure 8-7, the classful system allocated 50 percent of the available IPv4 addresses to 128 Class A networks, 25 percent of the addresses to Class B, and then Class C shared the remaining 25 percent with Classes D and E. Although appropriate at the time, as the Internet grew, it became obvious that this method was wasting addresses and depleting the number of available IPv4 network addresses.
Figure 8-7 Classful Addressing
Classful addressing was abandoned in the late 1990s for the newer and current classless addressing system. The formal name is classless interdomain routing (CIDR, pronounced “cider”). With classless addressing, customers receive an IPv4 network address and any size subnet mask, appropriate to the number of hosts required. The subnet mask can be any length and is not limited to the three subnet masks used in classful addressing.
Video—Classful IPv4 Addressing (8.4.2)
Refer to the online course to view this video.