- Now that we know what subnets are,
let's go ahead and take a look at some specific subnets
and learning how to subnet.
First let's talk about subnet mask.
For the subnet address scheme to work,
every machine on the network must know
which part of the host address we used
as the subnet address.
This condition is met by assigning a subnet mask
to each machine.
As shown in the graphic, a subnet mask is a 32 bit value
that allows the device that's receiving the IP packet
to distinguish the network ID portion of the IP address
from the host ID portion of the IP address.
So if we look at a Class A default,
we're saying the first bite represents the networks.
The last three bites, or 24 bits, represents the host.
In a Class B default mask, the first two bites
represent the networks or network
and the last two bites represent the host.
And at Class C, as we know, the first three bites
represent the network and the last bite represents the host.
Now, why is this important?
Because where do I start subnetting?
Where do I take bits from to create a subnet mask
to give us subnets or smaller networks?
And the answer is, the first bit of the host bits.
So for Class A, it would be there.
That would be my first subnet bit.
In a Class B, it would be here.
And in the Class C, it would be in the first bit
of the last bite, which is the easiest thing to do.
There's another term, Classless Internet Domain Routing
and you must understand this and basically it's very simple.
What this is saying is how many bits out of a 32 bit mask
are turned on?
In this case here, I have 255.0.0.0.
Eight bits are turned on, so it's a slash eight.
Now I'm not showing all of them here,
just giving you some examples.
255 is eight bits plus 255 is eight bits,
so this is a slash 16.
255.255.255, eight, 16, 24!
Now check this out.
Eight, 16, 24, and one bit equals to slash 25.
Eight, 16, 24, plus two bits equals to slash 26.
So then, for example, if I turn three bits on
in the fourth octet, this is slash 27.
Four bits on in the fourth octet in this example, slash 28.
Five bits on, slash 29.
And lastly, my largest masking half,
six bits on in the last octet slash 30.
Now is this a Class A, B, or C mask?
The answer is yes, all of the above.
I could use these, well I can't use some of these masks
for Class C, I can only use Class A, A and B,
and then I can start my A, B, and C here all the way down.
Now it's important to understand some binary in this,
this isn't a binary class now,
but we need to understand if we're looking at the bite
that's providing subnetting that the numbers don't change
because we can't skip bits.
We can't.
So this makes it so our answers can never change.
So, for example, if the octet that I'm using
for subnetting has no bits on,
my decimal equivalent is zero.
If I have one bit on, our binary bit is a value of 128.
128 plus 64 equals 192.
128, 64 is 192 plus 32 equals 224.
These are what my subnet masks look like
and this is how you get the answer,
and one of the things I want you to realize is
there's a pattern here because we can't skip bits.
So four bits on is 240.
Five bits on, 248.
Six bits on, 252, and if we are using Class A or B,
we could use these masks but not with C
because I don't have two host bits,
so this would be seven bits on, and eight bits on is 255.
One last thing I want you to remember
is to understand how to get your block size.
Zero to 255 is 256 numbers, so we take 256 minus the mass
and this gives us our block size.
So 128 mask, 256 minus 128 is 128.
256 minus 192 equals a block size of 64.
We'll get into what this all means in a minute,
just memorize these for now.
256 minus 224 is 32.
256 minus 240 equals 16.
256 minus the 248 mask equals eight.
256 minus 252 equals four.
This is all I need you to remember for now
because as we get into Class C which we're about to do,
you have to know these block sizes.
And one last thing in this section,
understand that we can start our subnets at zero.
We didn't used to be able to start at zero
until maybe late 90s and then Cisco started
putting the CCA in the mid-2000s actually,
but if we take a look at this configuration here,
I did a showrun or showrunning config on a router
and this gave me the active configuration file.
This tells me a couple things, not relevant to subnetting,
but how large my file is and even the iOS version
that I'm running.
This is my active configuration file,
but what I want to make sure that you understand here
is the IP subnet zero command is enabled by default
which allows me to use the zero subnet.