
To many, that’s a tough question: “How to Determine Usable IP Addresses Within a Subnet”? The best way is by subnetting, or using VLSM: Variable Length Subnet Masking.
Every IP address has 32 bits, 8 bits per octet (oct meaning Eight). So if you’re subnetting, you simply take the subnet prefix and subtract it from 32 as the first step.
Example: a /28 subnet.
32-28=4. 4 bits for the hosts, since there’s 28 for the subnet. So the next step is the 2 to the exponent formula, it’s always 2 to the power of the host bits. So…
2^4=16. 16 IP addresses in a /28 subnet.
Now, there’s always 2 unusable ones, the first IP and the last IP in the range, called the network address or the low broadcast and the broadcast. So 16-2=14. The answer is there’s 14 useable IP addresses in a /28, often called host addresses.
So now we know there’s 16 total IP address, how do we actually subnet? Well, let’s continue with our /28.
A /28 is a member of the Class C subnets, meaning we can use a “Classfull” C, or a /24 and divide it up.
So we know that there’s 16 IP addresses, and we know there’s 256 IP addresses in a /24 (32-24=8, then 2^8=256), so we divide now.
256/16=16. There are 16 /28s in a /24.
So the next step would simply be to count them out in intervals of 16.
For example, 192.168.0.0/24. If we chop that up into /28s, we count out in intervals of 16, starting at 0:
1. 192.168.0.0/28 is 192.168.0.0-192.168.0.15
2. 192.168.0.16/28 is 192.168.0.16-192.168.0.31
3. 192.168.0.32/28 is 192.168.0.32-192.168.0.47
And so on until all 16 subnets have been defined.
It’s also important to remember that even if the IP space doesn’t fall within a class C, it’s the subnet that matters. A /28 subnet is always going to be a member of the Class C subnets, using a /24 as the template. Just like a Class B subnet such as a /19 is a member of the Class B subnets and will always use a /16 as the template.
For example: 10.25.0.0/24. Even though the IP address is in the Class A range, it’s the subnet that counts. The /28 is a member of the Class C subnets, so we still use that /24 to divide it up.
1. 10.25.0.0/28 is 10.25.0.0-10.25.0.15
2. 10.25.0.16/28 is 10.25.0.16-10.25.0.31
3. 10.25.0.32/28 is 10.25.0.32-10.25.0.47
And so on until all 16 subnets have been defined.
Also, keep in mind that any IP Address can be subnetted into any prefix. Using VLSM make it easy. For example, 6.6.6.0 can be 6.6.6.0/24 even though it’s technically a class A. This is the whole purpose of classless subnetting.
So, to recap, the 3 step formula to find out how many usable hosts would be:
1. 32 – {prefix} = {host bits}
2. 2^{host bits} = Total Number of IP Addresses
3. {Total Number of IP Addresses} – 2 = Usable Host Addresses