[music]
All this time with subnetting,
we've been doing something
called same length subnetting and
there is a problem to
this approach.
The problem is we've been
designing these networks purely
from the perspective of how
many networks do I need?
Creating a subnet mask that's
the same for every single
network based on how many total
quantity of networks I need.
It was not even
a consideration.
We didn't even think about how
many hosts do we need in each
one of those networks.
That would result in a problem.
For example,
take a look at this.
We start here with a single
base network a /24.
That one network gives us the
whole range of host space on
that last octet we've got from
0 to .255 that's the full
range of host addresses.
Now we know that 2 of those we
can't use right the .0
and the .255,
but that circle there
represents the full range of
host space in that last octet.
Now if we used our previous
approach of same length
subnetting, and let's say
we needed 4 networks
like this building
right here needs 4 networks,
well what's the approach we
would have come up with?
Well we would have said,
Okay, if I steal 2 networking
bits, if I steal 2 subnet bits,
there I go.
That will give me
4 subnets right?
So now we got that
circle there.
We divided it into 4 sections.
A pie of 4 equal slices,
and they're all equal because
every single network is going
to have the same subnet mask.
They're all going to be /26,
and with a /26,
what do we know?
Going back to this right here
with the /26,
we know that each one of these
networks is going to have 62
host addresses.
So 64 addresses total - the
network address,
62 host addresses,
and then the broadcast address.
So 64 addresses total.
That's what you see right here,
network 1, 2, 3, and 4,
and they're all equal.
Network 1 starts at the network
address of .0,
broadcast address ends on .63.
Network 2 begins at address 64,
ends at broadcast address .127.
Network 3 begins at network
address 128,
broadcast address .191,
and then the remaining host
space is network number 4.
So we do have our
4 networks,
but we have a problem here.
Check it out.
Network number 2,
it requires more than 62 hosts.
He needs 80 hosts.
80 hosts won't fit into any of
these slices of pie right here.
It's not going to fit.
Not only that,
look at some of these
other networks.
For example,
look at network number 1.
There's only 5 hosts
in that,
and yet we've allocated 62
hosts in that one network.
That's far more host space than
we really need.
We've got a whole bunch of
extra bits that aren't even
being used because this network
is far larger and can support
far more hosts than is
actually needed.
So this is the problem with
same-length subnetting.
We're completely ignoring our
host requirements,
which means we might end up
with subnets that are either
far larger than we actually
need and it's a complete waste
of space,
or just the opposite.
We might come up with subnets
that are too small like these.
None of these subnets here will
fit our requirement for network
number 2.
So this is where we take a
different approach,
something called
variable-length subnet masking.
Now with variable-length
subnet masking,
here's basically what we're
going to do.
Instead of starting with the
position of,
Okay, I need to figure out how
many total networks I need,
and then create one subnet mask
that will come up with that
total quantity of networks.
We're going to do it from a
different approach.
Instead we're going to say,
I'm going to create my subnets
based on how many hosts are
needed in each subnet.
Oh, this subnet's really large.
It needs a lot of hosts.
Okay, that'll have a subnet
mask of maybe a /26.
Oh, and then there's a tiny
little subnet over here that
only needs four hosts.
Don't need a /26 for that one.
Why don't we use a /29
for that one?
And so we're going to create
subnet masks of variable sizes
hence the name variable length
subnet masking.
They're finely tuned or finely
designed based on the host
requirements that each network
actually needs.
So let's do the same
example here.
In this particular case,
based on subnets,
based on host required,
so typically the way you do
this is you start with the
largest network,
the network that's going to
have the biggest
host requirement.
So I say, Okay,
let's see here. 80 hosts.
I need 80 hosts.
Well going back to my chart,
if I need 80 hosts
what's that mean?
That means I'm going to have to
use a /25, doesn't it?
Because a /25 will give me
126 hosts.
Anything else like a /26 or /27
won't support the 80 hosts that
I need.
So for that particular slice
of the pie,
it's going to be pretty big
because it's going to support
126 hosts.
There we go.
That's what I'm going to divvy
up for network number 2, a /25.
So .0 is going to be my
network address,
.127 is going to be my
broadcast address,
and then I'll have 126 hosts in
the middle for use.
I'll use 80 of them and that
gives me a little bit for
future expansion.
Now we go to the next one.
We say, Okay,
what's the next largest one?
22 hosts, okay,
let's go back to here again.
22 hosts, well,
it looks like according to this
to get 22 hosts,
I would need a /27.
That'll get me up to 30 hosts.
All right,
so my next network is going to
be a /27.
Not quite as large of a pie
I should say the piece of the pie
is not as large as the
other one.
With /27 so notice here.
In my first network,
I already used up all the
addresses from .0 to .127.
Those were used up in the
first subnet.
I know that the next subnet,
regardless of how big it's
going to be,
even before I look at the
next subnet,
what do I know about it.
I know it's going to start with
.128 because that's the next
available address.
The previous one ended on .127
so the next one is going to
start on .128.
I already know my starting
network number is going to be
199.199.199.128.
The only thing I need to figure
out is,
what's the subnet mask going to
be for that?
Well, I just did that.
I said, Well,
based on 22 hosts the subnet
mask needs to be a /27.
With the /27 we saw that gives
me a total of 32 addresses.
30 host addresses plus the
network plus the broadcast
gives me 32 addresses.
So I take my starting network
of 128 and say,
Okay, let's see.
What's 128 plus 32?
Oh, that's 160,
so that's my next network.
So I know now that network
number 3 is going to be the
128 network.
His broadcast address
will be 159,
and then the next network
available will be .160.
I'll say, Okay, let's see here.
The next largest one is network
number 4,
so apparently network number 4
is going to be 199.199.199.160.
That's where it's going
to start.
So we rinse and repeat.
So the question now is,
Okay, how big of a slice of the
pie does that network need?
What kind of subnet mask do I
need for that?
Well, 12 hosts.
Let's see here.
If I go back,
12 hosts that means I
need a /28.
/28 will give me 14 hosts.
So with a /28 I have a total of
16 host combinations.
Right I got the
network address,
14 hosts available,
and the broadcast address which
gives me 16.
My networks are in increments
of 16.
So if I take 160 plus 16 that
gives me 176.
That will be my next and in
this case final network.
So my last network which is--
notice what I was doing here.
I started with the
largest network,
figured out the appropriate
subnet mask for that network,
figured out where that network
ended, and then I said,
Okay, now I know the next
available address will start my
next network, and then I
repeated the process,
and I went from the largest all
the way down to smallest so in
this particular case Network 1
is the smallest.
That I could get by with a
/29 mask.
/29's are always in multiples
or increments of 8's.
All right,
if we go back to this /29's
always in increments of 8's.
If it started at .176,
176 plus 8 is .184 so that's
where that little slice is
going to fit for Network 1 and
now I've got all this space
here from .184 to .255 as all
unused space for
future expansion.
I could have more networks in
the future if my
building grows.
So with same length subnet
masking all we cared about was
the quantity of networks that
we needed.
Therefore, each resulting subnet
had the exact same subnet mask.
But that was very risky.
Some of those subnets might not
be big enough for our really
big networks.
With variable-length
subnet masking,
we're creating each subnet to
be finally tailored to the host
requirements of that
particular network.
Actually, before we talk about
Classless Inter-Domain Routing,
let's just do one more example
of VLSM before I throw a couple
of quiz slides at you.
Okay, so let's say that
we had this.
Your starting network
We'll make it easy,
something that falls on a nice,
even bit boundary - 200.200.200.0
Here is what you need to
create subnets.
Let's say we've
got engineering.
Let's not give names to them.
Let's just say Network 1 which
is going to require 70 hosts.
Network 2 which is real tiny
that only needs 2 hosts.
Network 3 which is going to
require about 16 hosts,
and Network 4 which is going to
require 49 hosts.
Okay, so how do we use variable
length Subnet masking?
Like I said,
we start with our largest
network, our biggest one.
So that will clearly be Network
number 1,
and using our subnet
cheat sheet,
what kind of subnet mask do we
need to give us at least
70 hosts?
Well, we need a /25,
for the /25 that will give us
126 hosts.
If we go any bigger than that,
if we do a /26,
it's not a big enough slice of
the pie,
/26 only gives us 62 hosts,
and we need 70,
so we got you a /25.
Okay? So we start with
200.200.200.0
but now it's going to be a /25,
and we say, Okay,
when our networks are in
multiples of /25s--
I should say,
when the subnet mask is a /25,
let me rewrite this here,
what increment or multiple are
the networks?
/25s are always
in multiples of 128.
So if I add 128 to this,
that will give me my
next network.
So let's see what's the
next one.
Oh, that's 49.
Remember, I'm going from
largest to smallest,
so 200.200.200.128 because I
said that was my next available
network address.
Okay, but this network here
doesn't necessarily need a /25.
That's the subnet mask that was
appropriate for this
size network.
What subnet mask do we need
that's appropriate for
49 hosts?
Let's go back.
49 hosts.
With 49 hosts,
we would need a /26.
That will support up to 62
hosts with a /26.
So we put that down here.
That's our new subnet mask for
this particular slice
of the pie.
And now we ask ourselves: okay,
in /26s, are networks--
are sub networks are always in
multiples or increments
of what?
They're always an increments or
multiples of 64.
So I take my existing network
and I add 64 to it.
120 plus 64 is what? 192.
That's going to be my next
available network - 200.200.200.192
Once again,
don't worry about your existing
subnet masks.
Now we need to come up with a
subnet mask that's appropriate
for this network,
16 hosts.
Well, to support 16 hosts,
I need a /27,
that will give me up to
30 hosts.
I could almost do a /28,
but /28 wasn't quite
big enough.
It was two hosts shy so I need
to go with a /27.
So it's /27.
And with /27s,
my subnets are always in
increments of 32.
They're always in multiples
of 32.
So I take the number 32 and I
add it to my existing
network number.
What's 192 plus 32?
That is 224,
which gives me my last network.
And finally,
what subnet mask is appropriate
to support two hosts?
That fits just perfectly with a
/30.
/30 supports two hosts.
And that, my friends,
is variable-length
subnet masking.
Before I show a couple more
quiz questions to you,
what questions do you have?
All right,
let's give you an opportunity
to practice this.
I know I'm skipping the slide
on classless
interdomain routing.
I will come back to that.
I just want to give you a
chance right now to practice
variable length subnet masking.
Starting with the base network
that you see right there,
use VLSM to divide the single
network into multiple
subnetworks appropriate to fit
the requirement shown below.
Just like it did on
the whiteboard.
So I will give you one minute
to work on this.
Okay, let's work through
this one.
First thing was hopefully you
reorder them by
largest network.
I should say largest host
requirement to smallest
host requirement.
So from what we saw before,
the biggest network was network
number 3,
marketing with 100 hosts,
so we start with that one,
and we needed a /25 subnet mask
to support up to 100 hosts,
/25 is always in increments or
multiples of 128.
So our next network was 128 so
that's what we moved down to
the next one,
the next largest network which
was 49 hosts.
That requires a subnet mask
of /26.
/26s are always in increments
or multiples of 64.
So we take a 192 plus 64,
and that gives us our next
available network.
I'm sorry, 128 plus 64.
So we take our existing network
of 128, add 64 to it,
and our next available network
was 192.
And so that's where we put on
network number 4.
With 19 hosts,
we use a /27 subnet mask.
/27s are always in increments
of 32.
So we take 192 plus 32.
That gives us 224,
and that gives us our
final network.
And let's do one more of these.
Same thing.
There is your starting network,
there are your
host requirements,
so I'll give you one minute to
work through this question.
All right.
Time's up for this one.
And here are the answers.
So we start with our largest
network here which was the one
requiring 220 hosts.
For that, we actually need a
/24 which supports up to
254 hosts.
So that consumed all of
140.140.0 so 140.140.1 would be
our next network so that's
where we put on network number
3 with 45 hosts.
A /26 is an appropriate subnet
mask to support 45 hosts.
Our networks are always going
to be in multiples or increments
of 64 with a /26.
So we take our existing network
of 1.0, we add 64 to it,
and that gives us 1.64.
That's what we place on our
next smallest network.
Only 6 hosts,
that means we can get away with
a subnet mask of /29.
/29s are always in multiples of
8s, so 64 plus 8 is 72,
which goes on our
final network,
which gives a subnet mask of
/30 based on its
host requirements.
Okay. Let's go back to that one
slide I skipped so that you
understand what that concept is
of classless
interdomain routing.
What's that talking about?
Classless interdomain routing
is just basically a fancy way
of saying that this whole idea
of classes A, B, and C
is now irrelevant.
And what do I mean by that?
Well, if you had TCP/IP
software running on your laptop
or your PC that follow the
classful rules,
it might still let you
do subnetting. Right?
If I start with a
Class B address,
I could put in a subnet mask
that instead of a /16,
which is the classful mask,
it might allow me to put in a
subnet mask of /17, /18,
/30 whatever,
as long as I didn't go less
than /16.
With classless
interdomain routing,
the means the whole idea of
classes is completely gone.
That means you can apply any
subnet mask you want to
any address.
For example,
and you bring up one
right here.
So right now I'm logged in--
this is actually a router.
It's not a host.
But I can go into his interface
and I can say IP address--
let's give him a
Class B address.
Anything that's 128 or greater.
Let's say 130.
Now look at this.
If this was a classful system,
it wouldn't let me do that
because 255.248,
what is that telling
the system?
That's saying,
Okay, of that address I just
gave you,
the first 8 bits - so the
whole number of 130 - is
networking bits,
and of the second byte,
5 of those bits are
networking bits.
So it's basically saying,
Of that number,
13 of the bits,
if I did that right.
8 plus 5.
9, 10, 11, 12, 13. Yeah.
13 bits are networking bits.
If this was a
classful-based system,
it'd say, No, no, no,
you can't do that.
130 falls in the Class B space.
This number,
at least 16 bits have to be
the networking.
You can give me more but at
least 16 of the bits have to be
networking because this is
Class B.
But because this is a classless
interdomain routing device--
I guess it would help if I
actually did it on
an interface.
It takes it.
No problem.
He says, Look,
you can give me any 32-bit
IP address.
I don't care.
As long as you tell me where
the dividing line is between
network and host.
As a matter of fact,
I could do something
real crazy.
Look at this.
IP address.
Let's give him the
same address,
and what if I say--
look at that.
What's that telling him?
That's saying, Oh,
that address that you have,
only the first 2 bits
represent your group.
Everybody in your group has an
address beginning with 10
because if I break 130 down,
it starts with a 120 bit on,
the 64 bit off, 10,
and the subnet mask is saying,
That's all you care about.
Your group is 10 anything.
This is classless
interdomain routing,
where the whole idea of A, B,
or C is completely thrown out
the window.
The subnet mask is in charge of
dictating where the dividing
line is in these bits between
network and host.
[music]