PracticeBlogFlashcardsEspañol

CIDR, VLSM, and Subnet Math

Key Takeaways

  • CIDR slash notation counts network bits; host bits determine subnet size.
  • Usable IPv4 hosts are usually 2 to the host-bits power minus 2, because network and broadcast addresses are reserved.
  • VLSM assigns different subnet sizes based on need, conserving address space.
  • Block size in the interesting octet helps find network IDs, broadcast addresses, and valid host ranges.
  • Subnetting PBQs reward a repeatable method more than memorizing isolated answers.
Last updated: April 2026

CIDR replaces classful assumptions with explicit prefix lengths. A /24 means 24 network bits and 8 host bits. A /26 means 26 network bits and 6 host bits.

PrefixMaskAddresses per subnetUsable hostsBlock size
/24255.255.255.02562541 in third octet, 256 in fourth
/25255.255.255.128128126128
/26255.255.255.192646264
/27255.255.255.224323032
/28255.255.255.240161416
/29255.255.255.248868
/30255.255.255.252424

Fast Method

  1. Convert the prefix to a mask.
  2. Find the interesting octet, the octet where the mask is not 255 or 0.
  3. Calculate block size as 256 minus the mask value in that octet.
  4. Count network IDs by that block size.
  5. The broadcast address is one less than the next network ID.
  6. Usable hosts are between network ID and broadcast address.

Example: 192.168.10.77/26.

StepResult
/26 mask255.255.255.192
Interesting octetFourth octet
Block size256 - 192 = 64
Network IDs.0, .64, .128, .192
77 falls in.64 subnet
Network ID192.168.10.64
Broadcast192.168.10.127
Usable range192.168.10.65-192.168.10.126

VLSM Allocation

Variable length subnet masking uses different subnet sizes in the same address plan. Allocate largest requirements first so smaller subnets can fit into the remaining space.

NeedSmallest common prefixUsable hosts
100 hosts/25126
50 hosts/2662
25 hosts/2730
12 hosts/2814
5 hosts/296
2 hosts/302

Given 192.168.50.0/24 and requirements for 100, 50, 25, and 12 hosts, a clean allocation could be:

RequirementSubnetUsable range
100 hosts192.168.50.0/25.1-.126
50 hosts192.168.50.128/26.129-.190
25 hosts192.168.50.192/27.193-.222
12 hosts192.168.50.224/28.225-.238

PBQ-Style Thinking

Scenario: You must assign subnets to departments with 55, 27, 12, and 2 hosts from one /24. Sort largest to smallest. Choose /26 for 55, /27 for 27, /28 for 12, and /30 for 2. Then place each subnet on valid boundaries without overlap.

Scenario: A host 10.1.5.130/25 cannot reach 10.1.5.20/25 directly. Calculate the subnets: /25 has block size 128, so 10.1.5.130 is in 10.1.5.128/25 and 10.1.5.20 is in 10.1.5.0/25. They are in different subnets and need a router or corrected addressing.

Subnet Trap Table

TrapCorrection
Using classful mask automaticallyUse the provided CIDR prefix
Assigning the network ID to a hostFirst address is reserved for subnet ID
Assigning the broadcast address to a hostLast address is reserved for broadcast
Forgetting to sort VLSM by sizeAllocate largest subnet first
Overlapping VLSM rangesUse valid block boundaries
Confusing addresses with usable hostsUsable is usually total minus 2
Test Your Knowledge

What is the network ID for host 192.168.10.77/26?

A
B
C
D
Test Your Knowledge

Which prefix is the smallest common choice that supports 50 usable IPv4 hosts?

A
B
C
D
Test Your KnowledgeMulti-Select

Which steps are part of reliable VLSM planning? Choose two.

Select all that apply

Allocate largest host requirements first
Place subnets on valid block boundaries
Ignore broadcast addresses
Use the same /30 for every department regardless of size