- [Narrator] Let's take a look at an example
using those blocks sizes we just discussed.
If I have a class C here, 192.168.10 is my
class C network address, I'm going to
start subnetting in the fourth octet.
My first subnet is 128, really my binary which
is important but I only have one bit on at an eight.
And the fact is that, that value is 128.
255.255.255.128.
So I take 256 minus 128, it gives me a block size of 128.
I count in increments of that block size starting at zero.
Remember where the IP subnet zero.
Zero and zero plus 128 is 128.
128 plus 128, so I just keep counting in
that increment, it actually equals 256 which I
can't use that subnet obviously.
So this is my subnet, my first one is zero.
My next subnet is 128.
And if we look, I have one subnet bit,
and two to one equals two subnets.
I have seven host bits left, so two to the
seventh is 128 minus two because for the
network and broadcast address which I can't
use gives me 126 host, two subnets, 126 host.
Now, how do I get my broadcast address
and why is that important?
Because once I get my broadcast address,
I can find my valid host range.
It's always the numbers in between.
Finding the zero subnet, the next subnet is 128.
The number right before that is 127
which is the broadcast of the zero subnet.
My valid host numbers are the numbers
in between, or one through 126.
The next subnet in this example is 128 with the
next incremental block size being 256.
The number right before that is 255
so that becomes my broadcast address.
My valid hosts are 129 to 254.
Now before we look at another example,
what would I do with these subnets?
This is a really great question.
The answer is shown in this graphic.
We're going to implement it.
Notice that I have a router with two interfaces,
I have two subnets, and notice I put the
192.168.10 subnet here by assigning a valid host range.
Remember, our host range is one to 126.
So I just designed the first
host range on the router interface.
Instead it said, "Oh, I can subnet really fast."
I'm directly connected, that's what the C is.
The show ip route shows me my routing table.
Directly connected, 10.0 is off of Ethernet zero.
Now on this one, I put the first range of the
second subnet, 129 to 254, the first host in the range,
and this is the 192.168.10.128.
It says, "Oh, I know that."
You put 129 with a slash 25 by the way,
and I know I have one to 128 subnet on E1.
In this example, I'm going to use the
192.168.10 network and with a mask of 255.255.255.192
which is also a slash 26.
This gives me two subnet bits with six host bits.
That gives me four subnets each with 62 hosts.
256 minus 192 equals 64, which is my block size.
So, I just counted 64 starting at zero to get my
subnets which should equal four subnets.
Zero, 64, 128, 192, 256.
Obviously I can't use 256 so I did find my four subnets.
If I'm in the zero subnet, the next subnet is 64
so my broadcast routers in the zero subnet is 63.
My valid hosts are between the network address
and broadcast address, so in this example one through 62.
My next subnet is 64, the subnet following that is 128,
and the number right before that is 127.
My valid hosts are 65 through 126.
My next increment of 64 is 128,
and after that is 192, so my broadcast address becomes
191 with a valid host range of 129 to 190.
My last subnet is 192 with the next increment of
64 being 286, which makes my broadcast address the
number right before that, or 285.
Valid host range 193 to 254.
Lastly, what would we do with this?
Well, the same thing as last time.
We're going to add them to router interfaces.
Looking at this graphic, we can see I only used
three subnets here, I don't have to use them all.
I started at zero, I used 64, 128.
It didn't matter what subnets I used.
I could've started at the 192 subnet.
But notice I put .1 on this first interface here
which put me in the 192.168.10.0 subnet,
and we can see that in the routing
table that's directly connected.
I then add a .65 with a slash 26.
Make sure you understand I put in the
correct subnet mask when I typed these in.
192.168.10.65 was my host ID which said,
"Oh okay, I understand you're in the 64 subnet."
And lastly, I did the 192.168.10 and 129,
with the correct subnet mask and this put me
into the 192.168.10.128 subnet.
So whether you're doing class A, B, or C,
it's all done the same way.
You're just doing it in a different octet.