How does a network administrator know how to split the network into smaller subnets? In this video, you’ll learn about subnet classes and how they can be used to create groups of IPv4 subnets and hosts.
As you begin the process of learning more about IP subnetting, the process of understanding the subnet masks becomes very important. And when we start talking about IPv4 subnetting, you’ll often hear about differences between class A, class B, and class C IP subnets. This is referring to a subheading architecture that technically we’ve not used since 1993, when IP was originally created. The subnet masks were automatically determined based on what your IP address was.
But today you have much more control over the subnet mask, because we use classless subnetting. But for the purposes of understanding today’s form of subnetting, we’re going to look back at how this classful-based subnets process works. And although today we have much more control over our subnet masks, and we’re not limited to simply a class A, class B, or class C, you may still see these classes referenced in casual conversations.
And although it seems that we’re going back in time to understand a way that we used to provide subnet masking, these have a very important application in today’s subnetting. This is the default starting point for subnet masks, and it’s important that we understand where a subnet mask begins and how much we’re able to subnet from that point.
There are technically five different classes for IP subnets. You will commonly see class A, class B, and class C used, because those are the classes that we are assigning to different workstations. If you’re working at all with IPv4 and multicast, you’ll be using class D addresses and subnet masking. And class E is a reserved range, and you will never use these IP addresses on your production network.
One way to determine the class of an IP address is to look at the first octet in the entire address. If the IP address starts with 1 through 127, then it’s a class A address. If the IP address starts with 128 through 191, it’s class B. And numbers 192-223 designate that as a class C address. If you’re doing IP multicast, then you’ll notice those IP addresses start with 224 through 239, and that reserve range is a range between 240 and 254.
What’s interesting about all of these different classes is that, if you convert that very first number to binary and look at just the first four bits of that binary value, you’ll find that anything that starts with a 0 is class A, anything that starts with 10 is class B, 110 is class C, 1110 is Class D, and all 1’s would be class E. Back when subnet masks were automatically defined based on what this IP address was, it would configure the default subnet mask based on that IP address.
So if your IP address started with a number between 1 and 127, your subnet mask was 255.0.0.0. If that first octet of the IP address was between 128 and 191, your subnet mask was 255.255.0.0. And if the IP address started with 192 through 223, the subnet mask was 255.255.255.0. In this chart, those are the three most important columns– the class, the leading bits, and the default subnet masks.
If we are using those values associated with those classes, you’ll see the network bits, the remaining bits, the number of networks, and the host per networks are calculated based on those default values. Let’s go through a number of IP addresses and see if we can determine what the default class is for that address. We’ll start with this IP address of 18.104.22.168. We’ll look at the first octet, which is 17.
And we know that any number between 1 and 127 is a class A address. The next on our list is 22.214.171.124. Looking at that to 20 at the beginning and referring back to our previous chart, we would call this a class C address. The next IP address is 126.96.36.199. And again, referring to our chart, or looking at a 165, converting it to binary, looking at the first four bits, you should be able to determine that is a class B address.
188.8.131.52 begins with a 128, which means that it is also a class B address. For the IP address of 184.108.40.206, we look at that first octet, which is 191. And that 191 files into the category of a class B address. And lastly, 220.127.116.11– that 192 is one more than 191, but that is the difference between a class B and a class C address.
When you’re working with IP subnetting, there are four separate values that you need to be able to calculate. We’re going to go through these four here, and then I’ll demonstrate how you can perform some practical calculations to determine all four of these values. The first value is the network address. This is the first IP address that’s in a subnet. To calculate the network address, we set all host bits in the address to 0 or 0 decimal, and we calculate what the decimal value of that might be.
The second value you’ll need to calculate is the first usable host address. If the network address, then you can calculate that easily because it’s one number higher than the network address. The next value we need to calculate is the network broadcast address. The broadcast address is the last IP address that’s in a subnet. When we calculated the network address, we set all host bits to 0. To calculate the broadcast address, we set all hosts bits to 1.
And then we perform a conversion to decimal to determine what the network broadcast address is. The last value we’ll need to calculate is the last usable host address, which is one number lower than the broadcast address. So we take the broadcast address that we just calculated, we subtract 1, and we have the last usable host address.
Now that you understand the process, let’s perform some practical calculations. We need to calculate the subnet address, the first host address, the broadcast address, and the last usable host address. Let’s start with an IP address of 10.74.222.11. This address is a class A address. We know that because we looked at the first octet. We compared this to the chart that we had earlier, and this address certainly is a class A address.
If we take the default subnet mask for this address, we know that this class A address is 255.0.0.0. Because we know that the subnet mask is 255.0.0.0, we can add a separation in this particular address where all of the 255 values are on the left and all of the 0 values are on the right. And that puts this divider right after that first octet. So 10 is on one side of the divider and all of the other octets are on the other side of the divider.
If we write this out and separate things on the left side of the divider as the network portion of the address, and everything on the right is the host portion of the IP address, then you can see the network portion is 10 dot, then the host portion is 74.222.11. Now we need to start performing some calculations to determine what the subnet address or network address happens to be, so we’re going to set all host bits to 0. That means, for this IP address, the network address is 10.0.0.0, because we changed all of those hosts addresses to 0’s.
We also know that the first usable IP address in this subnet is one address higher than the network address, so we add 1 to this 0.0.0, which gives us 0.0.1. So your entire first host address is 10.0.0.1. To calculate the broadcast address, we change all of the host numbers to all 1’s. In decimal, this is all 255’s. So your broadcast address for the subnet is 10.255.255.255.
We also know the last usable IP address on this subnet is one value lower than the broadcast address, which means that our last usable host address is 10.255.255.254. As long as the class and you know where to make that dividing line, all of the other calculations should fall right into place, as long as you follow those simple rules.
Let’s look at another IP address. We’ll look at 172.16.88.200. The first thing we should do is find out what class this address is associated with. We need to look at that first octet, which is 172, which places this IP address into the class B category. Knowing that this is a class B address, we know that the default subnet mask is 255.255.0.0. That puts our network address on the first two octets, and the host part of the address is the last two octets.
If we were to write this out in our chart, the network portion of the address is 172.16, and the host part of the address is 88.200. The first thing we need to do is determine what the subnet or network address is. We set all host bits to 0, which means that the network address is 172.16.0.0. To determine the first usable IP address of the subnet, we add 1 to the host side, meaning that we have a first host address of 172.16.0.1.
To calculate the broadcast address, we set all of the host bits to one, which, in decimal, is 255, meaning that our broadcast address is 172.16.255.255. And the last usable address is one address lower than the broadcast address, meaning that the last usable host address is 172.16.255.254. Here’s one more. We’ll look at the IP address of 192.168.4.77.
Looking at that first octet, we can see that the 192 means that this is a class C address. That also means that the default subnet mask for class C is 255.255.255.0. We’ll put this IP address separator right after that third octet, and put it into our chart. So the network portion of the IP address is 192.168.4, and the host portion of the IP address is 77.
Let’s perform the same four calculations. We’ll determine what the network address is by setting all the host bits to 0. In this case, the host bits are only that last octet, so your network address is 192.168.4.0. If we add 1 to that value to determine the first usable host address, we come up with the IP address of 192.168.4.1.
Determining the broadcast address means that we set all of the host bits to 1, or 255 in decimal. So your broadcast address is 192.168.4.255. And the last usable IP address of this subnet is one fewer than the broadcast address, making that last usable host address 192.168.4.254. By using these rules, you can easily calculate what all of these values are for IP addresses that happen to have subnet mask that correlate to a class A, class B, or class C subnet mask.
You may find that the IP address is on your network use these delineations at each octet point, which makes it a very easy calculation. But these days we’re able to subnet into any of these octets. And in future videos, we’ll look at how to perform calculations if you’re using classless subnetting.