IPv4 Classes – CompTIA Network+ N10-006 – 1.8


IPv4 has traditional class-based subnet masking that has built the foundation for today’s IPv4 networks. In this video, you’ll learn about the default IPv4 classes and the difference between public and private IP addressing.

<< Previous: IPv6 InteroperabilityNext: Classless Inter-Domain Routing >>


When we’re talking about IPv4 and IPv6, it’s very common that we talk about subnetting the network. But why do we need to separate the network into these smaller pieces? Why can’t we just all connect to the network and everyone can communicate with everyone else? Well, there’s obviously technical limitations with that to be able to know where everyone else is on the entire network, especially a worldwide network like the internet would require some extraordinary technical resources.

Instead, we know where the next step is to communicate with you with our routing and we let the routers handle the rest of that communication. There would also be cost limitations. You would have to build some amazing technologies to be able to understand where every single person is with every IP address on the entire worldwide internet. And of course, there’s security concerns with this. We may want to have a network that’s private tell us and not have it available for others to communicate with.

Even the largest networks in the world still subnet into smaller pieces for security and manageability. And as we step through this video, you’ll see how they manage that process by using these IPv4 addresses. There are three pieces we need when we talk about subnetting. The first is the IP address of your workstation. Your device needs this IP address to be unique so that there is only one of those on the network.

This IP address is also combined with a subnet mask. This is the mask that helps your device determine what network it belongs to. You’ll be asked for the subnet mask a lot when you’re configuring a device, because the IP address and the subnet mask go hand in hand. You can’t have one without the other. So when somebody provides you with an IP address, they’re also going to provide you with the subnet mask. And if they haven’t, you’ll have to go back with them and ask what is the subnet mask for this device on the subnet.

And lastly, if we want to be able to communicate outside of our subnet, we need to know what the router is. This is called the default gateway. And this is the device that allows our computer to talk outside of our local subnet. If you need to communicate on the internet, you’re going to need to know your default gateway.

As you can see your IP address is more than just a single address. It’s a combination of a network address and a host address combined into one single set of numbers. The subnet mask is what really determines where that dividing line is between the network that you’re on and the host number that’s been assigned to you. If you really want to see how all of this works then you need to take your IP address and look at the IP address and the subnet mask in binary. And when you do that, you’ll see very clearly the delineation between the network ID and the host ID.

There was a time with IP addressing where we didn’t really require you to know a subnet mask. The subnet mask was something set automatically based on what your IP address was. We call that a classful subnetting. Every IP address range had a subnet mask that was automatically associated with it and there was really no changing this. Well, that was a very static structure that didn’t allow us to configure different sizes of network. So we moved away from this classful type of subnetting in 1993.

We still reference it very casually in conversation. We describe subnet masks by what class they happen to be. So if somebody said, I would need to know what the subnet mask of that device is and they say, oh, that’s a class C. You’ll know they were refering to a 255.255.255.0 subnet mask. If you are also starting out in subnetting, a number of the questions you’ll get we’ll assume that you’re starting with the base subnet class. So it’s important to know that a class A has 255.0.0.0, a class B is 255.255.0.0, and a class C is 255.255.255.0.

As you can see from this chart there’s also a class D and a class E. Class D is a multicast and Class E is reserved. So when we talk about networks and subnetting, we’re generally talking about a Class A, class B, or a class C address. I told you that originally these were defined automatically and the automation associated with this was based on the leading bits of the IP address.

If your IP address started with 1 to 126 it was a Class A subnet, which means there were 8 network bits and 24 host bits. That means you could have 128 networks and over 16 million hosts per network. It’s a very large network. It would be very unusual to find anything close to that number on a single subnet. This is, of course, the default subnet mask for class A 255.0.0.0.

Class B meant that the IP address you were using started with 128 through 191. So your network bits and the remaining bits for hosts were divided 16 and 16. This meant you could have 16,000 plus networks and over 65,000 hosts per network. A class C means that the IP address is starting with 192 through 223, which means there were 24 network bits. You had eight bits remaining for hosts. That means you could have over 2 million networks and 254 hosts per network with the default mask of 255.0.0.0.

Now you’ll notice in here, we skipped 127. We went straight from 126 to 128. That’s because the 127 network is reserved as a loopback address in IPv4 and it is not associated with any particular class. We also have a concept in IPv4 for public addresses and private addresses. Public addresses are addresses that can be communicated over the internet. We can route public addresses wherever we need them to go.

Private addresses cannot be routed over the internet. And the reason we created private addresses is so we can have as many addresses that we need inside of our private organization and then we can perform network address translation to a public address and communicate outside of the network. This was designed especially with IPv4 to minimize the number of IP addresses that were used. And without these private addresses, we would have very quickly overwhelmed the available address space in IPv4.

You might also see private addresses refer to as RFC 1918 addresses. This is the RFC were we first define what these private IP address ranges would be. You can see from this chart that we have three address ranges to choose from for our private addresses. We could choose what we call the 10 dot address range. That’s an address range of 10.0.0.0 through 10.255.255.255, giving us 16 million plus addresses to choose from. And of course, we could even subnet that further if we’d like to.

You might also see a private address range of 172.16.0.0 through 172.31.255.255. That gives us effectively 16 class Bs– very large networks that we can then subnet and used for private use. And the last address that you could use for your private addressing is the 192.168.0.0 network. By default, that is massed with a slash 16. But you commonly see people subnet it into a class C subnet giving you 256 networks that you could use. Now that you know the IP address ranges for a RFC 1918 or a private address, you should be able to look at any IP address and know instantly whether that is a private address or a public address.