| Bit | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
To get 168 for the second octet requires a 128, a 32, and an 8:
| Bit | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 |
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
The next two are easy with all zeroes for the third octet and a single 1 for the fourth octet:
| Bit | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
| Bit | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
When put together, the binary representation of 192.168.0.1 is:
11000000.10101000.00000000.00000001
Next, we'll break down the subnet mask, which in our example is 255.255.255.0. In binary, that would look like this:
11111111.11111111.11111111.00000000
This was pretty easy. As you can see above, decimal 255 is the same as having all 1s. Therefore, a mask of 255.255.255.0 tells us that the first three octets are used for the network portion of the address and the last octet is used for the host portion. Reading from left to right, wherever the 1s stop in the subnet mask is where the network portion of the address stops. The 0s represent the host portion of the address. Thus, if you compare the IP address to the subnet mask and you bring down the 0s in the subnet mask to "erase" any of the 1s in corresponding slots in the IP address, you will arrive at the network address. Here's a look at how it works:
| 11111111.11111111.11111111.00000000 | 255.255.255.0 [Subnet mask] |
| 11000000.10101000.00000000.00000001 | 192.168.0.1 [IP address] |
| 11000000.10101000.00000000.00000000 | 192.168.0.0 [network address] |
Subnetting means planning
Before actually subnetting a network, it's good to do some planning. How many host addresses will be needed? How much room will be needed for expansion? It's easier to make room when first subnetting than it is to go back later and resegment a large network. Also remember that in every IP subnet, there will be a network address and broadcast address. In our example, the network address would be 192.168.0.0 and the broadcast would be 192.168.0.255. You can't use these two addresses for hosts. That leaves us with 192.168.0.1-192.168.0.254 to use with hosts. No matter how you subnet your network, you must always remember to avoid using the network address (the first address) or the broadcast (the last address) for any hosts. Valuable knowledge
Of course, there's a lot more to subnetting, but this should help you to understand basics. I recommend downloading a subnet calculator and playing with some example networks. The more you work with IP addressing and subnetting, the easier it becomes. Knowledge of subnetting can be extremely helpful, even if you aren't breaking up networks all the time. Not only will it help you manage whatever networks may be under your control, but it's also good to have an understanding of what's going on in the background. Being able to subnet helps you understand how computers make decisions on whether to route a packet. Subnetting also allows you to make better use of available IP addresses, makes dividing networks easy, and allows you separate subnets logically.
For a weekly round-up of the enterprise IT news, sign up for the Tech Update newsletter. Let the editors know what you think in the Mailroom.






