Subnetting and CIDR

Module: B1.5-R5: Data Communications and Computer Networks

Chapter: Network Layer

🔹 Introduction

Subnetting divides a large network into smaller subnetworks, improving security, performance, and efficient IP address usage.

CIDR (Classless Inter-Domain Routing) replaces classful addressing and allows flexible network prefix lengths.

1️⃣ What is Subnetting?

Subnetting breaks a network into multiple smaller networks by borrowing bits from the host portion.

✔ Benefits of Subnetting
  • Efficient IP address usage
  • Reduced broadcast traffic
  • Improved security
  • Better network management
✔ Subnetting Formula
Number of Subnets = 2^n  
Number of Hosts per Subnet = 2^(remaining bits) - 2
Where **n = number of borrowed bits**.
2️⃣ Subnetting Example (Detailed)
✔ Given:
Network: 192.168.10.0/24  
Required Subnets: 4
✔ Step 1: Borrow Bits
  • 4 subnets needed → 2^n = 4 → n = 2 bits
✔ Step 2: New Subnet Mask
Original mask: /24 → 255.255.255.0  
Borrow 2 bits → new mask = /26 → 255.255.255.192
✔ Step 3: Subnet Calculation
Subnet Network Address Host Range Broadcast
1 192.168.10.0 192.168.10.1 – 192.168.10.62 192.168.10.63
2 192.168.10.64 192.168.10.65 – 192.168.10.126 192.168.10.127
3 192.168.10.128 192.168.10.129 – 192.168.10.190 192.168.10.191
4 192.168.10.192 192.168.10.193 – 192.168.10.254 192.168.10.255
3️⃣ CIDR (Classless Inter-Domain Routing)

CIDR replaces class A/B/C addressing and uses network prefixes like /16, /19, /23 instead of fixed class boundaries.

✔ CIDR Benefits
  • Prevents IP address wastage
  • Supports route aggregation (supernetting)
  • Enables flexible subnet design
  • Reduces routing table size
✔ CIDR Example
IP Block: 172.16.0.0/20  
Covers: 172.16.0.0 – 172.16.15.255  
Total Hosts: 4094
✔ Supernetting Example

Combining four /24 networks into one /22 block:

192.168.4.0  
192.168.5.0  
192.168.6.0  
192.168.7.0  
Combined → 192.168.4.0/22
4️⃣ Common CIDR Blocks and Host Capacity
CIDRHostsSubnet Mask
/302255.255.255.252
/296255.255.255.248
/2814255.255.255.240
/2730255.255.255.224
/2662255.255.255.192
/25126255.255.255.128
/24254255.255.255.0
/23510255.255.254.0
/221022255.255.252.0
📝 Conclusion

Subnetting and CIDR are essential for modern IP addressing, enabling efficient address utilization, improved routing, and scalable network design. CIDR’s flexibility has replaced traditional classful addressing and allows networks to grow or shrink as required.