Free tech learning for everyone, from basics to pro

Network FundamentalsNetworking SecurityIntermediate

VLSM, CIDR and route summarisation with worked examples

In short: CIDR lets a network have any prefix length instead of fixed class sizes. VLSM uses that freedom to give each subnet only the addresses it needs, largest first. Route summarisation goes the other way, combining contiguous networks into one shorter prefix so routing tables stay small and stable.

From classes to CIDR

Early IPv4 used fixed classes: a class A network had 16 million addresses, class C only 254. Organisations either wasted huge blocks or needed many small ones. Classless Inter-Domain Routing (CIDR), introduced in 1993, removed the fixed sizes. A network is written as an address plus a prefix length, such as 10.20.0.0/14, and the prefix can be any length. Classes survive today only as vocabulary.

CIDR does two jobs. Inside an organisation it allows VLSM (variable length subnet masks). Between networks it allows aggregation, so an ISP can advertise one large block instead of thousands of small ones.

VLSM: the right size for each subnet

Suppose you have 192.168.10.0/24 for a small site: Sales needs 100 hosts, Staff 50, Guests 20, plus two point-to-point router links. Fixed /26 subnets would give 62 hosts each, which is too small for Sales. VLSM sizes each one separately.

  1. List the requirements from largest to smallest.
  2. For each, pick the smallest block where 2 to the power of the host bits, minus 2, is enough: 100 hosts needs /25 (126), 50 needs /26 (62), 20 needs /27 (30), a link needs /30 (2).
  3. Allocate the largest first, starting at the beginning of the range, so every block starts on its own boundary.
  4. Write down network, first and last usable, and broadcast for each.
VLSM plan for 192.168.10.0/24192.168.10.0/24Sales /25.0 - .127, 126 hostsStaff /26.128 - .191, 62hostsGuests /27.192 - .223, 30hostsLinks /30.224 and .228
Figure 1. One /24 split into different-sized subnets with VLSM, allocating the largest first so the blocks line up.
SubnetNetworkUsable rangeBroadcast
Sales (/25)192.168.10.0.1 to .126.127
Staff (/26)192.168.10.128.129 to .190.191
Guests (/27)192.168.10.192.193 to .222.223
Link 1 (/30)192.168.10.224.225 to .226.227
Link 2 (/30)192.168.10.228.229 to .230.231

The space from .232 to .255 is left for growth. On router-to-router links you can also use /31 (RFC 3021), which has no network or broadcast address and saves two addresses per link. Check your work with the VLSM calculator.

Route summarisation

Summarising four /24s172.16.0.0/24branch LANs172.16.1.0/24172.16.2.0/24172.16.3.0/24172.16.0.0/22one route
Figure 2. Four contiguous /24 networks share their first 22 bits, so a single /22 summary route can represent all of them.

A branch router has 172.16.0.0/24 to 172.16.3.0/24 behind it. Instead of advertising four routes, it can advertise one summary. To find it:

  1. Write the third octets in binary: 0 = 00000000, 1 = 00000001, 2 = 00000010, 3 = 00000011.
  2. The first six bits of that octet are identical; the last two vary.
  3. Common bits: 16 (first two octets) + 6 = 22. The summary is 172.16.0.0/22.

Summaries only work cleanly when the networks are contiguous and start on a block boundary. Summarising 172.16.1.0 to 172.16.4.0 would need a bigger, less accurate summary. That is why good address plans give each site a power-of-two block.

Why it matters at work

  • Smaller routing tables use less memory and converge faster.
  • Stability: when one branch LAN flaps, the summary stays up, so the change does not ripple across the whole network.
  • Simpler firewall rules: one rule for 10.40.0.0/16 covers a whole region.

Real-world example: a company with 40 branches gave each one a /21 out of 10.64.0.0/15 (branch 1 got 10.64.0.0/21, branch 2 got 10.64.8.0/21, and so on). The head office routers see one summary per region instead of 300 small routes, and a single firewall object covers all branch traffic.

Watch out: a summary can attract traffic for addresses that don't exist. Routers usually add a route to Null0 for the summary so that such packets are dropped instead of looping.

Practice

Which prefix gives at least 50 usable hosts with the fewest wasted addresses?
/26, which gives 62 usable hosts.
Summarise 10.1.8.0/24, 10.1.9.0/24, 10.1.10.0/24 and 10.1.11.0/24.
10.1.8.0/22. In binary the third octets 8 to 11 share their first six bits (000010xx).
Why allocate the largest VLSM subnets first?
So that every block starts on its natural boundary and no gaps or overlaps appear between differently sized subnets.

Key takeaways

  • CIDR allows any prefix length; address classes are now just vocabulary.
  • VLSM sizes each subnet to need: sort largest first and allocate in order.
  • Use /30 or /31 for point-to-point links.
  • Summarise contiguous, aligned networks into one shorter prefix.
  • A good address plan gives each site or region a power-of-two block.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.