Subnetting – FLSM, VLSM, CIDR, Binary Method & Route Summarisation
1. What Is Subnetting and Why Does It Matter?
Subnetting is the process of dividing a single IP network into smaller logical subnetworks (subnets). Without subnetting, every device in the same network address space would be in the same broadcast domain — a single broadcast from one device reaches every other device, wasting bandwidth and creating security exposure.
| Benefit | How Subnetting Provides It |
|---|---|
| Reduced broadcast traffic | Each subnet is its own broadcast domain. Broadcasts stay within the subnet and do not cross routers to other subnets |
| Efficient IP address use | VLSM lets you allocate only as many addresses as a segment needs instead of wasting a full /24 on a 2-host WAN link |
| Security isolation | Routers between subnets can apply ACLs, VLANs, and firewall policies to control inter-subnet traffic |
| Simpler troubleshooting | Smaller, isolated subnets contain problems; a broadcast storm in one subnet does not affect others |
| Route summarisation | Contiguous subnets can be summarised into a single route entry, reducing routing table size across the network |
Related pages: Private vs Public IP Addresses | Default Routes | Static Routing Configuration | DHCP How It Works | OSPF Overview | OSPF Single-Area Lab (uses subnetting) | DHCP Server Configuration Lab
2. IPv4 Address Structure — Binary Breakdown
An IPv4 address is 32 bits long, written as four 8-bit octets in dotted decimal. The subnet mask defines where the network portion ends and the host portion begins.
Octet Bit Values — Reference
3. IP Address Classes and Default Masks
| Class | First Octet Range | Full Range | Default Mask | CIDR | Network / Host Bits |
|---|---|---|---|---|---|
| A | 1 – 126 | 1.0.0.0 – 126.255.255.255 | 255.0.0.0 | /8 | 8 network / 24 host = 16,777,214 hosts |
| B | 128 – 191 | 128.0.0.0 – 191.255.255.255 | 255.255.0.0 | /16 | 16 network / 16 host = 65,534 hosts |
| C | 192 – 223 | 192.0.0.0 – 223.255.255.255 | 255.255.255.0 | /24 | 24 network / 8 host = 254 hosts |
| D | 224 – 239 | 224.0.0.0 – 239.255.255.255 | N/A (Multicast) | N/A | Reserved for multicast groups (OSPF, PIM, etc.) |
| E | 240 – 255 | 240.0.0.0 – 255.255.255.255 | N/A (Experimental) | N/A | Reserved — not used in production networks |
4. The Core Subnetting Formulas
5. The Complete Subnet Reference Table (/24 to /30)
Memorising this table is essential for CCNA exam speed — many questions require converting between prefix length, subnet mask, host count, and block size in seconds.
| CIDR | Subnet Mask | Host Bits | Total Addresses | Usable Hosts | Block Size | Subnets from /24 |
|---|---|---|---|---|---|---|
| /24 | 255.255.255.0 | 8 | 256 | 254 | 256 | 1 |
| /25 | 255.255.255.128 | 7 | 128 | 126 | 128 | 2 |
| /26 | 255.255.255.192 | 6 | 64 | 62 | 64 | 4 |
| /27 | 255.255.255.224 | 5 | 32 | 30 | 32 | 8 |
| /28 | 255.255.255.240 | 4 | 16 | 14 | 16 | 16 |
| /29 | 255.255.255.248 | 3 | 8 | 6 | 8 | 32 |
| /30 | 255.255.255.252 | 2 | 4 | 2 | 4 | 64 |
| /31 | 255.255.255.254 | 1 | 2 | 0 (2 with RFC 3021) | 2 | 128 |
| /32 | 255.255.255.255 | 0 | 1 | 0 (host route) | 1 | 256 |
6. Fixed-Length Subnet Masking (FLSM)
FLSM uses the same subnet mask for every subnet in the design. All subnets are equal in size. This is simpler to calculate but wastes IP addresses when subnets have very different host requirements.
FLSM Step-by-Step Method
| Subnet | Network Address | First Usable Host | Last Usable Host | Broadcast | Usable Hosts |
|---|---|---|---|---|---|
| 1 | 192.168.10.0/26 | 192.168.10.1 | 192.168.10.62 | 192.168.10.63 | 62 |
| 2 | 192.168.10.64/26 | 192.168.10.65 | 192.168.10.126 | 192.168.10.127 | 62 |
| 3 | 192.168.10.128/26 | 192.168.10.129 | 192.168.10.190 | 192.168.10.191 | 62 |
| 4 | 192.168.10.192/26 | 192.168.10.193 | 192.168.10.254 | 192.168.10.255 | 62 |
7. Variable-Length Subnet Masking (VLSM)
VLSM allows different subnet masks within the same network, fitting the subnet size to the actual number of hosts needed. It requires classless routing protocols (OSPF, EIGRP, RIPv2, BGP) that carry subnet mask information in their updates.
VLSM Golden Rule
VLSM Worked Example — Full Solution
| Subnet | Hosts Needed | CIDR | Subnet Mask | Network Address | Usable Range | Broadcast | Usable Hosts |
|---|---|---|---|---|---|---|---|
| A | 100 | /25 | 255.255.255.128 | 192.168.20.0 | .1 – .126 | .127 | 126 |
| B | 50 | /26 | 255.255.255.192 | 192.168.20.128 | .129 – .190 | .191 | 62 |
| C | 10 | /28 | 255.255.255.240 | 192.168.20.192 | .193 – .206 | .207 | 14 |
| D (WAN) | 2 | /30 | 255.255.255.252 | 192.168.20.208 | .209 – .210 | .211 | 2 |
8. FLSM vs VLSM — Comparison
| Feature | FLSM | VLSM |
|---|---|---|
| Subnet sizes | All equal (same prefix length) | Variable (different prefix lengths) |
| IP efficiency | Wasteful — small subnets get same size as large ones | Efficient — each subnet sized to actual needs |
| Calculation complexity | Simple — one calculation applied to all | More complex — separate calculation per subnet |
| Protocol requirement | Works with classful (RIPv1) and classless protocols | Requires classless protocols (OSPF, EIGRP, RIPv2, BGP) that carry subnet mask in updates |
| Routing table | Fewer entries (all same size, may summarise easily) | More entries (variable sizes, more complex summarisation) |
| Use case | Simple, uniform networks with similar-sized segments | Modern enterprise networks with mixed segment sizes (LAN, WAN links, DMZ, management) |
9. CIDR Notation and Classless Addressing
CIDR (Classless Inter-Domain Routing) was introduced in 1993 to replace the rigid class-based system. Instead of fixed /8, /16, /24 boundaries, CIDR allows any prefix length from /0 to /32.
10. Supernetting and Route Summarisation
Supernetting (also called route summarisation or route aggregation) is the opposite of subnetting — it combines multiple contiguous smaller networks into a single, larger summary route. This reduces the number of routing table entries, speeds up routing lookups, and hides topology changes.
Practical Summarisation on Cisco IOS
! OSPF manual summarisation at an ABR (Area Border Router): Router(config-router)# area 1 range 192.168.0.0 255.255.252.0 ! Summarises 192.168.0.0/24 through 192.168.3.0/24 as 192.168.0.0/22 ! EIGRP manual summarisation on an interface: Router(config-if)# ip summary-address eigrp 1 192.168.0.0 255.255.252.0 ! Static summary route pointing to Null0 (leak prevention): Router(config)# ip route 192.168.0.0 255.255.252.0 Null0
11. Private IP Address Ranges
RFC 1918 reserves three address ranges as private — they are not routed on the public internet and can be reused freely within any organisation. NAT (Network Address Translation) converts private addresses to a public IP for internet access.
| Class | Private Range | CIDR | Number of Addresses | Common Use |
|---|---|---|---|---|
| A | 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | Large enterprises, data centres, cloud VPCs |
| B | 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | Medium enterprises, service provider customer networks |
| C | 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | 65,536 | Small offices, home networks, lab environments |
See Private vs Public IP Addresses for NAT configuration and internet routing details.
12. Finding the Network, Host Range, and Broadcast — Rapid Method
The fastest exam technique for determining the subnet details of a given IP address and mask does not require binary conversion for the common /24-to-/30 range.
13. Exercises — Fully Solved
Exercise 1: FLSM — Subnet 192.168.10.0/24 into 4 equal subnets
| Subnet | Network Address | Usable IP Range | Broadcast | Subnet Mask |
|---|---|---|---|---|
| 1 | 192.168.10.0/26 | .1 – .62 | .63 | 255.255.255.192 |
| 2 | 192.168.10.64/26 | .65 – .126 | .127 | 255.255.255.192 |
| 3 | 192.168.10.128/26 | .129 – .190 | .191 | 255.255.255.192 |
| 4 | 192.168.10.192/26 | .193 – .254 | .255 | 255.255.255.192 |
Exercise 2: VLSM — Subnet 172.16.20.0/24 for given requirements
| Subnet | Hosts Needed | Network Address | CIDR | Mask | Usable Range | Broadcast |
|---|---|---|---|---|---|---|
| A | 50 | 172.16.20.0 | /26 | 255.255.255.192 | .1 – .62 | .63 |
| B | 30 | 172.16.20.64 | /26 | 255.255.255.192 | .65 – .126 | .127 |
| C | 12 | 172.16.20.128 | /28 | 255.255.255.240 | .129 – .142 | .143 |
| D | 6 | 172.16.20.144 | /29 | 255.255.255.248 | .145 – .150 | .151 |
14. Key Points & Exam Tips
- Usable hosts formula: 2^h − 2 where h = host bits (32 − prefix). Always subtract 2 for network address and broadcast address.
- Block size = 256 − last octet of subnet mask. This is the increment between consecutive subnet network addresses.
- Network address = all host bits set to 0. Broadcast address = all host bits set to 1.
- FLSM: all subnets same size; simple; works with classful or classless protocols. VLSM: variable sizes; requires classless protocols (OSPF, EIGRP, RIPv2, BGP).
- VLSM order: always allocate largest subnet first to avoid overlap.
- Memorise the table for /24 through /30: usable hosts are 254, 126, 62, 30, 14, 6, 2 respectively.
- /30 for point-to-point WAN links — 2 usable hosts, no waste. /31 (RFC 3021) is also used on modern Cisco equipment for WAN links.
- Supernetting rule: networks must be contiguous AND start on an aligned power-of-2 boundary. Four /24s can summarise only if the first is a multiple of 4 (e.g., .0, .4, .8, .12... — NOT .1, .2, .3).
- Private ranges (RFC 1918): 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Not routed on the public internet; used with NAT.
- Rapid method: divide host octet by block size; multiply the quotient by block size to get the network address; add block size − 1 to get the broadcast address.
Related pages: Private vs Public IP Addresses | Default Routes | Static Routing Configuration | DHCP How It Works | OSPF Overview | NAT / PAT Overview | OSPF Single-Area Lab (uses subnetting) | DHCP Server Configuration Lab
15. Subnetting (FLSM & VLSM) Quiz
Related Topics & Step-by-Step Tutorials
Continue your IP addressing studies:
- IP Addresses – Concepts, Formats, and Best Practices — IPv4 address structure — network, host, broadcast
- IP Address Classes (A, B, C, D, E) – Concepts, Range… — Class A/B/C/D/E — classful addressing history
- Private vs Public IPv4 Addresses — RFC 1918 private ranges and public addressing
- Subnetting — subnetting fundamentals — CIDR notation
- Subnetting – Concepts, Calculations & Step-by-Step E… — step-by-step subnet calculation
- IPv4 Subnetting — binary breakdown — network, host, broadcast calculation
- Wildcard Masks – Complete Guide for ACLs & Routing P… — wildcard mask logic for ACLs and OSPF
- NAT – Network Address Translation Overview — NAT — translating private to public addresses
- IPv6 – Addressing, Features, Configuration, and Tran… — IPv6 — the successor to IPv4