Subnetting is the process of dividing an IP address space into smaller, more manageable networks by borrowing bits from the host portion of an address. The subnet mask communicates to devices exactly where the boundary between the network and host portions has been drawn, and CIDR notation expresses that boundary as a simple bit count.
Subnetting Fundamentals
Subnetting is going to give you that foundational information that we're going to use as we get into our demos.
Early in this course I really talked about the history of IP addresses. It really gives us a great understanding of where we're going and what we came from. When I started out I talked about RFC 760 and how it defined what an IP address looked like. One of the things it specified was that this first octet specifies the network. That's 8 bits, so 2 to the eighth power, and that gives us 256 networks, which is just crazy small, because we obviously have way more need than just that. And then the rest of this was supposed to be the host bits, which is way too many hosts for any one network.
So really a change was needed pretty quickly, and that's when RFC 791 specified IPv4 and what IP addresses look like. What it did is it broke things down into the classes, and we went in depth into how there's a Class A, which specifies this first octet is the network address; a Class B, where it extends it to two octets; or a Class C, which is three octets. So that is what was specified in 1981.
It still only gives us a little over 2 million networks here, so it's still not enough networks for the internet connections which were growing. So we needed more networks, and we didn't need near as many host addresses per each one of those networks. So that's where subnets come in.
Subnets allow us to break this down into smaller pieces. Subnetting is essentially just breaking this down: if you had a Class A address, I could draw the line somewhere else and say this is all going to be the network side of this and this is going to be the host side of it. So that's what subnetting is — we are borrowing bits, and we are borrowing bits for the network bits.
So what does that look like? This right here is a Class A. I know it's a Class A because it starts with 10, and 10 is within the range of 0 through 127, which is a Class A address. Or, if I were to turn this into a binary number, the leading digit would be a zero, and so therefore since this starts out with a zero, then this would be in the Class A range.
So because it's a Class A, I know it's the first octet that's the network address. So what I'm going to do is, let's say I'm given this address — this is the address that I can use. Maybe the internet service provider gave me this, or, as we look at it, we see that it's a private address. So now I have this to work with and split up amongst my network, and maybe I have lots of smaller networks that I need to split this up into.
So what I'm going to do is I'm going to borrow bits for a network address. So maybe I'm just going to borrow one. If I just borrow one bit, that's going to give me two different networks — it's going to give me a one or a zero. Or maybe I want to borrow eight bits, and so now I have 256 networks available to me. So I can draw the line here where I want to do this subnetting. I could even draw it way over here and have a lot of different networks and then just a couple of addresses per each network. This would be two to the second power, which is four, so that gives us four options for the host. But we have to minus the network address and the broadcast address, so that only renders us really two addresses here. So maybe I just have two devices on there, which — there actually are a lot of networks that surprisingly have that, but we'll get into that a little bit later. But essentially, subnetting is that we can draw the line where we want, which specifies what are the network bits and what are the host bits.
So now we've changed the rules for computers, or whatever devices that you are working on. Before, they would just look at this first octet, and from that information they can figure out where the line is supposed to be drawn. But now we're drawing the line somewhere else, so now the computer needs to figure out where you've drawn that line. We need to tell it, and that's what a subnet mask does: you are going to tell the computer, whatever device you're working on, where you're drawing the line.
We do that through bits, through ones and zeros. So in this case right here, I'm going to turn a bit on for every place that is going to be the network portion of this. So I'm going to turn all these bits on here, and what it's doing is it's saying each one of those bits is what it's going to look at for the network portion, and the ones that are just host portion, we're going to use zeros for. So there you have it — now we've specified, by entering in the subnet mask, we've told the computer what this is going to be. And then the way that looks is all ones in the octet is 255, so the subnet mask would look like 255.255.255.0. So that's what we would enter in as a subnet mask.
CIDR notation didn't really come until a little bit later, but you're going to start seeing that incorporated into our lessons now, so I wanted to cover what CIDR notation is. CIDR notation really isn't all that difficult. All it is, is rather than writing out a subnet mask and presenting it as a subnet mask, you're just going to count how many ones are in the subnet mask, and that's what's going to specify where you've drawn the line. So in this case right here, we've got the address 10.0.0.0, and then we would count the ones, which we've got 24 ones here, so we would say slash 24. And that's how we would specify that now we've borrowed extra bits and the total number of network bits is 24.
So there you have it. This is the IP address right here; it is a Class A, so typically we would have just the first octet as being the network bits. We've drawn the line at another location instead. So then, using these bits, we create a subnet mask, and this is what the subnet mask would look like: 255.255.255.0. And then we can write that out in CIDR notation, which once again didn't come until a little later, but we're going to start incorporating that into our lessons now.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →