Tutorials
Subnet masking is a crucial concept in IP networking that allows network administrators to divide large IP networks into smaller, more manageable segments known as subnets. This enhances routing efficiency, improves network security, and optimizes the use of IP address space.
A subnet mask is a 32-bit number used with an IP address to determine which part of the address is the network and which part is the host. It "masks" the IP address and separates the network ID from the host ID.
For example:
IP Address: 192.168.1.10
Subnet Mask: 255.255.255.0
This means:
Network portion: 192.168.1
Host portion: .10
A subnet mask uses binary values:
1s represent the network portion
0s represent the host portion
So, 255.255.255.0 in binary is:
11111111.11111111.11111111.00000000
The first 24 bits are the network part, and the remaining 8 bits are for hosts.
| Class | Default Subnet Mask | CIDR Notation | Hosts per Network |
|---|---|---|---|
| A | 255.0.0.0 | /8 | 16,777,214 |
| B | 255.255.0.0 | /16 | 65,534 |
| C | 255.255.255.0 | /24 | 254 |
Note: The number of hosts excludes the network and broadcast addresses.
Classless Inter-Domain Routing (CIDR) is a shorthand for subnet masks. For example:
/24 = 255.255.255.0
/16 = 255.255.0.0
CIDR helps in flexible and efficient IP address allocation.
Reduce Broadcast Traffic: Smaller networks reduce unnecessary traffic.
Better Security: Isolates groups of hosts.
Improved Network Management: Easier to troubleshoot and maintain.
Efficient IP Utilization: Allows organizations to maximize their IP space.
Let’s say you have a Class C IP block: 192.168.1.0/24
Total IPs: 256 (0–255)
Usable IPs: 254 (excluding network .0 and broadcast .255)
You want to divide it into 4 subnets. You need:
2 bits from the host portion: 22 = 4 subnets
So the new subnet mask:
Original mask: /24 → 255.255.255.0
Add 2 bits: /26 → 255.255.255.192
New subnets:
| Subnet | IP Range | Usable IPs | Broadcast |
|---|---|---|---|
| 1 | 192.168.1.0/26 | .1 to .62 | 192.168.1.63 |
| 2 | 192.168.1.64/26 | .65 to .126 | 192.168.1.127 |
| 3 | 192.168.1.128/26 | .129 to .190 | 192.168.1.191 |
| 4 | 192.168.1.192/26 | .193 to .254 | 192.168.1.255 |
Number of Subnets = 2n (n = number of borrowed bits)
Hosts per Subnet = 2h - 2 (h = remaining host bits)
Determine how many subnets or hosts you need.
Calculate the number of bits to borrow.
Determine the new subnet mask.
Divide the IP block into subnet ranges.
Identify valid host addresses and broadcast addresses.
You are given 192.168.10.0/24 and need 6 subnets.
Needed bits: 3 (23 = 8 subnets)
New subnet mask: /27 → 255.255.255.224
Each subnet has:
25 = 32 IPs
Usable IPs: 30
First subnet:
Network: 192.168.10.0
Usable: 192.168.10.1 – 192.168.10.30
Broadcast: 192.168.10.31
Repeat for the next subnets.
| Subnet Mask | CIDR | Usable Hosts |
|---|---|---|
| 255.255.255.0 | /24 | 254 |
| 255.255.255.128 | /25 | 126 |
| 255.255.255.192 | /26 | 62 |
| 255.255.255.224 | /27 | 30 |
| 255.255.255.240 | /28 | 14 |
| 255.255.255.248 | /29 | 6 |
| 255.255.255.252 | /30 | 2 |
Optimized network performance.
Segmented network for better administration.
Prevent broadcast storms.
Improved fault isolation.
Subnet masking is essential for segmenting a network and managing IP addresses effectively. It allows scalable network designs and lays the groundwork for advanced topics like routing and VLANs. Part II will explore advanced subnetting techniques, VLSM (Variable Length Subnet Masking), and practical subnet design.
Anand Software and Training Pvt. Ltd. is not associated with Cisco® organization or any other company. CCNA™ is a trademarks of Cisco® organization. All trademarks are duly acknowledged. All practice tests and study material provided here is the copyright of Anand Software and Training Pvt. Ltd. All rights reserved.