11 Subnetting IPv4 Networks
Subnetting IPv4 networks is introduced as a practical answer to the inefficiencies of classful addressing. The chapter explains how rigid class A/B/C boundaries waste addresses and how Classless Inter-Domain Routing (CIDR) enables flexible prefix lengths, letting engineers carve address blocks into appropriately sized subnets. Subnetting is framed as a core CCNA skill that requires hands-on practice: you subdivide a given block by borrowing bits from the host portion to extend the network portion, thereby creating multiple, smaller networks that better fit real needs.
The mechanics center on binary thinking and a few reliable formulas. Borrowing x bits yields 2^x subnets, while a subnet with y host bits supports 2^y − 2 usable host addresses, and every subnet has five key attributes: network address, broadcast address, first and last usable addresses, and host capacity. The chapter reviews CIDR notation versus subnet masks, shows how /24-and-longer blocks are easiest to visualize (focusing on the last octet), and then applies the same process to /16 and /8 blocks where borrowed bits can span octets. Special cases include /31 for point-to-point links (two usable addresses without network/broadcast) and /32 for single-host routes. Step-by-step methods are provided to find a subnet’s network address from any given IP/prefix and to translate between prefix lengths and masks.
Two subnetting styles are contrasted. Fixed-Length Subnet Masking (FLSM) divides a block into equal-sized parts and is useful for learning and some constrained designs. Variable-Length Subnet Masking (VLSM) is the real-world workhorse: allocate the largest subnet first, then the next largest, and continue in descending order, fitting LANs and WANs efficiently within a single block; for point-to-point links, choose /30 or /31 depending on policy and efficiency. The chapter emphasizes that exact fits are often impossible due to powers-of-two boundaries, so expect spare subnets or extra addresses, and it advises prioritizing binary fluency over shortcut “tricks.” Regular practice is recommended until these calculations become quick and intuitive.
The 192.168.1.0/24 address block (network) divided into smaller subnets. With a /24 prefix length, it is one subnet of 256 addresses. Using a /25 prefix length allows the block to be divided into two subnets of 128 addresses each. /26 allows for 4 subnets of 64 addresses each. /27 allows for 8 subnets of 32 addresses each. /28 allows for 16 subnets of 16 addresses each.
Borrowing one bit from the host portion of 192.168.1.0/24 allows us to create two subnets: 192.168.1.0/25 and 192.168.1.128/25. The borrowed bit was part of the host portion of the original address block, but it is part of the network portion of each subnet (as indicated by the /25 prefix length).
Borrowing two bits from 192.168.1.0/24 allows for four subnets: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, and 192.168.1.192/26.
The five attributes of the 192.168.64.0/26 subnet. The first 26 bits are the network portion, and the final 6 bits are the host portion. The network address is 192.168.1.64 (host portion all 0s). The broadcast address is 192.168.1.127 (host portion all 1s). The first usable address is 192.168.1.65 (network address+1). The last usable address is 192.168.1.126 (broadcast address-1). The maximum number of hosts in the subnet is 62 (26-2).
A point-to-point link connecting R1 to R2. Traditionally, a /30 subnet would be used for a connection like this, as in option 1). In modern networks, a /31 subnet, as in option 2), is also valid (and more efficient).
Borrowing two bits from 192.168.0.0/16 allows for four subnets: 192.168.0.0/18, 192.168.64.0/18, 192.168.128.0/18, and 192.168.192.0/18.
The five attributes of the 192.168.128.0/18 subnet. The first 18 bits are the network portion, and the final 14 bits are the host portion. The network address is 192.168.128.0 (host portion all 0s). The broadcast address is 192.168.191.255 (host portion all 1s). The first usable address is 192.168.128.1 (network address+1). The last usable address is 192.168.191.254 (broadcast address-1). The maximum number of hosts in the subnet is 16,382 (214-2).
Borrowing 12 bits from 10.0.0.0/8 allows for 4096 subnets. 10.0.0.0/20 is the first octet, and 10.255.224.0/20 and 10.255.240.0/20 are the final two.
An FSLM scenario in which you must subnet the 172.25.190.0/23 address block into four subnets of equal size, identify the number of host addresses per subnet, and configure the first usable address of each subnet on R1’s interfaces.
The subnets that can be created by subnetting 172.25.190.0/23 into four equal parts: 172.25.90.0/25, 172.25.190.128/25, 172.25.191.0/25, and 172.25.191.128/25. Borrowing two bits from the host portion of the /23 address block results in four /25 subnets.
Borrowing 11 bits from the host portion of the 10.224.0.0/11 address block allows for 2048 subnets. The first subnet is 10.224.0.0/22 (all borrowed bits set to “0”), and the last (2048th) subnet is 10.255.252.0/22 (all borrowed bits set to “1”).
A VLSM scenario in which you must assign subnets from the 10.89.100.0/24 address block to each LAN and the WAN connection, and identify the five attributes of each subnet.
The 10.89.100.0/24 address block, divided into five subnets of varying sizes. 1) Toronto LAN A is 10.89.100.0/25, containing 128 addresses. 2) Tokyo LAN A is 10.89.100.128/26, containing 64 addresses. 3) Toronto LAN B is 10.89.100.192/27, containing 32 addresses. 4) Tokyo LAN B is 10.89.100.224/28, containing 16 addresses. 5) The WAN connection is 10.89.100.240/30, containing 4 addresses. After subnetting, 12 addresses remain unused: 10.89.100.244 through 10.89.100.255.
Toronto LAN A’s subnet. Borrowing one bit from the 10.89.100.0/24 address block results in the 10.89.100.0/25 subnet, supporting up to 126 host addresses – enough for the 122 hosts in the LAN.
Tokyo LAN A’s subnet. The network address is 10.89.100.128 – the first address after Toronto LAN A. A /26 prefix length is used to allow for up to 62 host addresses – enough for the 59 hosts in the LAN.
Toronto LAN B’s subnet. The network address is 10.89.100.192 – the first address after Tokyo LAN A. A /27 prefix length is used to allow for up to 30 host addresses – exactly the amount needed.
Tokyo LAN B’s subnet. The network address is 10.89.100.224 – the first address after Toronto LAN B. A /28 prefix length is used to allow for up to 14 host addresses – sufficient for the 11 hosts in the LAN.
The WAN connection’s subnet. The network address is 10.89.100.240 – the first address after Tokyo LAN B. A /30 prefix length is used to allow for two host addresses – one for R1, and one for R2.
Summary
- Classless Inter-Domain Routing (CIDR) replaced classful addressing, allowing prefix lengths outside of the traditional /8, /16, and /24.
- With CIDR, an address block can be divided into smaller networks called subnets. This process is called subnetting.
- Fixed-Length Subnet Masking (FLSM) subnetting divides an address block into subnets of equal size.
- Variable-Length Subnet Masking (VLSM) subnetting divides an address block into subnets of varying size.
- To subnet an address block, you “borrow” bits from the host portion of the address block and add them to the network portion. Whereas the network portion of the original address block cannot be changed, the borrowed bits can be changed to make different subnets.
- Each additional borrowed bit doubles the number of subnets that can be made: 1 borrowed bit = 2 subnets, 2 borrowed bits = 4 subnets, 3 borrowed bits = 8 subnets, etc. However, each additional borrowed bit halves the number of addresses in each subnet, because there are fewer bits in the host portion.
- The five attributes of an IPv4 network are calculated in the same manner for subnets: the network address is the first address of a subnet (host portion of all 0s), the broadcast address is the last address of a subnet (host portion all 1s), the first usable address is the first address after the network address, the last usable address is the last address before the broadcast address, and the maximum number of hosts is 2y-2, where y is the number of host bits.
- For point-to-point links (connections between two routers), either a /30 or /31 prefix length can be used. /30 consumes four addresses (network address, broadcast address, and two host addresses), whereas /31 consumes only two addresses (two host addresses, without a network or broadcast address).
- To subnet an address block using VLSM, assign the largest subnet at the start of the address block, assign the second-largest subnet after it, and repeat the process until all subnets have been assigned.
- The network address of the next subnet is the address immediately after the broadcast address of the current subnet.
- In a real-world situation, you should leave some room in each subnet for future growth. When doing subnetting scenarios for practice (or for the CCNA exam), be as efficient as possible (leave as few unused addresses as possible).
FAQ
What is subnetting and why is it necessary?
Subnetting is the process of dividing a larger IPv4 address block into smaller networks (subnets). It was introduced with CIDR to replace rigid classful boundaries (/8, /16, /24), improving address efficiency by letting you choose any prefix length (for example, /23, /26, /28). This reduces waste and supports scalable network design.How do “borrowed bits” create subnets?
To create subnets, you borrow bits from the host portion and add them to the network portion, increasing the prefix length. Each borrowed bit doubles the number of subnets (2^x) and halves the addresses per subnet. Example: 192.168.1.0/24 becomes two /25s, four /26s, eight /27s, etc.What are the five key attributes of a subnet and how do I calculate them?
- Network address: all host bits set to 0 (the first address in the subnet)- Broadcast address: all host bits set to 1 (the last address in the subnet)
- First usable: network address + 1
- Last usable: broadcast address − 1
- Maximum hosts: 2^y − 2 (y = number of host bits)
How do I find the network address for a given IP and prefix length?
Write the IP in binary, set the host portion to all 0s, then convert back to decimal. Example: For 172.16.20.27/28, zeroing the last 4 host bits yields the network 172.16.20.16.What’s the difference between FLSM and VLSM?
- FLSM (Fixed-Length Subnet Masking): Divides an address block into equal-size subnets. Useful for learning and some uniform designs.- VLSM (Variable-Length Subnet Masking): Uses different subnet sizes based on actual needs, maximizing address efficiency. This is what you’ll typically use in real networks.
How do CIDR prefix lengths map to subnet masks for /24 and longer?
The subnet mask marks network bits with 1s and host bits with 0s. Examples:- /24 → 255.255.255.0
- /25 → 255.255.255.128
- /26 → 255.255.255.192
- /27 → 255.255.255.224
- /28 → 255.255.255.240
- /29 → 255.255.255.248
- /30 → 255.255.255.252
- /31 → 255.255.255.254
- /32 → 255.255.255.255
What’s special about /31 and /32?
/31 leaves one host bit, which normally yields 0 usable addresses with the 2^y−2 formula. An exception allows /31 for point-to-point links: both addresses are usable and there’s no network/broadcast. /32 denotes a single host (often used in routes; rarely on interfaces, with some protocol exceptions).Does subnetting change when working with /16 or /8 blocks?
No. The rules are identical: 2^x subnets for x borrowed bits; 2^y−2 hosts for y host bits; network = host bits all 0; broadcast = host bits all 1. The only difference is that conversions and increments may span multiple octets, so take care when calculating boundaries.How do I approach a VLSM design?
List needs largest to smallest, then assign in order from the start of the block:1) Place the largest subnet first, using the smallest prefix that meets its host count.
2) Place the next largest immediately after it.
3) Repeat until all subnets are assigned.
Example from a /24: /25 (large LAN), then /26, /27, /28, and finally a /30 for a point-to-point WAN.
Any exam tips and common pitfalls for subnetting?
- Practice binary; it makes every task easier and avoids “magic number” crutches.- In practice questions that don’t state the block size, assume the classful prefix (/8, /16, or /24) based on the first octet.
- Wildcard masks are not subnetting; they’re used in features like OSPF and ACLs (covered later).
- In production, leave headroom for growth; on exams, pick the most efficient prefix that meets the requirement.
Acing the CCNA Exam, Volume 1 ebook for free