Lesson 38: Calculating Subnets: Step-by-Step Example 1 (/26)
Let's apply binary math to calculate subnetting for the network 192.168.1.0/26.
Step 1: Determine Network and Host Bits
- Total Bits: 32
- Network Bits (N): The prefix is /26. (26 bits are dedicated to the network)
- Host Bits (H): 32 - 26 = 6 bits remain for the hosts.
Step 2: Calculate Subnets and Hosts
- Borrowed Bits (S): Since /24 (255.255.255.0) is the default Class C boundary, we borrowed $26 - 24 = 2$ bits.
- Number of Subnets: $2^S = 2^2 = 4$ subnets.
- Usable Hosts per Subnet: $2^H - 2 = 2^6 - 2 = 64 - 2 = 62$ usable hosts.
Step 3: Determine the Block Size (Magic Number)
In the fourth octet, the 26th bit is the 2nd borrowed bit. The value of this bit determines the block size or subnet increment.
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|
| 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
- The 26th bit has a value of 64. This is the block size.
Step 4: List the Subnets
Starting from the base network, increment by the block size (64) until you reach 256:
| Subnet | Network Address | First Usable Host | Last Usable Host | Broadcast Address |
|---|---|---|---|---|
| 1 | 192.168.1.0 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 |
| 2 | 192.168.1.64 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 |
| 3 | 192.168.1.128 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 |
| 4 | 192.168.1.192 | 192.168.1.193 | 192.168.1.254 | 192.168.1.255 |
Conclusion: Subnetting is merely controlled manipulation of the subnet mask to divide the network space efficiently.