welcome back, my name is David Bombal CCIE 1123
and in this section, we're going to look at Variable Length Subnet Mask or VLSM
and route summarization.
VLSM allows us to better use IP addresses
by allowing for Variable Length Subnet Mask on a single network.
so what we're going to cover in this section is firstly VLSM
once again Variable Length Subnet Mask, we're going to look at CIDR
or classless Inter-Domain Routing
I want to explain summarization and show you
how you can summarize multiple routes into fewer or single a route.
we're going to look at routing choices
and how routers choose one route over another
not just based on administrative distance
but also based on the legnth of the prefix match
and then lastly we're going to look at issues regarding discontiguous networks.
so Variable Length Subnet Mask
allow us to have varying or variable mask throughout our network
so for example, a classful network of 10
will have a mask of /8 with the first octet
10 is the network portion of the address
and the last 3 octets, in other words, the last 24 bits
is the host portion of the address.
that classful network was subnetted
we could, for instance, have a subnet of 10.1.1.0/24
where 10.1.1 is the network portion of the address
in other words, the most siginificant 24 bits
or most significant 3 octets is the netwok portion and the last octet
or least significant portion of the address is the host portion.
we could also subnet a 10 network down to 10.1.0.0/16
where half of the address is the network portion
and half of the address is the host portion.
please refer to the ICND 1 part of this course
or my subnetting explained e-book, for lots of detail on subnetting.
CIDR or Classless Inter-Domain Routing was introduced in 1993
to replace the prior addressing architecture of classful networks.
classful networks were not scalable
classful networking introduce 3 classes of addresses
for allocation of IP addresses to hosts and networking devices
we had A B and C networks.
so for instance 10.0.0.0/8 is an example of a classful A network.
172.16.0.0/16 is an example of a class B network
and 192.168.1.0/24 is an example of a class C network.
the problem with this method is that you were forced to use
for instances a /16 mask which gave you approximately 65000 host addresses
or you could use a class C address like this
which only gave you 254 host addresses.
this scheme would have resulted
in the quick extortion of IP addresses and inflexibility.
so CIDR replaced this which is based on Variable Length Subnet Mask
were masks can vary on arbitrary lengths
so they allow for different size subnets
so rather than being forced to use for instance 10.0.0.0/8
you can also use 10.0.0.0/16 or 24 or 30 depending on the requirements
for the number of subnets or hosts in your network
or you can use for instance 10.1.1.0/27 or 10.1.2.0/26 and so forth and so on.
so you could take a single class A address
and subdivide it into multiple subnets based on your requirements.
it's also important to note that in CIDR
we don't just advertise a network, we advertise a routing prefix
in other words, we would advertise 192.168.1.0/24 not just 192.168.1.0
CIDR also allows for the summarization of addresses
which I'm going to explain in more detail in a moment.
but this is were we take multiple subnets
and put them into a super net or summary network
which will reduce routing table sizes.
Variable Length Subnet Mask have many advantages
including the better utilization of IP addresses and subnets.
on a WAN link as an example only 2 IP addresses are required.
1 IP address for 1 end of the link
and another IP address for the other end of the link
thus a /30 mask would be better in say a /16 or /24 mask.
a /30 mask only support 2 hosts on that subnet
and thats all that's required in the point-to-point scenario like this.
a /24 mask for instance would support 254 hosts
and that would be over kill on this specific link.
so VLSM gives assist the administrator
the ability to better utilize IP addresses and subnets.
where we subnet down subnets
to support the required number of IP addresses on that specific segment.
so as an example, here we have subnets
that are using a /27 mask, on the WAN links we are using /30 mask
and for the instance at the headquarters we are using a /16 mask.
it also allows us to implement better summarization
and scalability of networks as rather than the entire world
being forced to use a specific subnet mask
we are able to use varying mask in our own networks
and advertise summaries to other companies or to the Internet.
so heres a simple network to explain the problem
when summarization is not used.
on the left hand side we have networks 10.1.1.0/24
up to 10.1.2.200.0/24
on the right hand side we have networks 10.2.1.0/24
up to 10.2.200.0/24 now summarization is now implemented
and let's say you're running a routeing protocol like RIP
which advertises the entire routing table every 30 seconds
you're going to have scenario like this
with the router on the left-hand side
advertises 200 routes every 30 seconds and the router on the router side
also advertises 200 routes every 30 seconds.
RIP will continually sends out its entire routing table
every 30 seconds even though there are no changes.
so 400 routes are advertised across this WAN link
which is very inefficient, those routing updates
consume a lot of bandwidth and don’t accomplish much
because they will continuously be advertise
even though there are no changes
so it makes more sense to summarize the routes
so on the left-hand side, we have 10.1.1.0
all the way up to 10.1.200.0
So these are subnets of the 10.1.0.0 network
so we could summarize those 200 routes into a single route
and on the left hand side 10.2.1.0 up to 10.2.200.0
could be summarize as 10.2.0.0/16
so rather than advertising 400 routes a single route from the left-hand side
is advertised to the left-hand side.
and a single route from right-hand side is advertised to the left-hand side
With summarization what we are have looking for
is most significant bits that are equal, in other words
starting from the left-and side and working towards the right-hand side
we look for bits that are the same
so in the first octet all the subnets contain 10
so that’s common, in the second octet all the subnets contain 1
so that's common but in the 3rd octet the values vary from 1 - 200
so it’s not as easy to see what’s in common
so we could just summarize it as 10.1.0.00/16
knowing that 10.1 is common throughout
and the router over here will summarize all of those routes
and only send out 1 advertisement
the router on the left-hand side can still get to all of this subnets
because they are subnets of this network
so even though we've summarized routes
we still have full connectivity throughout the network
here’s some more complicated example
assume that we have networks 172.16.32.0/24
all the way up to 172.16.63.0/24
now rather than this router advertising all of those networks
can we summarize this network into 1 or at least a few summaries
now to work this out you start from the most significant bits
in other words, you start from the left-hand side
and you look for what is common throughout all of this networks
so in the first octet 172 is common, so we know that’s common
16 is also common, so we know does far that the 1st 2 octets are common
in the third octet, however, the numbers are changing
so we have 32, 33, 34, 35, all the way up to 63
so it's not as easy to visualize or see what’s common here
so what we're going to do is we can convert the third octet
into binary to look for common bits, so for example 32 = 0010 0000
now obviously there’s no gap halfway through an octet
I’ve just put the space here to try and make it easier to read
so an octet consists of 8 binary values, 32 would look at follows
now as soon as you convert into binary
you should convert the remaining bits into binary as well
now in this example, you don’t need to do that
because you can see that the last octet contains just a 0
but I’ve done it here for completeness, the second network is 172.16.33.0
and 33 in binary looks as follows, 34 looks as follows, 35 looks as follows
and I wouldn’t recommend that you convert all the addresses into binary
I would just do say the first 3 or 4
and then the last one to see what’s in common.
in the real world, however, you may come across far more complicated examples
and you may need to convert all the addresses into binary
but at the CCNA level that may not be necessary.
So once we’ve done that we can look for bits that are in common
so the first binary 0 in the 3rd octet is common throughout
the second binary 0 is also common throughout, the 3rd binary bit is a 1
and that is common throughout, however, in the 4th binary bit position
the values change as you can see here the first few networks have 0's
but the last network has a 1 in the fourth binary bit position
so we can draw a line to the right of all the bits that are common
so as you can see here to the left of the line in the 3rd octet
we have 001 in binary
the remaining bits in binary are not common in other words bits vary.
Now Cisco does not support discontiguous subnet masks
so you can see these bits are not in common and these this bits are in common
there has to be a contiguous grouping of common bits
starting from the left-hand side moving from the right-hand side
and as soon as there are bits that are not common
you have to draw a line to make a differentiation between common bits
and bits that are not common
so we know now that the first octet is common, the second octet is common
so 172.16 in the third octet, the first 3 binary bits are common
so 001 now any bits that are not in common are just set to 0
so notice, we’ve populate the remaining portion of the address with binary 0's
and then we convert the binary back to decimal
so hopefully remember this from the ICND 1 course.
So the first octet is 172, the second octet is 16
the third octet if you convert this to decimal is equal to 32
and the last octet converted to decimal is 0.
So the summary address is 172.16.32.0
The last step is to work out the bits that are in common
now the first octet is in common and an octet is 8 bits
the second octet is in common and that’s an additional 8 bits
so thus far we have 8 bits + 8 bits in other words, 16 bits that are in common
3 bits in the third octet are in common, so 8+8+3 will give you 19 bits in common
thus the summary address for this subnets will be 172.16.32.0/19
it’s a simple as that to work out summarization
and I’m going to show you trick in a moment
that allows you to work this out in the few seconds
here’s another example, we have subnets 172.16.64.0/24 up to 172.16.127.0/24
can these subnets be summarized into a single subnet or fewer subnets?
so using the same process we start from the left-hand side
and we look for bits that are in common
in the first octet, we have 172 throughout all of those subnets
so that’s common, in the second octet we have 16
so that’s common throughout
So we know that the first 2 octets 172.16 are common throughout
but in the third octet the values are changing
we’ve got 64, 65, 66, 67 all the way up to 127
so that third octet we're going to convert to binary
to be able to better see what’s in common
so converting 64 into binary will give you 00100 0000
65 will look as follows, 66 as this, 67 as that
and you could convert a third octet of all of the subnets until you get a 127
which looks as follows
the last octet is a 0 in decimal which looks as follows in binary
so now what we need to do is we need to look for the common bits
so the common bits are once again 172.16
and then the first binary 0 is in common throughout the subnets
the second binary bit which is set to 1 is common throughout
but the third binary bit is not common throughout notice there’s 0
and then here there’s a binary 1
so we can draw a line after the second binary bit
to denote that everything to the left of the line is in common
and everything to the right of the line is not in common
so all of this is in common and all of this is not in common.
therefore 172.16 in decimal, the first 2 octets are in common
and the first 2 binary bits of the third octet are in common
the remaining binary bits need to be set to 0's
so filling the remaining binary bits is to 0 will look as follows
and then converting the binary back to decimal
will get 172 in the first octet, 16 in the second octet
this is 64 in decimal, so the third octet is 64
and the last octet binary 0's is equal to 0 in decimal
so the address is 172.16.64.0 that is the summary network for all of these subnets.
the last step is to count the number of bits in common
the first octet is 8 bits, the second octet is 8 bits
so that’s 16 bits in total followed by another 2 binary bits
which gives you 18 bits in common
so the first 18 bits are in common throughout all of this subnets
so our final answer will be 172.16.64.0/18
that is the summary network for all of the listed subnets.