Subnetting made easy?!?

I’ve been thinking about writing this article for a while. There had to be a way to easily describe the process of IP subnet calculations. I’ll take a shot now.

First, you have to designate what subnet you have or want to work with. For sake of easiness, let’s choose a private class C network: 192.168.1.0 /24. This means that the portion of the address that is permanent is: 192.168.1 and the .0 is up for grabs. 0-255 are options for this address, however, you cannot use 0 (network address) or 255 (broadcast address). This leaves 1-254. The /24 means that there are 24 bits in the network address. Confused yet? Stay with me.

In every IP address, there are 32 binary digits. We call’em bits. There are bits designated for the host portion of the address and bits designate for the network portion of the address. In order to break the address down into smaller networks, we use what’s called a ’subnet mask’. Using the above address of 192.168.1.0, there are the network and host portions of the subnet mask are as represented in binary:

NNNNNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH

How many ‘N’ are there? How many ‘H’? Remember that /24 above? Any coincidence that there are exactly 24 Ns?

So now your asking: “Where does subnetting come into play?”

You have 1 Class C range to work with right now. You may for your own reasons want to further break that down into more than one subnet. Let’s say you want 2 subnets. This is where it gets fun. In order to generate more subnets, one must ‘borrow’ bits from the host portion of the address. b = Borrowed bits. The formula for calculating useable sub-networks is 2b - 2 = (Useable Subnets). Given we want 2 usable subnets, 2b is going to have to equal 4. So that’s 2 borrowed bits…. 22 - 2 = 2 usable subnets. So now the network mask will look something like this represented in binary:

NNNNNNNN.NNNNNNNN.NNNNNNNN.NNHHHHHH
aka /26 or 255.255.255.192

After borrowing 2 bits from the host portion of the Class C address, you have 6 remaining. Given that r = remaining bits, one can calculate the quantity of useable IP addresses per subnet by using the formula: 2r - 2 = (Useable Subnets). 26 - 2 = 62 (Useable IP Addresses per Sub-Network).

Comments (0) 11:40 pm