So I want to teach you a trick
now this doesn’t always apply, it only works in certain situations
but it saves you a lot of a time
if you remember back to your Binary, this bit is 128
this bit is 64, this is 32, this is 16
this is 8, this is 4, this is 2 and that is 1
so 255 in decimal and an IP address would be an octet populated with binary 1's
please refer back to the ICND 1 course if you can’t remember binary
but hopefully, at the point, you're fairly comfortable with it.
If you were given subnets where for instance
the third octet was in the range 4 to 7
in other words, from 4 to 1 less than 8 so 7
you could summarize that automatically as 4
so for example, let’s say you’re given 172.16.4.0/24 up to 172.16.7.0/24
so notice in the third octet the range is from 4 to 7
so in other words, from 4 to 1 less than 8
you could immediately write the answer as 172.16.4.0
now to work out the subnet mask you just remember that the first octet is 8 bits
the second octet is 8 bits and that’s 16
and then you need to work out where binary value of 4 is
so let's count 1 2 3 4 5 6, so it’s in binary bits 6
so 8 + 8 = 16 + 6 binary bits which we’ve not counted to see where 4 is
gives you 22, so the mask would be 22 8 + 8 + 6
and it’s a simple as that
to work out the answers to a question likes this
by the same token if you were given an example
where the values was from 8 to 15
in other words 8 to 1 less than 16
you could summarize that immediately as 8.
So let’s say for example it was 10.8.0.0/16 up to 10.15.0.0/16
in other words, from 8 to 1 less than 16
you could summarize it automatically as 10.8.0.0
so in other words, were saying if it's from this binary value 8
up to 1 less than the next binary value
you just summarize it down to this binary value of 8
finally, to work out the subnet mask you need to remember
that the first octet is 8 bits and then work out where 8 is
so 8 is 1 2 3 4 5
so 8 + 5 will give you 13
8 binary bits + 5 binary bits gives you 13
so the mask is 13, by the same token 16 to 31
so 1 less than 32 can be summarized to 16
32 to 63 in other words, 1 less than 64
so 32 to 63 can be summarize to 32
64 to 1 less than 128 in other words 127
so 64 to 127 can be summarize as 64
now I’ve already shown you those examples by working it out in binary
just to remind you 64 up to 127
we work out in binary and work out the answer as 172.16.64.0
so once again, 64 to 127 can be summarized as 64
and then you count the number of common bits
so 8 + 8 + 2 because 64 is in the second binary bit position
giving you a total of 18
so, therefore, you can work out this answer
in a matter of seconds rather than minutes
this example with 172.16.32.0 up to 172.16.63.0
can quickly and easily be summarized as 172.16.32.0
19 bits are in common and the way we work that out
is 8 bits in the first octet + 8 bits in the second octet
is 16 + 32 is in the third binary bit position
so 3 bits gives you a total of 19
so I’m hoping this trick will save you quite a bit of time
when working out summarization please be careful though
if you are given an example of let say 16 to 35
you're going to have to split up your summary
the 16 to 31 subnets can easily summarize very quickly
but if the question asks you to summarize subnets
that go across this bit boundaries
then you would have to work it out in binary
but this will hopefully save you a bit of time
also be careful if you're given an example
where you're asked to summarize from 16 to let say 19
and you use this example that I’ve explain
you’ll be summarizing more than just those subnets
so it will be better, in that case, to do it in binary
So what are the advantages of VLSM and summarization?
We get more efficient use of the IP address space
so rather than for instance having to use a /24 mask
on a serial link which consumes 254 host addresses
we can use a /30 mask which only needs to, there are fewer updates
because we can hide network changes
or topology changes by sending a summary root
rather than individual networks or subnets to other devices
it also allows us to implement hierarchical levels
for better route summarization, so in the real world VLSM and route summarization
are used very heavily to conserve IP addresses and reduce routing table sizes
so here’s an example of address hiding and topology change hiding
the router on the right-hand side only receives 1 route
from the route from the left-hand side 10.1.0.0/16
so if a more specific subnet like 10.1.12.0/24 went down
the router on the right-hand side is oblivious to that fact
because it only has 10.1.0.0/16 in its routing table
and that’s all that's been advertised to it that route state has not changed
and thus the router on the right-hand side
does not have to reprocess or re-compute its routing table
it is oblivious to the fact that this subnet 10.1.12.0 has gone down
because all it sees is the super net or summary of 10.1.0.0/16
thus there are major advantages to implementing summarization
including topology change hiding
however, it’s important that you realize that there’s a difference
between what are called classful routing protocols
and classles routing protocols
classful routing protocols do not include the subnet mask
when advertising the network, that means other devices do not know
what subnet mask is being used
so router assumes and we all know how bad it is to assume
but they assume that within the same network
there is consistency of the subnet mask
in other words, everyone within the same network
is using the same subnet mask as everyone else
so in other words, when a router's received on an interface
the subnet mask for the received route is implied
by the subnet mask on the local interface
as the router does not know what subnet mask was used by the other routers
so it assumes that they are using the same subnet mask as itself.
routes will automatically be summarized when going across a classful boundary
so summary routes are exchanged when crossing a classful boundary
in other words, as an example when going from a 10 network
to a 192.168 network or from 10 to 11 and so forth and so on
examples of classful routing protocols
includes RIP version 1 and IGRP
IGRP is no longer supported on the Cisco IOS
and RIP version 1 shouldn’t be used in today’s networks
but just for completeness, it's mentioned here.
Classless routing protocols do include the subnet mask
with the network in routing advertisements
in other words, classless routing protocols advertise
not just the network like 10.1.1.0 but also the associated mask like /24
because the subnet mask is included in the routing updates
classless routing protocols support Variable Length Subnet Mask or VLSM
summary routes can be manually configured
so unlike in classful routing protocols
where automatic summarization takes place across classful boundaries
in classless routing protocols summarization in some cases, for example
with EIGRP can be configured on any interface anywhere in the network
examples of classless routing protocols include
RIP version 2, EIGRP, OSPF and ISIS
in this course, we'll concentrate mainly on RIP v2, EIGRP and OSPF
but just be aware that there are other routing protocols out there
be careful EIGRP and RIP v2 act as classful routing protocols by default
you need to use the command no auto summary within the routing process
to disable this default behavior
so that they act like a classless routing protocol.
So let’s look at some of the issues regarding discontiguous networks
or discontiguous subnets, the router on the left
has a network of 10.1.1.0/24 connected to it
this if you remember is a class A subnet, the router on the right
has a subnet of 10.1.2.0/24 connected to it also a class A subnet
they are both connected to the router at the top
with class C addresses of 192.168.1.0 and 192.168.2.0
so please note we are going from a class A, to class C, to class A subnet
when traversing these routers
the problem here is classful routing protocols like RIP v1 and IGRP
will automatically summarize this subnets their classful network
so 10.1.2.0 Will automatically be summarize as 10.0.0.0
the same will take place here, on this router 10.1.1.0
will automatically be summarize to 10.0.0.0
this causes an issue for the router in the middle
because when it wants to go to 10.1.1.0
it believes it can send traffic to the left, as well as to the right
because it's receiving the same route from multiple routers
If this router was pinging a device over here 10.1.1
it would only be a 50% success rate because half of the packets
will be sent to this network on the right-hand side
be careful of routing protocols like EIGRP and RIP v2
even though they are classless they act as classful
and thus have the same issue, where they automatically summarize
a classful boundaries, don't forget to use the command
no auto summary under the routing process to disable this behavior
Once you've typed that command, the routers will not summarize the networks
and they will be advertised in EIGRP in RIP v2
as 10.1.1.0/24 as well as 10.1.2.0/24
so the router in the middle will be able to correctly route
to the various networks OSPF does not have this issue
because OSPF does not automatically summarize
you have to manually summarize networks.
So when does automatic summarization does takes place?
well it only affects this routing protocols RIP v2, EIGRP, RIP v1 and IGRP
it occurs when you move across classful boundaries
in other words, when a subnet is advertised from a class A to class B
or B to C or any one of these combinations
in other words, when a router has 1 interface in a class A network for example
and another interface in a class B network
and that advertisement crosses that classful boundary going from A to B
the network will automatically be summarized
another one that people forget is when you are moving
across major network boundaries, automatic summarization will also take place
in other words, if you go from a 10 network to an 11 network
or to a 12 network automatic summarization will take place
notice the major network 10 has changed to 11 or to 12
these are all class A networks
but you are moving across a major network boundary
so if 1 interface on a router is in the 10 network
and another interface on a router is in the 11 network
there will be automatic summarization.
Remember on EIGRP and RIP v2 to type the command no auto-summary
because even though they are classless routing protocols
they act as classful routing protocols
when it comes to automatic summarization
now here’s another situation that causes a lot of confusion
in ICND 1 you learned about administrative distance
and you learned that the lower the administrative distance
the more preferable a route is, the administrative distance of RIP v2 is 120
the administrative distance of OSPF is 110
the administrative distance of EIGRP is 90.
So let's assume router 1, router 2 and router 3 have networks in the 10 range
connected to them, they are advertising various routes to router 4.
So RIP v2 is advertising 10.1.1.0/27
OSPF is advertising 10.1.0.0/16 EIGRP is advertising 10.0.0.0/8
so router 4 is receiving multiple advertisements in the 10 range
but if on router 4 you type the command ping 10.1.1.1
which way will a traffic flow, will it go to router 3
or will it go to router 2 or will it go to router 1?
Now remember EIGRP has a lower administrative distance than OSPF
which has a lower administrative distance than RIP
but please note administrative distance only comes into play
when the same prefix is advertised
a prefix is not just the network it's the network and the mask
router 4 will see this prefixes 10.1.1.0/27
10.1.0.0/16 and 10.0.0.0/8 as separate prefixes
these 3 routes will appear in the routing table with router 4
and router 4 will make its decision on the best match.
10.1.1.0/27 is the best match out of these 3 routes.
27 is the most specific, so the most specific or best match will be used
and not the administrative distance
the administrative distance would only be used
if the same route was advertised by multiple routing protocols
so in this case, the ping to 10.1.1.1
will go to router 1 and not router 2 or router 3
however, in this example, notice the same prefix is advertised
by the 3 routers 10.0.0.0/8 is advertised by RIP, OSPF and EIGRP
in this case only 1 route can be put into the routing table
and the choice is done via administrative distance
EIGRP having the lowest administrative distance
will have its route inserted into a routing table
and the ping from router 4 will now go to router 3
to sum this up, in this example, there are 3 separate prefixes
the router does not see this as the same network
it sees them as 3 separate prefixes or subnets
all 3 will be put into the routing table
and a decision will be made on the best match or longest prefix
in this case, 27 is longer than 16, just longer than 8
so the RIP v2 route will be chosen, however, where the route is the same route.
So in this example 10.0.0.0/8
the choice will be made on administrative distance with EIGRP winning
because it has the lowest administrative distance
please don’t forget this, a lot of engineers make the mistake
of assuming that administrative distance is the way choices are made
for choosing the best route
administrative distance is only chosen as a tie breaker
when the same route or prefix is attempted
to be put into the routing table by multiple routing protocols
So what have we covered?
we look at Variable Length Subnet Mask or VLSM
we discuss CIDR or Classless Inter-Domain Routing
we talked about summarization and the advantages of summarization
I showed you examples of how to work out summarized routes
I showed you routing choices and how routers will make a choice
firstly on most specific match and then secondly on administrative distance
and then I showed you some issues regarding discontiguous networks.
Thank you for watching!