Subnetting plays an important part in IPv4 addressing. The subnet mask helps determine the network, subnetwork, and host part of an IP address. A network architect uses subnetting to manipulate the default mask to create subnetworks for LAN and WAN segments. These subnetworks provide enough addresses for LANs of different sizes. Point-to-point WAN links usually get a subnet mask that allows for only two hosts because only two routers are present in the point-to-point WAN link. You should become familiar with determining subnetwork numbers, broadcast addresses, and host address ranges, given an IP address and mask.
Subnet masks are used for Class A, B, and C addresses only. Multicast addresses do not use subnet masks. A subnet mask is a 32-bit number in which bits are set to 1 to identify the network portion of the address, and a 0 is the host part of the address. The mask’s bits set to 1 are contiguous on the left portion of the mask; the bits set to 0 are contiguous on the right portion of the mask. Table 1-14 shows the default masks for Class A, B, and C addresses. This section addresses various ways to represent IP subnet masks. Understanding these ways is significant because the representation of a network and its mask can appear differently in Cisco documentation or on the command-line interface.
Table 1-14 IPv4 Default Network Address Masks
Class | Binary Mask | Dotted-Decimal Mask |
A | 11111111 00000000 00000000 00000000 | 255.0.0.0 |
B | 11111111 11111111 00000000 00000000 | 255.255.0.0 |
C | 11111111 11111111 11111111 00000000 | 255.255.255.0 |
Mask Nomenclature
There are several ways to represent IP subnet masks. A mask can be binary, hexadecimal, dotted decimal, or a prefix “bit mask.” Historically, the most common representation was the dotted-decimal format (255.255.255.0). The prefix bit mask format is now more popular. This format represents the mask by using a slash followed by the number of leading address bits that must be set to 1 for the mask. It is also referred to as classless interdomain routing (CIDR) prefix notation. For example, 255.255.0.0 is represented as /16. Table 1-15 shows most of the mask representations. The /24 mask is common on LAN segments. The /30 mask is common for WAN point-to-point links, and /32 is used for router loopback addresses.
Table 1-15 Subnet Masks
Dotted Decimal | Bit Mask | Hexadecimal |
255.0.0.0 | /8 | FF000000 |
255.192.0.0 | /10 | FFC00000 |
255.255.0.0 | /16 | FFFF0000 |
255.255.224.0 | /19 | FFFFE000 |
255.255.240.0 | /20 | FFFFF000 |
255.255.255.0 | /24 | FFFFFF00 |
255.255.255.128 | /25 | FFFFFF80 |
255.255.255.192 | /26 | FFFFFFC0 |
255.255.255.224 | /27 | FFFFFFE0 |
255.255.255.240 | /28 | FFFFFFF0 |
255.255.255.248 | /29 | FFFFFFF8 |
255.255.255.252 | /30 | FFFFFFFC |
255.255.255.255 | /32 | FFFFFFF |