📘 08-10: Variable Length Subnet Mask (VLSM)¶
❓ What is VLSM?¶
VLSM (Variable Length Subnet Mask) is a technique that allows a network to be divided into subnets of different sizes.
Unlike fixed subnetting, VLSM allows more efficient use of IP addresses by allocating subnets based on actual requirements.
💡 Why VLSM is Needed¶
In traditional subnetting:
- all subnets are of equal size
- leads to wasted IP addresses
VLSM solves this by:
- allocating larger subnets to networks with more hosts
- allocating smaller subnets to networks with fewer hosts
👉 This improves IP address utilization.
💡 Key Idea¶
Instead of dividing a network equally,
👉 VLSM divides a network based on need.
🧭 Example Scenario¶
Suppose we have a network:
- Network: 192.168.1.0/24
We need to create subnets for:
| Department | Required Hosts |
|---|---|
| A | 100 |
| B | 50 |
| C | 25 |
| D | 10 |
📌 Step 1: Sort Requirements (Descending Order)¶
Always allocate the largest subnet first.
| Department | Hosts Needed |
|---|---|
| A | 100 |
| B | 50 |
| C | 25 |
| D | 10 |
🧮 Step 2: Determine Required Subnet Sizes¶
Use formula:
Total addresses needed = hosts + 2
| Department | Hosts | Required | Closest Power of 2 | Comments | Prefix |
|---|---|---|---|---|---|
| A | 100 | 102 | 128 = 2^7 | 7 host bits → (32 − 7) = 25 network bits | /25 |
| B | 50 | 52 | 64 = 2^6 | 6 host bits → (32 − 6) = 26 network bits | /26 |
| C | 25 | 27 | 32 = 2^5 | 5 host bits → (32 − 5) = 27 network bits | /27 |
| D | 10 | 12 | 16 = 2^4 | 4 host bits → (32 − 4) = 28 network bits | /28 |
🧮 Step 3: Assign Subnets Sequentially¶
Start from 192.168.1.0 and allocate in order.
🧮 Subnet A (/25)¶
- Network: 192.168.1.0/25
- Range: 192.168.1.0 → 192.168.1.127
- Hosts: 192.168.1.1 → 192.168.1.126
🧮 Subnet B (/26)¶
- Network: 192.168.1.128/26
- Range: 192.168.1.128 → 192.168.1.191
- Hosts: 192.168.1.129 → 192.168.1.190
🧮 Subnet C (/27)¶
- Network: 192.168.1.192/27
- Range: 192.168.1.192 → 192.168.1.223
- Hosts: 192.168.1.193 → 192.168.1.222
🧮 Subnet D (/28)¶
- Network: 192.168.1.224/28
- Range: 192.168.1.224 → 192.168.1.239
- Hosts: 192.168.1.225 → 192.168.1.238
📌 Remaining Address Space¶
Unused range: - 192.168.1.240 → 192.168.1.255
👉 Can be used for future subnets
💡 Why Order Matters¶
If smaller subnets are assigned first:
- large contiguous blocks may not remain
- subnetting may fail
👉 Always allocate from largest to smallest.
📌 Advantages of VLSM¶
- Efficient use of IP addresses
- Flexible network design
- Supports hierarchical addressing
- Reduces wastage
🧮 VLSM vs Fixed Subnetting¶
| Feature | Fixed Subnetting | VLSM |
|---|---|---|
| Subnet size | Equal | Variable |
| Efficiency | Low | High |
| Flexibility | Limited | High |
| Address usage | Wasteful | Optimized |
💡 Key Idea¶
VLSM allows subnet sizes to vary,
👉 making network design more efficient and scalable.
Previous: Implementing Subnets on a Network | All Notes | Module 08 Exercise | Next: Subnets in IPv6