Variable Length Subnet Masking

VLSM for maximizing IP address efficiency through hierarchical subnetting with varying subnet masks

  • VLSM allows different subnet masks within the same major network to maximize IP address efficiency
  • Enables subnetting a subnet (hierarchical subnetting) by using different prefix lengths for different network segments
  • Must use classless routing protocols (RIPv2, EIGRP, OSPF, BGP) that advertise subnet mask information
  • Solves the waste problem of fixed-length subnet masking where all subnets must use the same mask regardless of host requirements

How VLSM Works

  • Start with largest subnet requirement first, then work down to smallest
  • Each subsequent subnet uses remaining address space from the original network
  • Subnet masks can vary from /8 to /30 (point-to-point links) within same major network
  • Key principle: Allocate exactly what you need, no more, no less

VLSM Design Process

  1. List requirements - Identify all subnets and their host counts
  2. Sort by size - Largest subnet first (prevents overlap)
  3. Assign addresses - Use next available block that fits requirement
  4. Calculate ranges - Document network, broadcast, and usable host ranges
  5. Verify no overlap - Ensure subnet ranges don’t conflict

Practical Example

Starting with 192.168.1.0/24 network:

  • Sales (50 hosts needed): 192.168.1.0/26 (62 usable hosts)
  • Engineering (25 hosts): 192.168.1.64/27 (30 usable hosts)
  • Marketing (10 hosts): 192.168.1.96/28 (14 usable hosts)
  • WAN links (2 hosts each): 192.168.1.112/30, 192.168.1.116/30
Subnet Network Mask Usable Range Broadcast Hosts Available
Sales 192.168.1.0/26 255.255.255.192 .1-.62 .63 62
Engineering 192.168.1.64/27 255.255.255.224 .65-.94 .95 30
Marketing 192.168.1.96/28 255.255.255.240 .97-.110 .111 14
WAN Link 1 192.168.1.112/30 255.255.255.252 .113-.114 .115 2

VLSM vs Fixed Length Subnetting

Aspect VLSM Fixed Length
Efficiency High - minimal waste Low - significant waste
Complexity Higher planning required Simple, uniform subnets
Routing Protocol Classless required Works with classful
Scalability Excellent for varied needs Poor for mixed requirements
Address Conservation Maximum conservation Wasteful allocation

Vocabulary

  • Classless routing protocol: Routing protocol that includes subnet mask in updates (RIPv2, EIGRP, OSPF)
  • Hierarchical subnetting: Process of subnetting an already subnetted network
  • Address aggregation: Combining multiple subnets into single routing advertisement (summarization benefit)
  • Subnet overlap: Configuration error where subnet ranges conflict

Notes

  • Always start with largest subnet first - prevents running out of contiguous address space
  • VLSM requires careful planning - draw out your addressing scheme before implementation
  • Use /30 masks for point-to-point WAN links (only 2 usable addresses needed)
  • Leave room for growth - don’t use every available address immediately
  • Routing table entries increase with VLSM but can be reduced through route summarization
  • Common mistake: Forgetting that classful routing protocols (RIPv1, IGRP) cannot support VLSM
  • Best practice: Document your VLSM scheme thoroughly - complex addressing requires good records
  • VLSM enables route summarization at network boundaries, reducing routing table size in large networks