Network subnetting tool • 2026 edition
CIDR Notation: /n where n is the number of network bits
Subnet Mask: 255.255.255.(256 - 2^(8-n)) for classless addressing
Where:
These formulas calculate network parameters based on CIDR notation or subnet mask. The CIDR notation represents the number of bits used for the network portion of an IP address.
Example: For IP 192.168.1.0 with /24:
Network Bits: 24, Host Bits: 8
Subnet Mask: 255.255.255.0
Subnets: \(2^0 = 1\), Hosts per subnet: \(2^8 - 2 = 254\)
Step 1: Convert IP address to binary: 192.168.1.0 → 11000000.10101000.00000001.00000000
Step 2: Convert subnet mask to binary: 255.255.255.0 → 11111111.11111111.11111111.00000000
Step 3: Perform bitwise AND operation to find network address
Step 4: Calculate host bits: 32 - 24 = 8 bits
Step 5: Calculate usable hosts: 2^8 - 2 = 254 hosts
| Parameter | Value |
|---|---|
| Network Address | 192.168.1.0 |
| Broadcast Address | 192.168.1.255 |
| First Usable IP | 192.168.1.1 |
| Last Usable IP | 192.168.1.254 |
| Subnet Mask | 255.255.255.0 |
| CIDR Notation | /24 |
| Wildcard Mask | 0.0.0.255 |
| Number of Hosts | 256 |
| Usable Hosts | 254 |
IP subnetting is the process of dividing a larger IP network into smaller subnetworks to optimize network performance and security.
Subnets = \(2^n\), Hosts = \(2^m - 2\)
Where n = borrowed bits, m = remaining host bits.
Class A: 1-126, Class B: 128-191, Class C: 192-223, Class D: 224-239 (Multicast), Class E: 240-255 (Reserved)
For the IP address 172.16.0.0 with subnet mask 255.255.240.0, how many usable host addresses are available per subnet?
The answer is B) 4094. First, convert the subnet mask 255.255.240.0 to binary: 11111111.11111111.11110000.00000000. This shows 20 network bits and 12 host bits. Using the formula 2^12 - 2 = 4096 - 2 = 4094 usable host addresses.
To calculate usable hosts, count the number of zeros in the subnet mask's binary representation. These zeros represent the host bits. Then apply the formula: 2^(number of host bits) - 2 (subtracting 2 for network and broadcast addresses).
Subnet Mask: Defines network/host boundary in IP address
Host Bits: Portion of IP address for individual devices
Usable Hosts: Available addresses excluding network/broadcast
• Count zeros in subnet mask binary to find host bits
• Always subtract 2 from total addresses
• Formula: 2^(host bits) - 2 = usable hosts
• Remember: 240 in binary is 11110000
• Powers of 2: 2^10 = 1024, 2^11 = 2048, 2^12 = 4096
• Forgetting to subtract 2 for network/broadcast addresses
• Miscounting the number of host bits
Given a network 192.168.10.0/24, subnet it using VLSM to create networks for 60, 30, 12, and 2 hosts respectively. Show the network addresses and subnet masks.
For VLSM subnetting, allocate larger subnets first:
For 60 hosts: Need 6 host bits (2^6 - 2 = 62 hosts). Use /26 (255.255.255.192)
Network: 192.168.10.0/26, Range: 192.168.10.1 - 192.168.10.62
For 30 hosts: Need 5 host bits (2^5 - 2 = 30 hosts). Use /27 (255.255.255.224)
Network: 192.168.10.64/27, Range: 192.168.10.65 - 192.168.10.94
For 12 hosts: Need 4 host bits (2^4 - 2 = 14 hosts). Use /28 (255.255.255.240)
Network: 192.168.10.96/28, Range: 192.168.10.97 - 192.168.10.110
For 2 hosts: Need 2 host bits (2^2 - 2 = 2 hosts). Use /30 (255.255.255.252)
Network: 192.168.10.112/30, Range: 192.168.10.113 - 192.168.10.114
VLSM (Variable Length Subnet Masking) allows efficient IP address allocation by assigning subnet sizes based on actual needs. Always allocate the largest subnets first to prevent fragmentation. Calculate host bits needed: round up to next power of 2, then subtract 2 for network and broadcast addresses.
VLSM: Variable Length Subnet Masking - allows different subnet sizes
Subnetting: Dividing a network into smaller segments
Efficient Allocation: Minimizing IP address waste
• Allocate largest subnets first in VLSM
• Use next power of 2 for host requirements
• Always subtract 2 for network/broadcast addresses
• Memorize powers of 2: 2, 4, 8, 16, 32, 64, 128, 256
• Use the formula: 2^(host bits) - 2 = usable hosts
• Allocating small subnets first causing fragmentation
• Forgetting to round up to next power of 2
Q: What's the difference between CIDR and subnet masking, and why is CIDR preferred?
A: Subnet masking uses dotted decimal notation (e.g., 255.255.255.0) to define network boundaries, while CIDR (Classless Inter-Domain Routing) uses prefix notation (e.g., /24).
CIDR is preferred because it:
1. Eliminates classful addressing limitations - no more rigid Class A/B/C boundaries
2. Enables route aggregation - reduces routing table size
3. Allows variable-length subnetting - more efficient IP allocation
4. Simplifies configuration - shorter notation
For example, 255.255.255.0 is equivalent to /24 in CIDR notation. Both represent 24 network bits and 8 host bits.
Q: Why do we subtract 2 from the total number of host addresses in a subnet?
A: We subtract 2 from the total host addresses because:
1. Network Address (first address) - identifies the subnet itself and cannot be assigned to a device
2. Broadcast Address (last address) - used for broadcasting to all devices in the subnet and cannot be assigned to a device
For example, in a /24 subnet (256 total addresses):
- Network Address: 192.168.1.0 (reserved)
- Usable Hosts: 192.168.1.1 to 192.168.1.254 (254 addresses)
- Broadcast Address: 192.168.1.255 (reserved)
This rule applies to all subnet sizes regardless of the subnet mask.