TechKnowSurge
CompTIA Network+ 1.7 Cisco CCNA 1.6 Cisco CCST Networking 2.2 CompTIA A+ Core 1 2.6
VideoNetworkFree

Subnetting

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.

Complete this video to capture a CTF flag worth 1 point.

About this video

Early IP addressing standards proved inadequate almost immediately. RFC 760 allocated only the first octet as the network identifier, producing just 256 possible networks — far too few for real-world deployment. RFC 791 introduced classful addressing in 1981, dividing the IP space into Class A, B, and C ranges based on fixed octet boundaries, which expanded the number of available networks to roughly 2 million. Even that fell short as internet growth accelerated, and the rigid class boundaries meant organizations were often assigned far more host addresses than they needed, wasting significant portions of the address space. Subnetting addresses this inefficiency by allowing the network-to-host boundary to be moved freely within a 32-bit IPv4 address, regardless of its original class. When bits are borrowed from the host portion of an address, they become additional network bits, multiplying the number of distinct networks that can be carved out of a single address block. Borrowing one bit yields two subnets, borrowing eight yields 256, and pushing the boundary further right produces more networks at the cost of fewer usable host addresses per network. Because classful rules no longer determine where the boundary falls, devices need an explicit signal to identify it. The subnet mask serves that purpose: it is a 32-bit value in which every network bit is represented by a binary one and every host bit by a zero, written in dotted-decimal notation such as 255.255.255.0. CIDR notation compresses this further by simply counting the total number of network bits and appending that count to the IP address with a slash, as in 10.0.0.0/24, providing a compact and widely adopted way to express both the address and its subnet boundary in a single string.

What you'll learn

What's covered

Subnetting Fundamentals

Aligned to

CompTIA Network+
1.7 Given a scenario, use appropriate IPv4 network addressing.
Cisco CCNA
1.6 Configure and verify IPv4 addressing and subnetting.
Cisco CCST Networking
2.2 Identify IPv4 addresses and subnet formats.
CompTIA A+ Core 1
2.6 Compare and contrast common network configuration concepts.

Key terms

Subnet
A logical subdivision of an IP network, used to organize and segment network traffic.
Subnet Mask
A 32-bit number that divides an IP address into network and host portions.
IP Address
A numerical label assigned to each device connected to a network that uses the Internet Protocol.
Classful Addressing
An early IPv4 addressing scheme that divided the address space into fixed classes (A, B, and C for hosts; D for multicast; E reserved) based on the leading bits of the address, with each class defining a fixed boundary between the network and host portions. Classful addressing was replaced by CIDR because it wasted large blocks of address space.
Classless Inter-Domain Routing
CIDR
A method for allocating IP addresses and expressing routing prefixes that replaces the older classful addressing scheme by using variable-length prefix notation (e.g., /24). CIDR enables more efficient use of IPv4 address space and reduces the size of internet routing tables through route aggregation.
Host Bits
The portion of an IPv4 address that identifies individual devices within a network segment, as determined by the subnet mask.

Transcript

Subnetting is going to give you that foundational information that we're going to use as we get into our demos.

A glance at IP addressing history

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.

Borrowing bits

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.

The subnet mask

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

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.

About TechKnowSurge

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 →