Training / Certifications / CompTIA Network+ / Subnetting with CIDR and VLSM

CompTIA Network+ (N10-009) · Lesson 13

Subnetting with CIDR and VLSM

Convert between subnet masks and CIDR prefixes, work out a subnet's block size, network, broadcast and usable hosts, and plan different-sized subnets with VLSM.

Domain 1.0: Networking Concepts (23%)Objective 1.7About 5:14CaptionsStatic view for reduced motion
Lesson 13: Subnetting with CIDR and VLSM Illustrative example: addresses are samples Subnet mask and CIDR prefix192.168.10.77 /24Address11000000.10101000.00001010.01001101Mask11111111.11111111.11111111.0000000024 ones = network8 hostMask in dotted decimal: 255.255.255.0CIDR notation just counts the ones: /24Ones always come first, then zerosNetwork: 192.168.10.0 Host: .77A longer prefix = a smaller networkThe /24 to /30 cheat sheetPrefixMaskAddressesUsable hosts/24255.255.255.0256254/25255.255.255.128128126/26255.255.255.1926462/27255.255.255.2243230/28255.255.255.2401614/29255.255.255.24886/30255.255.255.25242Each extra network bit halves the blockBlock size = 256 − last mask octet(256 − 192 = 64)Network, broadcast and hostsOne /26 block: 64 addresses.0.63.1 … .62NetworkBroadcast62 hostsUsable hosts = 2^(host bits) − 2/26 leaves 6 host bits: 2^6 − 2 = 62/31 (RFC 3021)2 addresses, both usablepoint-to-point links/32exactly one hoste.g. a loopback or routeBorrowing bits to make subnets192.168.10.0/24: 256 addressesBorrow 2 host bits → 2² = 4 subnets.0/26.1–.62.64/26.65–.126.128/26.129–.190.192/26.193–.254Each subnet: 6 host bits → 62 usable hostsSubnets = 2^(borrowed bits)Hosts = 2^(remaining host bits) − 2More subnets always means fewer hosts in eachWhich subnet is a host in?Host 192.168.10.77/261Block size: 256 − 192 = 642Count in 64s: 0, 64, 128, 192377 falls in the 64 block064128192256.77Network.64First host.65Last host.126Broadcast.127Why one mask size wastes addressesFixed /26 everywhere: 62 hosts per subnetOfficeneeds 100/26 gives 62doesn't fitWarehouseneeds 50/26 gives 6212 spareWAN linkneeds 2/26 gives 6260 wastedOne size never fits every subnetVLSM: right-size every subnet192.168.10.0/24, largest subnet first/25/26/27/28/30SubnetNeedsPrefixRangeOffice100/25.0–.127Warehouse50/26.128–.191Guest Wi-Fi20/27.192–.223Servers10/28.224–.239WAN link2/30.240–.243.244–.255 left free for laterCIDR aggregation: summarize routesBranch routes3rd octet in binary10.1.0.0/24000000 0010.1.1.0/24000000 0110.1.2.0/24000000 1010.1.3.0/24000000 1116 + 6 matching bits = /2210.1.0.0/22One routeinstead of fourSupernetting / route summarizationMasks and CIDR32-bit mask: ones, then zerosOnes mark the network partZeros mark the host part/24 = 255.255.255.0CIDR = Classless Inter-Domain RoutingExam clue/24 means 24 ones:255.255.255.0Know these valuesMask octets: 128, 192, 224,240, 248, 252, 255/25 halves a /24/30: 4 addresses, 2 hostsBlock = 256 − mask octetExam clue255.255.255.240 =/28, 14 hostsReserved addressesFirst address: network IDLast address: broadcastHosts = 2^h − 2/30 is the classic choicefor router links/31 also works thereExam clueHosts needed? Find thesmallest block that fitsSubnettingBorrow host bits forthe network part1 bit: 2 subnets2 bits: 4 subnets3 bits: 8 subnetsEach bit halves the hostsExam clueNeed 6 subnets?Borrow 3 bits (8)The 3-step methodFind the block sizeList the multiplesPick the block the hostfalls intoBroadcast = next block − 1Hosts sit in betweenExam clueSame subnet? Check ifboth fall in one blockThe problemFixed-length subnets useone mask for allBig LANs may not fitSmall links waste mostof their blockAddress space runs outExam clueWasted addresses onrouter links = use VLSMVLSMVariable Length Subnet MaskDifferent prefix per subnetSize each one to its needsAllocate largest firstso blocks stay alignedNeeds classless routingExam clueSubnets of differentsizes = VLSMCIDR aggregationClassless: any prefix length(no classes A, B, C)Adjacent blocks combineinto one shorter prefixSmaller routing tablesCalled a supernet or summaryExam clueFour /24s in a row =one /22Masks and CIDRWhat /24 means andhow to read a maskas a prefix lengthSubnettingBlock sizes, usablehosts, and whichsubnet a host is inVLSMDifferent-sized subnetsin one network, plusroute summarizationObjective 1.7: given a scenario, use appropriate IPv4 network addressingBuilds on lesson 12: IPv4 addresses and classesIf the question says……think“255.255.255.224 in CIDR notation”/27“Usable hosts in a /28”14 (16 − 2)“At least 50 hosts, least waste”/26 (62 hosts)“Point-to-point link between routers”/30 (or /31)“Network address of 10.0.0.77/26”10.0.0.64“Subnets of different sizes”VLSM“Combine routes into one”CIDR summaryMasks and CIDROnes = network/24 = 255.255.255.0Block = 256 − octetHosts = 2^h − 2SubnettingBorrow bits: 2^n subnetsCount in block sizesNetwork = block startBroadcast = block endVLSM and CIDRSize each subnetto its needsLargest firstSummarize adjacent blocksFind the block size first; everything else follows from it.

Tip: turn your phone sideways or use full screen for larger labels.

Captions match the narration word for word. Press Space to play or pause and the arrow keys to change scenes.

Learning objective

Convert between subnet masks and CIDR prefixes, work out a subnet's block size, network, broadcast and usable hosts, and plan different-sized subnets with VLSM.

Exam mapping

Domain 1.0: Networking Concepts (23%). Objective 1.7 in the official N10-009 exam objectives.

Key takeaways

  • A subnet mask's ones (always first) mark the network part; CIDR notation counts them, so 255.255.255.0 = /24 and 255.255.255.192 = /26.
  • Block size = 256 minus the last non-255 mask octet; each extra prefix bit halves the block (/25 128, /26 64, /27 32, /28 16, /29 8, /30 4).
  • Usable hosts = 2^(host bits) − 2, because the first address is the network ID and the last is the broadcast. /31 (RFC 3021) is the point-to-point exception; /32 is a single host.
  • Borrowing n host bits creates 2^n subnets. To place a host, count in block sizes: the network is the block start, the broadcast is the next block minus one.
  • VLSM gives each subnet its own prefix length sized to its needs; allocate the largest subnets first so blocks stay aligned and never overlap.
  • CIDR is classless: prefixes of any length replace classes A/B/C, and adjacent blocks can be summarized into one route (four /24s = one /22).

Exam tips

How the exam asks about this

Questions describe a situation and expect you to recognize the concept behind it.

If the question mentions…Think
255.255.255.224/27: 32 addresses, 30 hosts
Usable hosts in a /2814
Smallest subnet for 50 hosts/26 (255.255.255.192, 62 hosts)
Subnet for a point-to-point link between two routers/30 (or /31 per RFC 3021)
Different subnet sizes inside one address blockVLSM
One route advertised for several contiguous networksCIDR summarization (supernet)

Common traps

  • Don't forget the minus two: a /27 has 32 addresses but only 30 usable hosts.
  • The broadcast address is the last address of the block (next block start minus one), not .255, unless the block really ends there.
  • Two hosts are in the same subnet only if they fall in the same block: 192.168.10.60/26 and 192.168.10.70/26 are in different subnets.
  • With VLSM, assign the largest subnets first; starting small can leave a large subnet with no aligned block to fit in.

