VLSM: Variable Length Subnet Masking Explained

Master VLSM (Variable Length Subnet Masking) to efficiently allocate IP addresses. Create subnets of different sizes from a single network address block.

10.1.0.0/16Concept

Detailed Explanation

VLSM: Variable Length Subnet Masking

VLSM (Variable Length Subnet Masking) is a subnetting technique that allows you to divide a network into subnets of different sizes. Unlike fixed-length subnetting where every subnet is the same size, VLSM lets you right-size each subnet to its actual needs.

The Problem VLSM Solves

Imagine you have a 10.1.0.0/16 network and need subnets for:

  • A data center with 500 hosts
  • An office with 100 hosts
  • A point-to-point link with 2 hosts

With fixed-length subnetting, you would create all subnets the same size (e.g., /22 for 1,022 hosts each), wasting most addresses in the smaller subnets. VLSM lets you allocate efficiently:

Subnet Size Usable Purpose
10.1.0.0/22 /22 1,022 Data center
10.1.4.0/24 /24 254 Office floor
10.1.5.0/30 /30 2 Point-to-point

How VLSM Works

  1. List requirements from largest to smallest
  2. Allocate the largest subnet first from the available space
  3. Allocate the next largest from the remaining space
  4. Repeat until all subnets are allocated
  5. Verify no subnets overlap

Key Rules

  • Subnets must not overlap — each address belongs to exactly one subnet
  • Subnet addresses must be properly aligned (the network address must be divisible by the subnet size)
  • All routing protocols used must support VLSM (OSPF, EIGRP, BGP do; RIPv1 does not)

Benefits of VLSM

  • Efficient address utilization — no wasted addresses on oversized subnets
  • Scalable design — new subnets of any size can be added to remaining space
  • Hierarchical routing — allows route summarization at boundaries

VLSM and CIDR

VLSM and CIDR are complementary technologies. VLSM handles subnet allocation within an organization, while CIDR handles route aggregation between organizations across the internet.

Use Case

A network architect uses VLSM to allocate a /22 for the server farm, /24s for office floors, and /30s for router links — all from a single /16 block.

Try It — Subnet Calculator

Open full tool