combine the material in this section with a great deal of practice and you will become an absolute subnetting surgeon.
The concept of subnetting is simple enough. We’re simply taking a block of IP addresses and cutting it up into smaller pieces. That’s really all there is to it. For those new tosubnetting, I’ve found pie (or pizza) makes a better visual.
Let’s say that you have two hungry people and one pie .You have two choices:
- Give the entire pie to one person and let the other person go hungry.
- Cut the pie into slices and give each person a slice.
Now that second choice leads to another set of choices :
- Cut the pie in the halves and give each person half
- Cut the pie into multiple slices, give each person a slice, and save the other slices for other hungry people who just might come along later.
Before you sent out for food, let me show exactly what I mean by all of this.
We’re going to start with the unsubnetted network 20.0.0.0/8, represented as a pie a pizza, shape of my head, whatever comparison you prefer.
But in any case, 20.0.0.0/8 is the only address block that we’re allowed to use for our network in the following walkthrough.
And here’s how we start.

We have this giant circle of addresses (a block of addresses) and we want to do know when we have to subnet, when we don’t, and how to subnet.
We’ll start with a simple one-segment network.

I didn’t even put a router number or a router interface on there.
In this case, we have one segment and one block of addresses, so we don’t need to subnet.
because only one network segment exists. There’s no reason to share.
(This is comparable to having one hungry person and one pie. No need to slice, just give that person the entire pie!)
So what we want to look at instead is something a little more realistic here

We’ve got a router with two interfaces and we have two network segments and this is where subnetting actually comes into play because I literally cannot take that entire block of addresses (20.0.0.0/8) and use them on both sides of the router. And that’s a term you’re going to bump into once in a while and Cisco documentation as well… You can’t use addresses from the same little block of addresses or same large block addresses on more than one side of the router.
Let’s say that on the two fast ethernet interfaces on R2 I want to use addresses from the 20.0.0.0/8 network with no subnetting.
I go to my first interface and I give it an address of 20.1.1.1

And then I go to my other fast ethernet interface
And you’re going to get an odd message here

And this will pop up every once in a while! The network you just added overlaps with another Interface.
(You’ll see this more in practice with loopback if you’re creating a lot of loopbacks and you get a mask wrong or you’ve already one address from a certain subnet then you go back and try to create one later.)
Here it means that what I’m trying to do right now is use addresses from that same network
This is where subnetting comes in.
I’ve got to take that block of addresses that I have (or that pie of addresses) and I’ve got to cut it up into slices and give the network on fast ethernet 0/0 a slice and I got to give a separate slice to fast ethernet 0/1.
Knowing when you have to subnet is half the battle. The other half is making the right “slice” – that is, determining how large this subnet should be. That decision is going to be made by analyzing the answers to these questions:
- How many subnets do we need overall, including those are reserved for future growth?
(If I just slice it in half and assign addresses from half of the block to the left side of the router and the other half to the right side of the router what happens when the third network segment gets added in the future that needs addresses from that same subnet?
This is the only block of addresses we have to work with.)
- How many host addresses are needed by each subnet?
You’ll see exactly how to answer these questions and use them to subnet efficiently later in this section. I mention these questions now to impress upon you the importance of leaving yourself some wiggle room with your subnetting for any network segments you may add in the future. In fewer words, planning for future growth!
The Hidden Challenge Of Subnetting
As network admins, when we go in to work, we’re not setting everything up from scratch
And the main part of our day is taken up with troubleshooting and adding hosts to our already-existing network. Same goes for subnetting.
We’re not going to walk in every day and subnet addresses and assign them from the very beginning. We may find ourselves in situations at client sites that demand answers to these questions:
- What subnet is this IP address on?
- What’s the broadcast address for the subnet in question?
(255.255.255.255 is not the only BC address. Every subnet has one. We have to be careful not to assign it to a host)
- What’s the valid address range for hosts assigned to a particular subnet?
The thing is you could come in after someone else has done the subnetting. That’s what’s going to happen most of the time in the real world (and on job interview questions, practice exam questions, and most likely real exam questions.)
While we have to be ready to subnet a block of addresses ourselves, we also have to be ready to be analyze subnetting that someone else has done.
You should always double-check and triple-check the number of valid subnets available in your addressing scheme before you start assigning the addresses on your network, because if you make a mistake and then you’ve got to go back and start reassigning addresses it just gets to be a mess.
You could save yourself a lot of heartache in the real world by going off by yourself for a few minutes and checking your scheme out before you start configuring it, and you’ll learn how to do just that right now.
Now this is a valuable skill to have regardless of who did the actual subnetting, so in our walkthrough and practice questions, we’ll be presented with the subnetted network (by someone else) and then determine how many valid subnets we have to work with.
With practice, you’ll answer “valid subnet” questions on your exams and in real-world networking situations in less than a minute.
And I’m going to show you the longer way first because I want you to see exactly what’s going on in a bit by bit level.
.
So we’re going to start to practice with these sample questions:
How many valid subnets exist on the 10.0.0.0 255.240.0.0 network?
How many valid subnets are on the 10.0.0.0/12 Network?
These two questions are referring to the exact same subnet; They’re just using different formats of expressing the subnet mask.
The first one used a dotted decimal mask, while the second one uses prefix notation
( you’re much more likely to see prefix notation than a dotted decimal mask in real world networking, but on your exam I expect you to see both).
With prefix notation, the number behind the slash is the number of consecutive ones at the beginning of the mask.
The dotted decimal mask 255.240.0.0 converts this binary string:
11111111 11110000 00000000 00000000
There are 12 ones at the start of that mask, and that’s where the /12 comes from.
Using prefix notation saves a lot of space on network diagrams and makes them easier to read, and it’s a lot easier to discuss masks verbally using prefix notation.
Remember the Class A, B, C network masks? I told you that come in handy one day and this chapter is that day.
Here’s a quick review of them:

Those network masks tell us how many network bits and host bits are present in each.
Ones or network bits and zeroes or host bits.
Notice I’m not saying anything about sub net bits yet because no subnetting has been done.
These are the network masks.
Class A mask = 255.0.0.0 = 8 network bits, 24 host bits
Class B mask = 255.255.0.0 = 16 network bits, 16 host bits
Class C mask = 255.255.255.0 = 24 network bits, 8 host bits
Why do we care about the network bits and host bits? For this simple reason:
Subnetting is performed by borrowing host bits
That’s it. That’s all subnetting is. You’re borrowing host bits, and never, ever, ever network bits.
Let’s go back to our practice question: How many valid subnets are on the 10.0.0.0 / 12 network? The challenge here is that someone else has already done the subnetting, and we have to determine how many valid subnets now exist.
I’m going to show you two methods for nailing these questions.
The first method is a little longer but gives you a better idea what exactly is happening with subnets and where the host bit borrowing comes in.
The second is a quicker method, which I suggest you use once you’re comfortable with the first.
For the longer method, we’ll do a bit-by-bit comparison of the Class A network mask and the subnet mask /12.
The subnet bits are the bits where there’s a 0 in the network mask and a 1 in the subnet mask.
And that’s why I’m doing this break down.

So how many do we have? We’ve got four subnet bits now.
The subnet mask has eight network bits, four subnet bits, and 20 host bits. All we have to do is plug the number of subnet bits into this formula:
Number of valid subnets = ( 2 to the power of the number of subnet bits)
For 2 to the 4th power , the result is 16
We have 16 valid subnets and that’s all there is to it.
Now you see exactly what’s going on with those borrowed bits, let me show you how to solve these questions without writing the masks out, using this question:
How many valid subnets are on the 150.10.0.0/21 network?
This is where having your class A, B, and C ranges and masks down cold save you a lot of time on exam day. You know these two things about this network immediately.
- It’s a B network.
- The Class B network mask is /16.
Start here:
(# of bits in subnet mask) – (# of bits in network masks) = Number of subnet bits
In this case, 21 – 16 = 5
Take 2 to the 5th power and it would tell you how many valid subnets you have.
So you have 32 valid subnets.
Let’s take 200.1.1.0 /27
How many valid subsets we have here?
First off we know it’s a class C network, so subtract 24 from the subnet mask of /27, leaving you three subnet bits. Two to the third power is “eight”… Done and DONE!
Knowing the number of valid subnets is important, as is knowing the number of valid hosts on each subnet.
Determining The Number Of Valid Hosts On A Subnet
As with our “valid subnets” determination, the actual subnetting has already been done and we need to come up with a value regarding that subnetting – here, the number of valid hosts on the subnet.
We start by arriving at the number of host bits and that is a very quick trip:
32 – (# of ones in the subnet mask) = # of host bits
So once we have the number of host bits What do we do with it?
We put it into this formula, even handier and dandier than the one you learned in the last section:
(2 to the power of # of host bits) – 2 = # of valid hosts
On exam day, make sure you take that two off because it can make the difference between getting the question totally right and totally wrong.
Let’s walk through an example using the network 200.10.10.0 /26.
32 – 26 = 6 host bits.
2 to the 6th power = 64
64 – 2 = 62 valid hosts on 200.10.10.0/26
Now if I were writing a practice exam and I was giving you multiple choice, I would guarantee one of the choices would be 64, and I guarantee it 20 percent of the people say “oh 64 !”… You should subtract the two.
Let me point out two major differences between this determination and coming up with the number of ballots subnets.
- Determining the number of valid hosts uses the number of host bits, where determining the number of valid sublets uses the number of subnet bits (Makes sense!)
- You only subtract the 2 in the “valid hosts” calculation.
Why subtract the two?
There are two addresses in each subnet that are considered unusable by hosts:
- The very first address in the subnet is the subnet number itself.
- The last address in the subnet is the broadcast address for that subnet.
( I know I’ve told you the broadcast address 255.255.255.255 is an overall broadcast address but every subnet has a broadcast address of its own.)
This concept will become clearer later in this section when we’re calculating the actual range of valid IP addresses in a given subnet, along with the broadcast address for that subnet.
Be sure to subtract that two when calculating the number of valid hosts!
Determining The Subnet Number Of An IP Address
You’ll find this to be handy skill for passing your exams and troubleshooting real-world networks. Some communication issues between hosts arise when the admin thinks the involved hosts are on the same subnet, but they’re actually not. We’ll take a longer look at the first example and then I’ll show you a method that’ll allow you to determine an IP address’s subnet in less than a minute.
Often, communication issues result when a host is thought to be on one subnet, but is actually on another one.
Sure sometimes you can tell what subnet host is on just by looking at the address and mask, but other times it’s not as evident.
I’ll show you two methods for determining which subnet a given IP address is on.
First, the longer method and then I’ll show you how to perform this determination in less than a minute.
(You have to know the longer method to make a quicker method work. THAT’s why )
Determine the subnet containing the IP address 10.17.2.14/18
It’s a three step process to determine what subnet this address is on.
- Convert the IP address to a binary string.
- Add up the network and subnet bits ONLY
- Enjoy the sweet taste of victory!
So here I have written out the address we were given and the mask we were given

Adding up the first 18 bits in the binary strings (the bits that are covered by the subnet mask) gives us 10.17.0.0, and that’s our subnet – as long as you include the subnet mask.
Now watch this on your exam because if I were writing the exam question and I asked you which subnet was the correct one, I might put 10.17.0.0 in and not put a mask in… that would be incorrect.
You have to give the subnet mask along with the subnet itself, because if you say 10.17.0.0 you’re not really answering the question.
Both 10.17.0.0 /18 and 10.17.0.0 255.255.192.0 are acceptable ways to express the answer.
Now that you know exactly what’s going on, let me show you a faster way to make this determination.
You don’t even have to convert the entire IP address to find out the subnet!
Just perform the decimal-to-binary conversion until you reach the number of bits indicated by the subnet mask.
Let’s tackle this question using a faster method:
“What subnet contains the IP address 217.17.23.200 /27?”
Convert the first 27 bits of that address to binary and you have your answer”
11011001 00010001 00010111 110xxxxx
Convert that string back to dotted decimal, include the mask and you are done!
The subnet is 217.17.23.192 /27, or 217.17.23.192 255.255.255.224.
If you REALLY want to speed things up and you’re comfortable with the fundamentals we’ve covered so far, use this method:
Convert only the octave where the mask ends.
It makes more sense when you see it, so let’s see it with determining the subnet containing the address 47.54.100.29 /14
That mask ends six bits into the second octet, so those bits are all you need to convert.
Here’s the rule for the other octets:
The octets in front of the octet where the mask ends, they remain the same.
The octets in the back are going to be zeros.
54 = 001101xx (Only need the first six bits)
The result:
47.52.0.0 /14
Or
47.52.0.0 255.252.0.0
Determining A Subnet’s Broadcast Address and Range Of Valid Addresses
In this section you get two important pieces of subnetting information for the low, low cost of one simple conversion!
Let’s start with this question:
“What is the range of valid IP addresses for the subnet 210.46.111.0 /25?“
We begin the process by converting that IP address to a binary string and then identifying the host bits. With a /25 subnet mask, we know the last seven bits are the host bits.

You’re about to determine the broadcast address and the range of valid IP addresses for this subnet. This quick conversion actually give us three vital pieces of info!
- The address with all zeroes for the host bits is the subnet address itself. Sometimes called the “all-zeros address”, this is not a valid host address.
- The address with all ones for host bits is the broadcast address for this subnet. Also known as the “all-ones address”, this is also not a valid host address. The all-zeros and all-ones addresses are the reason we subtract 2 when determining the number of valid hosts on a subnet.
- All addresses between the all-zeros address and the all-ones address are valid host addresses for this subnet.
Now we know that 210.46.111.0 is the subnet number, but what’s the broadcast address?
Just change those host bits to ones and you’ve got it:

Now let’s tackle a question with a smaller subnet mask, resulting in more host bits: “Determine the broadcast address and the range of valid IP addresses for the subnet 150.10.64.0/18.” The conversion, with the host bits in bold:

So we know this is the subnet address (all-zeros address). It’s one of the two invalid addresses we’re going to deal with.
Now what will the address be when all the host bits are set to one?

Well I’ve done that here for you and it’s going to be 150.10.127.255.
The range of valid IP addresses for this subnet is 150.10.64.1 through 150.10.127.254.
Now let’s tie this all together and meet our client’s requirements as we handle the subnetting from the very beginning!
Meeting The Stated Design Requirements
Now we finally get to finally perform the actual subnetting! We’ll use several of the skills we’ve mastered to this point in tackling this real-world scenario.
Our client has come to us with the following requirements:
- Use network 150.50.0.0
- We need at least 200 subnets
- We want 120-150 hosts per subnet.
Now just by looking at that we know immediately that 150.50.0.0 is a Class B network, and
Class B networks have a 255.255.0.0 network mask or /16.
So we have 16 network bits. That leaves 16 host bits, and subnetting is simply the process of borrowing host bits. (you’re always borrowing zeros you never borrow ones.)
So here’s what our mask looks like right now.

And we can proceed from there.
When I’m taking an exam and dealing with a question like this, I like to use marker and board provided and just start doubling the number 1 and keep going until I get to the desired number of subnets (which is a fancy way of saying to start with two and just keep doubling that.)
2 4 8 16 32 64 128 256
So if I need at least 200 subnets I would just take my marker and my board and go 2 4 8 16 32 64 128 256.
So I know that I need eight subnet bits to meet the requirement of at least 200 subnets. That’s the lowest number that’s going to give me that many subsets.

We are not done.
Eight subnet bits gives us 256 valid subnets, but there was one other requirement, and that was that each subnet has between 120 – 150 hosts.
We have eight host bits remaining, making the number of valid hosts (2 to the 8th power) -2 = 254.
That’s too many to meet our requirements, so we need to borrow one more subnet bit.
But the other requirement was at least 200 subnets.
You just want to watch whether we’re being asked for minimums or maximums or both.
So here we were actually given a minimum number of subnets and then a range of host per subnet.
So what we would do in this situation is borrow one more subnet bit and we’re going to end up looking like this

That gives you nine subnet bits.
Number of valid subnets: 2 to the 9th power = 512 to the ninth power 512.
Requirement met.
Number of valid hosts: (2 to the 7th power) – 2 = 126
Requirement met.
The winning mask: 255.255.255.128, also expressed as /25
That’s all there is to it, and on exam day, you won’t have to write all of it out. You’ll be so good at it that you only need to write out the host bits, and then do the subnetting.
So let’s go through one more here:
We’ll use network 220.10.0.0.
The client wants a minimum of 25 subnets.
The client wants no more than six hosts per subnet.
How many host bids do we have to work with here?
Eight!
Because that’s a Class C network
So that’s 24 network bits and 8 host bits.
What’s the minimum number of host bits we need to borrow to have at least 25 subnets and at least 6 hosts per subnet? Just double 2 until you pass 25…
2 4 8 16 32
5… That gives us 5 subnet bits. So that leaves us 3 host bits.
So what exactly does that do for us? And how many hosts per subnet does that leave us?
(2 to the 3rd power) – 2 = 6,
It just meets the requirement.
Here’s where we end up
