With IPv4 probably one of the most annoying things is subnetting. It can be quite hard to understand if you look at it from a technically point of view, it can also be very clear if you think simple of it.
Although you can find some pretty easy subnet calculators on the internet, which I will discuss later, first of all we have to understand the basics of subnetting. I just want to explain it in a clear language without getting to technical so bear with me. Here’s an example:
The most common IPv4 address for home use (we call that ‘private’ use) is what we used to call a class C subnet (look at Wikipedia http://en.wikipedia.org/wiki/Classful_network). This IPv4 address is commonly 192.168.0.x, and has a subnetmask that looks like 255.255.255.0. So, what do we see here? The subnet tells us, just as you see at the IPv4 address where I used the x instead of a last number, that this network has a maximum of 255 hosts in its network, that’s where we use the 0 for. It has, so to speak, “room” for 255 hosts, but please note that in real life (and in this case) we use within this subnet the address 192.168.0.0 as ‘network address’ and 192.168.0.255 as ‘broadcast address’ so that will leave 253 real IPv4 addresses left to use.
You can imagine that instead of using the address 192.168.0.1 we can also use 192.168.1.1. And there comes the subnet catch. Because we used the subnetmask 255.255.255.0, a host with address 192.168.0.1 won’t be able to communicate with 192.168.1.1 since they both reside in their own network, unless using a router. What if we want to extend our network? In the first place we have to look if there is ‘room’ enough in the network range we are using. As mentioned before we are using a private IPv4 range. It’s private because it is not used elsewhere on the internet. Other people can use the same range, but it is not allowed to be used in the internet itself. In this case the range from 192.168.0.0 till 192.168.255.255 can be used for private use. If we want to extend the network, the only thing we have to do is adjust the subnetmask accordingly. The subnetmask 255.255.255.0 gave us as mentioned before 255 host addresses, let’s look what will happen if we subtract one off the 255 before the zero so we get 255.255.254.0. As you can see that will leave room for an IPv4 range from 192.168.0.0 till 192.168.1.255. Using that subnetmask will give the ability to communicate from 192.168.0.1 to 192.168.1.1 because they are both in the ‘same’ network. And that is how easy subnetting is!
Sometimes you will see 192.168.0.1/24 instead of 192.168.0.1, 255.255.255.0. We call the /24, the prefix. Since computers are binary they don’t use other numbers then ones and zeros. In binary notation 255 resembles a series of one’s, in this case 255 = 11111111. So, 255.255.255.0 equals 11111111.11111111.11111111.0, three times eight ones. Three times eight is 24. So /24 is the same as 255.255.255.0. In my previous example 192.168.0.0/23 would be our new network address with prefix notation.
Probably one of the finest subnet calculators on the net can be found on: http://www.subnetmask.info/ Give it a try and play with it!
Leave a Reply