Practice

Exam-style questions

Answer each one before you open the explanation.

Question 1. A host is configured as 172.16.5.100/27. What is the network address of its subnet?

  1. 172.16.5.64
  2. 172.16.5.96
  3. 172.16.5.100
  4. 172.16.5.127
Show answer

B. 172.16.5.96. A /27 has a block size of 32 (256 − 224), so subnets start at .0, .32, .64, .96 and .128. 100 falls in the block that starts at .96. 172.16.5.64 is the previous block, .100 is the host itself, and .127 is the broadcast address of the .96 subnet.

Question 2. A new warehouse VLAN must support at least 50 hosts while wasting as few addresses as possible. Which subnet mask should the administrator use?

  1. 255.255.255.224
  2. 255.255.255.240
  3. 255.255.255.192
  4. 255.255.255.128
Show answer

C. 255.255.255.192. 255.255.255.192 is a /26: 64 addresses, 62 usable hosts, the smallest block that holds 50. A /27 (.224) has only 30 hosts and a /28 (.240) 14, so they're too small; a /25 (.128) works but wastes more than half its 126 hosts.

Question 3. An administrator divides 192.168.1.0/24 into subnets for departments of very different sizes. Which TWO statements about this design are correct? (Select TWO.)

  1. It is an example of VLSM, with a different prefix length per subnet
  2. Every subnet must use the same subnet mask
  3. Allocating the largest subnets first keeps blocks aligned and avoids overlaps
  4. It only works with classful routing
  5. Each subnet loses its broadcast address, so all addresses are usable
Show answer

A. It is an example of VLSM, with a different prefix length per subnet and C. Allocating the largest subnets first keeps blocks aligned and avoids overlaps. Different-sized subnets from one block is VLSM, and assigning the largest subnets first keeps each block on a boundary of its own size so none overlap. Requiring one mask is fixed-length subnetting, VLSM needs classless routing, and every normal subnet still reserves its network and broadcast addresses.

Question 4. How many usable host addresses does a /28 subnet provide?

  1. 16
  2. 30
  3. 12
  4. 14
Show answer

D. 14. A /28 leaves 4 host bits: 2^4 = 16 addresses, minus the network and broadcast addresses, gives 14. 16 forgets the minus two, and 30 is a /27.

Question 5. A router learns 10.1.0.0/24, 10.1.1.0/24, 10.1.2.0/24 and 10.1.3.0/24. Which single route most precisely summarizes all four?

  1. 10.1.0.0/22
  2. 10.1.0.0/23
  3. 10.1.0.0/24
  4. 10.1.0.0/21
Show answer

A. 10.1.0.0/22. Four contiguous /24 blocks starting on a multiple of four share their first 22 bits, so 10.1.0.0/22 covers exactly 10.1.0.0 to 10.1.3.255. A /23 covers only two of them, a /24 only one, and a /21 also covers 10.1.4.0 to 10.1.7.255, which this router didn't learn.

Transcript

Lesson transcript

The full narration, scene by scene. The captions file contains the same text with timings.

Scene 1 · 0:00

Lesson 13: Subnetting with CIDR and VLSM. Welcome to lesson thirteen, the second half of objective 1.7. This is the lesson where IPv4 turns into arithmetic, but only a little. We'll cover three ideas. Subnet masks and the CIDR prefix, like /24. Subnetting itself: block sizes, usable hosts, and finding which subnet a host belongs to. And VLSM, which lets one network hold subnets of different sizes, plus how CIDR summarizes routes.

Scene 2 · 0:28

Subnet mask and CIDR prefix. A subnet mask is another 32-bit number. Its ones mark the network part of an address and its zeros mark the host part, and the ones always come first. Our online store's office uses 192.168.10.0 with the mask 255.255.255.0: twenty-four ones, then eight zeros. CIDR notation, short for Classless Inter-Domain Routing, simply counts the ones, so the same network is written 192.168.10.0/24.

Scene 3 · 0:56

The /24 to /30 cheat sheet. Most exam questions live in the last octet, so learn this table. Every extra network bit halves the block: a /25 holds 128 addresses, a /26 holds 64, a /27 32, down to a /30 with just 4. The mask octets follow the same pattern: 128, 192, 224, 240, 248, 252. And here's the shortcut: the block size is 256 minus the last mask octet. 256 minus 192 gives 64.

Scene 4 · 1:26

Network, broadcast and hosts. Not every address in a block goes to a device. The first address is the network ID and the last is the broadcast address, so usable hosts are two to the power of the host bits, minus two. A /26 has six host bits: 64 addresses, 62 hosts. Two exceptions: RFC 3021 lets a /31 use both of its addresses on a point-to-point link, and a /32 is exactly one host.

Scene 5 · 1:57

Borrowing bits to make subnets. Subnetting means borrowing host bits and giving them to the network part. Say the store wants four separate subnets out of 192.168.10.0/24. Borrowing two bits gives two squared, four subnets, each a /26. They start at .0, .64, .128 and .192, and each keeps six host bits, so 62 hosts. The rule: subnets are two to the borrowed bits, and every extra bit halves the hosts.

Scene 6 · 2:26

Which subnet is a host in?. Now the classic question: which subnet is 192.168.10.77/26 in? Step one, the block size: 256 minus 192 is 64. Step two, count in sixty-fours: 0, 64, 128, 192. Step three, 77 falls in the block that starts at 64. So the network is .64, the broadcast is one less than the next block, .127, and usable hosts run from .65 to .126.

Scene 7 · 2:53

Why one mask size wastes addresses. Fixed-size subnets have a problem. The store's office has 100 devices, the warehouse 50, and the link to its internet router needs just 2. With a /26 everywhere, the office doesn't fit at all, and the router link wastes 60 of its 62 hosts. Real networks have subnets of very different sizes, so a single mask either runs short or throws addresses away.

Scene 8 · 3:21

VLSM: right-size every subnet. Variable Length Subnet Masking, or VLSM, fixes this by giving each subnet its own prefix. Start with the largest need. The office's 100 hosts get a /25, .0 to .127. The warehouse gets a /26 from .128, guest Wi-Fi a /27 from .192, the servers a /28 from .224, and the router link a /30 from .240. Everything fits in one /24, with room left for later.

Scene 9 · 3:50

CIDR aggregation: summarize routes. CIDR works in the other direction too. Classless means a prefix can be any length, not just /8, /16 or /24. So adjacent blocks can be combined. The store's four branch networks, 10.1.0.0 through 10.1.3.0, all /24, share their first 22 bits. One summary route, 10.1.0.0/22, covers all four. This is called supernetting or route summarization, and it keeps routing tables small.

Scene 10 · 4:17

How the exam asks about this. On the exam, convert quickly. 255.255.255.224 is a /27. A /28 has 14 usable hosts. For at least 50 hosts with the least waste, pick a /26. A point-to-point router link calls for a /30, or a /31. To find a network address, count in block sizes. Subnets of different sizes in one network mean VLSM, and combining routes into one is a CIDR summary.

Scene 11 · 4:45

Recap: subnetting. To recap: the mask's ones mark the network, and CIDR counts them. The block size is 256 minus the last mask octet, and usable hosts are two to the host bits, minus two. Borrowing bits makes more, smaller subnets. Count in block sizes to find a host's network and broadcast. VLSM sizes each subnet to its needs, and CIDR summarizes routes. Next: SDN, SD-WAN and VXLAN.

Download captions (WebVTT)

Sources and accuracy

Checked against the official CompTIA N10-009 exam objectives and the standards below on October 24, 2026. Diagrams and addresses in the animation are illustrative.

This free course is independent and isn't affiliated with or endorsed by CompTIA. CompTIA and Network+ are trademarks of CompTIA, Inc.

Preparing a team for Network+?

I run hands-on networking and cloud training for teams, built around your own environment and goals.