So far, I've only created subnets
on my network that are of equal size.
This is great in theory but in practice,
it causes great waste by leaving IP addresses unused.
To minimize this waste, I can use subnet masks
of different lengths in various kinds of network designs.
This is called a Variable Length Subnet Mask, or VLSM.
By using VLSM, we can apply an IP Mask
to a router interface using just the right amount
of host bits, which provides connectivity
for all the attached LAN hosts
without having a bunch of wasted
IP addresses we're not using.
Older routing protocols like RIPv1
don't have a field for subnet information,
so the subnet information gets dropped.
This means that if a router running RIP has a
subnet mask of a certain value,
it assumes that all interfaces within
the classful address space have the same subnet mask.
This is called classful routing,
and RIP is considered a classful routing protocol.
On the other hand, classless routing protocols
support the advertisement of subnet information,
which means you can use VLSM with routing protocols
such as RIPv2, EIGRP and OSPF.
This saves a bunch of IP address space.
As the name suggests, VLSMs can use subnet masks
with different lengths for different router interfaces.
Here is a great example of why
classful network designs are inefficient.
You can see that there are two routers,
each with two LANs and they're connected together
with a WAN serial link.
In a typical classful network design
that's running RIP, your subnet address
could be 192.168.10.0 with a subnet mask
of 255.255.255.240 or /28.
Our subnets would be zero, 16, 32 and so on
which allows us to assign 16 subnets
to our inner network.
But as you know by now, each subnet provides only 14 hosts.
Don't forget that the router interface
needs an address too, and is included in the amount
of needed valid hosts.
This means that one subnet doesn't even have
enough addresses for all the hosts.
Since the point-to-point WAN link also has
14 valid hosts, it would be great to be able to
nick a few valid hosts from that WAN link
to give to our LANs.
All hosts and router interfaces have the same subnet mask,
again, known as classful routing, and if we want
this network to be efficient,
we would definitely need to add different masks
to each router interface.
But that's not our only problem.
The link between the two routers
will never use more than two valid hosts.
This wastes valuable IP address space,
and it's the big reason you need to learn
about VLSM Network Design.