07-13-2011 07:59 AM - edited 03-07-2019 01:11 AM
Hi There,
I have a hard time understanding the difference between classful and classless routing. I understand that classful routing protocols don't carry subnet mask information in their updates which in turn don't support VLSM. This means (as i understood so far) that these protocols understands only classfull subnets such as A,B and C classes. However, one of the CCIE books specifically in the RIP v1 section, mentioned a diagram with different subnet masks and RIP v1 just worked fine. This is strange because RIP v1 is a classful protocol , so how come it can route between different subnet masks? ... Maybe my question is wrong depending on how much i understand so please forgive my confusion.
Also, i uploaded the diagram's picutre for you. This picture was taken from the GNS3 network simulator.
As you see, /27 and /24 subnet masks are used in the diagram and RIP v1 is routing between them.
My humble understanding to Classfull routing assumes that all the networks in this diagram should be only 1 subnet mask to be used.
Please advise.
Thanks for your patience and support.
Solved! Go to Solution.
07-13-2011 02:31 PM
Hello,
All right, let's have a look at your diagram.
RTA and RTB have all their interfaces inside the major network 192.168.2.0/24:
RTA: 192.168.2.96/27, 192.168.2.192/27
RTB: 192.168.2.64/27, 192.168.2.192/27
For example, when RTA advertises the network 192.168.2.96/27, it sends it out the interface in the network 192.168.2.192/27. Because both the advertised network and the interface through which the advertisement is sent are in the same major network (192.168.2.0/24), the network 192.168.2.96 will be advertised as is, i.e. no modification to the address will be done. Note that the netmask will not be actually advertised because neither RIPv1 nor IGRP advertise netmasks along with networks.
RTB and RTC will receive this advertisement, and because - again - this advertisement comes through an interface which is in the same major network (192.168.2.0/24) as the network 192.168.2.96 in this advertisement, this network will be added to RTB's and RTC's routing table with the subnet mask borrowed from the incoming interface, which is obviously /27.
So RTC will know networks 192.168.2.64/27, 192.168.2.96/27, 192.168.2.192/27, and it will try to advertise them to RTD. However, the link between RTC and RTD is in the network 192.168.3.0/24 - a different major network than the aforementioned subnets. Therefore, RTC will not advertise the three individual networks to RTD, rather, it will simply replace them by the major network under which they belong - 192.168.2.0. Again, note that there is no netmask advertised.
RTD will learn about the network 192.168.2.0 from RTC. However, this network comes through an interface in the major network 192.168.3.0/24 - a different major network than the advertised network. So RTD will assume a classful mask to the received network which is obviously /24, as 192.168.2.0 is a C-class network.
RTE and RTF have a difficult position. They both have a local subnet allocated from the major network 192.168.5.0/24 but the network that interconnects RTE and RTF is in a different major network: 192.168.4.0/24. Both RTE and RTF will therefore advertise the entire major network 192.168.5.0 to each other.
Now, an additional sanity check comes in: If a router learns about a classful network through an interface in a different major network, and it already knows some subnets of the received network learned from other interfaces, it drops the update. Why? Because as I said, in a classful world, the owner of a classful network can be only a single subject, and the networks are hence located "in one place" - in a single company. It would be illogical to learn about our own networks from a foreign world. This is considered a misconfiguration in the classful world, and therefore such update is dropped.
So in practical means, RTF receives a network 192.168.5.0 via its interface in 192.168.4.0/24. However, RTF already knows about the subnet 192.168.5.96/27, and it wonders: "How is it possible that the outside world advertises my own network to me? That can't be - I am supposed to be the only owner of the entire range 192.168.5.0/24, and if I do not know about some subnet then it does not exist at all!" And because of this sanity check, RTF (and vice versa RTE) drops this advertisement. Hence, neither RTE nor RTF will learn about the network 192.168.5.0/24 from each other, and therefore they cannot reach themselves.
You may find the following Cisco document also enlightening on this subject:
http://www.cisco.com/en/US/tech/tk364/technologies_tech_note09186a0080093fd8.shtml
Please feel welcome to ask further!
Best regards,
Peter
07-13-2011 02:42 PM
At the risk of butting in again !, yes you are right. 192.168.2.0 shows as subnets because the interconnecting link between RTA/RTB/RTC is also using a 192.168.2.x/27 network. So you have used the same subnet mask ie. 255.255.255.224 on all the 192.168.2.x networks and there is no other major network separating any of these 192.168.2.x/27 networks.
Compare this to RTD/RTE/RTF where you have 192.168.5.x/27 networks separated by a 192.168.4.0/24 network.
Jon
07-13-2011 03:51 PM
Hello,
No need to apologize. And Jon absolutely deserves all the credit!
Regarding the classless routing protocols - well, they are actually very easy because they do not have any of those cranky assumptions about major networks and constant subnetting mask and guessing the netmask of an advertised network...
Simply and plainly, classless routing protocols always advertise both network and its netmask. They do not assume that you get an entire major network when you ask for an IP address space. They do not assume that you are subnetting the assigned range with a constant mask. They do not assume that the address classes are used at all. In other words, they assume nothing, and they advertise all the details. By this approach, they completely eliminate all ambiguosities because instead of guessing or inferring a netmask, the netmask is always explicitly stated within the routing protocol update.
There is only a single remainder of the classful protocol in the classless protocol: something we call automatic summarization. It is actually something what we have already spoken about: if a router is going to advertise a network from major network X out an interface connected to major network Y (X is different from Y), then the router will advertise only the major network X instead of the original subnet. This was done also in classful protocols. The main difference in classless protocols is twofold: even if automatically summarized network is advertised, the update will contain the network's netmask, and second, this automatic summarization can be deactivated. In classful protocols, this was not possible.
So if I got back to your diagram, if we used any classless routing protocol with auto-summarization turned off, things would be extremely simple. Each and every router would advertise all directly connected and learned networks exactly as they are - no mangling with addresses/netmasks, no summarization, no hidden modification, no sanity checks and optional refusals to accept an update. Indeed, very simple - do not try to find any gotcha here.
If we used a classless routing protocol with active auto-summary, RTC would summarize the subnets from the RTA and RTB into 192.168.2.0/24 when sending them to RTD. RTE and RTF would still both advertise 192.168.5.0/24 which would be an unpleasant thing:
In retrospect, classful routing protocols are much less clear, very opinionated and very specific in how they advertise networks and derive netmasks. Classless protocols do not have any of those mannerisms - they simply advertise what they know, and perhaps auto-summarize it along the way, nothing more.
Best regards,
Peter
07-13-2011 09:51 AM
Hello,
What you are asking about is the difference between classful and classless routing protocols. Classful/classless routing (or sometimes more precisely called routing behavior is something related but different).
Classful routing protocols work according to a set of assumptions:
Note that the classful routing protocol was in effect guessing the netmasks - if you were in the same major network, it used your interfaces' netmasks, and if the update crossed a major network boundary, then the classful mask was assumed.
Let me at this point stop the explanation, and let me simply let you digest it and wait till you have further questions or believe you understand the point behind this. Then I will be able to explain why your topology will have slight reachability issues between RTE and RTF while other routes should be reachable.
Best regards,
Peter
07-13-2011 01:57 PM
Thanks Peter for the valuable and expert explanation.
I can't say that i fully digested the previous explanation since it is all thoery. I appreciate if you can explain this practically in my diagram better. By this way, i beleive i can understand it quickly.
By the way, i solved the reachability issue between RTE and RTF by using secondary ip addresses on their existing links. However, i'll be glad if you can explain to me the issue from your point of view and why the 192.168.5.0 networks are discontiguous.
Thanks a lot for your help.
07-13-2011 02:31 PM
Hello,
All right, let's have a look at your diagram.
RTA and RTB have all their interfaces inside the major network 192.168.2.0/24:
RTA: 192.168.2.96/27, 192.168.2.192/27
RTB: 192.168.2.64/27, 192.168.2.192/27
For example, when RTA advertises the network 192.168.2.96/27, it sends it out the interface in the network 192.168.2.192/27. Because both the advertised network and the interface through which the advertisement is sent are in the same major network (192.168.2.0/24), the network 192.168.2.96 will be advertised as is, i.e. no modification to the address will be done. Note that the netmask will not be actually advertised because neither RIPv1 nor IGRP advertise netmasks along with networks.
RTB and RTC will receive this advertisement, and because - again - this advertisement comes through an interface which is in the same major network (192.168.2.0/24) as the network 192.168.2.96 in this advertisement, this network will be added to RTB's and RTC's routing table with the subnet mask borrowed from the incoming interface, which is obviously /27.
So RTC will know networks 192.168.2.64/27, 192.168.2.96/27, 192.168.2.192/27, and it will try to advertise them to RTD. However, the link between RTC and RTD is in the network 192.168.3.0/24 - a different major network than the aforementioned subnets. Therefore, RTC will not advertise the three individual networks to RTD, rather, it will simply replace them by the major network under which they belong - 192.168.2.0. Again, note that there is no netmask advertised.
RTD will learn about the network 192.168.2.0 from RTC. However, this network comes through an interface in the major network 192.168.3.0/24 - a different major network than the advertised network. So RTD will assume a classful mask to the received network which is obviously /24, as 192.168.2.0 is a C-class network.
RTE and RTF have a difficult position. They both have a local subnet allocated from the major network 192.168.5.0/24 but the network that interconnects RTE and RTF is in a different major network: 192.168.4.0/24. Both RTE and RTF will therefore advertise the entire major network 192.168.5.0 to each other.
Now, an additional sanity check comes in: If a router learns about a classful network through an interface in a different major network, and it already knows some subnets of the received network learned from other interfaces, it drops the update. Why? Because as I said, in a classful world, the owner of a classful network can be only a single subject, and the networks are hence located "in one place" - in a single company. It would be illogical to learn about our own networks from a foreign world. This is considered a misconfiguration in the classful world, and therefore such update is dropped.
So in practical means, RTF receives a network 192.168.5.0 via its interface in 192.168.4.0/24. However, RTF already knows about the subnet 192.168.5.96/27, and it wonders: "How is it possible that the outside world advertises my own network to me? That can't be - I am supposed to be the only owner of the entire range 192.168.5.0/24, and if I do not know about some subnet then it does not exist at all!" And because of this sanity check, RTF (and vice versa RTE) drops this advertisement. Hence, neither RTE nor RTF will learn about the network 192.168.5.0/24 from each other, and therefore they cannot reach themselves.
You may find the following Cisco document also enlightening on this subject:
http://www.cisco.com/en/US/tech/tk364/technologies_tech_note09186a0080093fd8.shtml
Please feel welcome to ask further!
Best regards,
Peter
07-13-2011 02:33 PM
Sorry Peter, thought you might have clocked off for the evening
07-13-2011 02:44 PM
Hello Jon,
I am still around but mostly awaiting your inputs Your joining in this thread is most welcome and appreciated!
Best regards,
Peter
07-13-2011 02:58 PM
Peter, you just pulled my "WoW" out of me, Excellent explanation!
Sorry about posting my last post without seeing yours as i need always to refresh my browser to see new replies.
I confirm now that i understood the classful routing.
Now, to digest this topic more, can you explain to me classless routing in the diagram as well? .. I just want to fully understand the difference between them. Sometimes, in order to fully understand something, you need to read about another thing to show you what was the first thing talk about.
Appreciate your help.
07-13-2011 03:51 PM
Hello,
No need to apologize. And Jon absolutely deserves all the credit!
Regarding the classless routing protocols - well, they are actually very easy because they do not have any of those cranky assumptions about major networks and constant subnetting mask and guessing the netmask of an advertised network...
Simply and plainly, classless routing protocols always advertise both network and its netmask. They do not assume that you get an entire major network when you ask for an IP address space. They do not assume that you are subnetting the assigned range with a constant mask. They do not assume that the address classes are used at all. In other words, they assume nothing, and they advertise all the details. By this approach, they completely eliminate all ambiguosities because instead of guessing or inferring a netmask, the netmask is always explicitly stated within the routing protocol update.
There is only a single remainder of the classful protocol in the classless protocol: something we call automatic summarization. It is actually something what we have already spoken about: if a router is going to advertise a network from major network X out an interface connected to major network Y (X is different from Y), then the router will advertise only the major network X instead of the original subnet. This was done also in classful protocols. The main difference in classless protocols is twofold: even if automatically summarized network is advertised, the update will contain the network's netmask, and second, this automatic summarization can be deactivated. In classful protocols, this was not possible.
So if I got back to your diagram, if we used any classless routing protocol with auto-summarization turned off, things would be extremely simple. Each and every router would advertise all directly connected and learned networks exactly as they are - no mangling with addresses/netmasks, no summarization, no hidden modification, no sanity checks and optional refusals to accept an update. Indeed, very simple - do not try to find any gotcha here.
If we used a classless routing protocol with active auto-summary, RTC would summarize the subnets from the RTA and RTB into 192.168.2.0/24 when sending them to RTD. RTE and RTF would still both advertise 192.168.5.0/24 which would be an unpleasant thing:
In retrospect, classful routing protocols are much less clear, very opinionated and very specific in how they advertise networks and derive netmasks. Classless protocols do not have any of those mannerisms - they simply advertise what they know, and perhaps auto-summarize it along the way, nothing more.
Best regards,
Peter
07-16-2011 02:55 PM
Hello,
Apologies for the late reply as my keyboard had a malfunction so i couldn't post my reply earlier.
Thanks a lot for your help regarding classful and classless routing explanation. I learned a lot from this useful thread.
Have a nice day
07-13-2011 02:31 PM
It doesn't work without secondary addressing because of this part of Peter's excellent explanation -
If a classful routing protocol wanted to advertise a network through an interface, it made a following decision process: Is the advertised network in the same major network as the interface through which it is going to be advertised?
ie. RTE advertises 192.168.5.0/24 and so does RTF because for both routers the advertisement is being done out of the 192.168.4.x interface with a /24 mask. So both routers summarise 192.168.5.x to it's major network.
If you did a "sh ip ro" on RTD you should actually see 2 routes to 192.168.5.0/24 via both RTE and RTF which clearly wouldn't work very well as RTC has no way of knowing where to send specific 192.168.5.x traffic to.
Jon
07-13-2011 02:36 PM
I think i got what you meant when you said the below notes:
"If a classful routing protocol wanted to advertise a network through an interface, it made a following decision process: Is the advertised network in the same major network as the interface through which it is going to be advertised?
After routing table entries inspection, i found that any network which is not in the same major network as the interface being advertised to, shown as classful network not the exact subnet.
For instance, see the below route table in RTA
RTA#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
R 192.168.5.0/24 [120/1] via 192.168.2.194, 00:00:18, FastEthernet0/0
192.168.2.0/27 is subnetted, 3 subnets
C 192.168.2.96 is directly connected, FastEthernet0/1
R 192.168.2.64 [120/1] via 192.168.2.195, 00:00:25, FastEthernet0/0
C 192.168.2.192 is directly connected, FastEthernet0/0
R 192.168.3.0/24 [120/1] via 192.168.2.194, 00:00:18, FastEthernet0/0
RTA#
Because 192.168.5.0 and 192.168.3.0 are remote networks (not as the major network of RTA), they are shown as C major class addresses with /24 masks. However, because the 192.168.2.0 is in the same major network as RTA, it shows the 192.168.2.64 as a subnetted entry not major.
Am i right? did i understand it in a right way?
Thanks a lot
07-13-2011 02:42 PM
At the risk of butting in again !, yes you are right. 192.168.2.0 shows as subnets because the interconnecting link between RTA/RTB/RTC is also using a 192.168.2.x/27 network. So you have used the same subnet mask ie. 255.255.255.224 on all the 192.168.2.x networks and there is no other major network separating any of these 192.168.2.x/27 networks.
Compare this to RTD/RTE/RTF where you have 192.168.5.x/27 networks separated by a 192.168.4.0/24 network.
Jon
07-13-2011 03:05 PM
Many thanks also to Jon who came to share valuable opinions in this thread.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide