cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1503
Views
0
Helpful
6
Replies

Routing Loop explaination in RIP (understood 50%) theory vs practical

SJ K
Level 5
Level 5

Hi all,

I always thought that a router will compare its current route (administrative distance and/or hop metric) with another similar route receive through advertisement  before deciding to use/replace the current route with the latest.

 

E.g.    192.168.1.0/24 <----> Router A <---- 192.168.2.0/24 ----> Router B <----> 192.168.3.0/24

 

In theory

Assuming Router A is connected to 192.168.1.0/24 and 192.168.2.0/24 network and Router B is connected to 192.168.2.0/24 network and 192.168.3.0/24 network, router A will simple ignore/drop 2.0/24 network advertisement from B because when it receive the advertisement, it will increase the hop count by 1 and compare it with its current hop count for the network 2.0/24. 

Since 2.0/24 is a connected network (hop count = 0), it is lesser/better then the hop count of 1 and thus the advertisement of 2.0/24 from Router B will be dropped.

 

q1) However, in fact when enable debug ip rip, router B isn't even advertising 2.0/24 network to router A. This can be explain because 2.0/24 are directly connected network for both Router A and B.   But this bring back the question --> How does Router B knows Router A has the same connected network of 2.0/24 ?!

 

===============================================================================================================

In the diagram below of explaining routing loops,  I have only managed to understand 1/2.   Below is the original routing table to network 3.0/24

 

Assuming that 3.0/24 network failed, Router Oak will update the hop count to 16 (poison) in its route table.

However, before Router Oak can advertise to Router Hay, Router Hay send out its regular advertisement and tell Router Oak that 3.0/24 network can be reached via itself with a hop count of 1.

 

Oak accept the routing update and  adds 1 to the distance hop count 2 and changes the vector (interface) to the S0

 

                

Over here, I can understand that Oak will accept the routing update from Router Hay because it has an invalid route to 192.168.3.0/24, as I assume (a "valid" route is always better then an invalid route)

==============================================================================================

 

What I don't understand is the next diagram below that depicts the advertisement from Oak going back to Hay

 


q2) Base on our initial theory of comparing metric/hop count before installing a route,  Oak advertisement of hop count 2 + 1 is obviously more then original/current Hay's routing to 192.168.3.0/24 with hop count of 1. Why does Hay still accept the routing update from Oak ?

 

Given the theory above (split horizon aside), wouldn't all converged network be in looped state irregardless of whether a route is down or not , since each route table has a route to its neighboring network. Route A advertise to B, B back to A again etc - am i right ?

 

Regards,
Noob

 

2 Accepted Solutions

Accepted Solutions

Hi Koh,

Assuming Router A is connected to 192.168.1.0/24 and 192.168.2.0/24 network and Router B is connected to 192.168.2.0/24 network and 192.168.3.0/24 network, router A will simple ignore/drop 2.0/24 network advertisement from B because when it receive the advertisement, it will increase the hop count by 1 and compare it with its current hop count for the network 2.0/24

It is true that A and B will mutually ignore the received advertisements for 192.168.2.0/24 but not because of some increased metric but rather because that network is directly connected to both of them so each one of them will think: "Hey, that's my network, I know better!"

To be completely perfect with respect to theory, A and B could accept their neighbor's advertisement of the 2.0/24 network but because they already know a better path to this network that is not influenced by the arrival of the information - namely, the fact that the network is directly connected and thus each router is "its own next hop" into it - the path through their neighbor will simply appear to be longer than the one that is already readily available.

Please also note that in RIPv1 and RIPv2, the incrementing is actually done when sending routing information to neighbors, not when receiving it. In other words, if a router knows a route to a destination whose metric is 5, it will itself advertise that network with the metric 6 and its neighbors will just take this metric of 6 as the resulting metric. This is different to other routing protocols.

q1) However, in fact when enable debug ip rip, router B isn't even advertising 2.0/24 network to router A. This can be explain because 2.0/24 are directly connected network for both Router A and B.

Actually, this is due to split horizon. The network would need to be advertised over an interface that is used to reach that network - in this case, the directly connected network itself. If you deactivated split horizon on both these routers on this common network using the per-interface no ip split-horizon command, the network 2.0/24 would be advertised just like any other.

But this bring back the question --> How does Router B knows Router A has the same connected network of 2.0/24 ?!

There is no such assumption going on in RIP. What you observed was split horizon in action.

q2) Base on our initial theory of comparing metric/hop count before installing a route,  Oak advertisement of hop count 2 + 1 is obviously more then original/current Hay's routing to 192.168.3.0/24 with hop count of 1. Why does Hay still accept the routing update from Oak ?

Because to Hay, Oak is still the next hop. What most textbooks about RIP fail to mention is that if a next hop suddenly advertises a higher metric than previously, you do not ignore it - rather, you accept it right away and increase your own metric as a result. This is because until you change the next hop, you are still following the path over the existing next hop whose own distance has increased, so your own distance must have increased as well.

It's like buying a milk at your favourite grocery store. If they decide to increase their prices overnight and you come to buy a new bottle of milk in the morning, you may not like that it's going to cost more but unless you decide to go to a different store, you will be buying that milk from the same store for more money than the day before.

This logic applies only to next hop suddenly advertising an increased distance. For other routers that are not next hops, the normal rules apply: If the path through them is more costly than the path through the current next hop, just ignore it.

Please feel welcome to ask further!

Best regards,
Peter

View solution in original post

Hi Koh,

 

q1) By the same theory, can we say that because the administrative distance of directly connected route is 0, and hence RIP advertisement of 120 will not take effect ?

 

We have to be careful about not confusing the internal best path selection inside RIP with most trustworthy route installation into the routing table. We were originally talking about RIP and metrics to decide what path is going to be considered the best by RIP. Here, administrative distance has no authority or influence. Only after RIP decides what the best path is and offers this best path to the routing table manager, the routing table manager itself may have multiple "best paths" from different routing sources, and it must decide which route is the most trustworthy, and only now the administrative distance comes into play.

 

q2) But why ? I thought split-horizon only prevent the interface from sending back routes advertisement  that it learn from another router.  But seems like split horizon here also prevented the interface from sending its connected route advertisement  ?

 

We should first talk about the precise wording of the Split Horizon rule, and the wording is:

 

Never advertise a network through the interface you are using to reach that network.

 

In other words, don't advertise a network through the interface that is installed in the routing table as the egress interface (or next hop interface) toward that network. Notice that this formulation covers not only learned routes from neighboring routers but also your own directly connected networks.

 

Hey peter, base on the understanding above, can we say that Oak has accepted Hay route advertisement of 3.0/24 in the 1st place is because its own route is down - right ?

 

Yes, correct. To Oak, the 3.0/24 is simply gone, as if it was never there. So when Hay comes in and advertises the 3.0/24, Oak simply learns a new network it does not currently know anything about.

 

Moving on to that, how does Hay know that Oak is its next hop and it must accept Oak's route advertisement ? because Hay is receiving Oak's route advertisement via S1 and it matches its current route entry (to exit via S1) - am i right ?

 

Yes. Your next hop to a destination is known from the routing table by its IP address and your interface toward it. So if you receive an update about this particular network over this particular interface from this particular router, you know it's your next hop telling you something.

 

Having said that, if Router Fre send 3.0/24 route advertisement to Hay, Hay will ignore it, because Fre is not his next hop router, and its hop is 3 (currently same as what Hay is holding) - am i right ?

 

Well, actually, Hay already knows the network 3.0/24 with the metric of 3. If Fre sends an update about the same network with the same resulting metric of 3, now Hay will have two distinct routers claiming the same currently-lowest metric, so what will it do? Accept them both, of course, and do equal cost load balancing! :)

Lastly, as you said, the books DID not mentioned about accepting higher hop metrics from next hop address! where did you know all these information .....

Honestly, it's years of observing, experimenting, debugging... and applying common sense.

Best regards,
Peter

View solution in original post

6 Replies 6

SJ K
Level 5
Level 5

Hi,

 

Anyone, bumping the thread up.

 

Thanks.

Hi Koh,

Assuming Router A is connected to 192.168.1.0/24 and 192.168.2.0/24 network and Router B is connected to 192.168.2.0/24 network and 192.168.3.0/24 network, router A will simple ignore/drop 2.0/24 network advertisement from B because when it receive the advertisement, it will increase the hop count by 1 and compare it with its current hop count for the network 2.0/24

It is true that A and B will mutually ignore the received advertisements for 192.168.2.0/24 but not because of some increased metric but rather because that network is directly connected to both of them so each one of them will think: "Hey, that's my network, I know better!"

To be completely perfect with respect to theory, A and B could accept their neighbor's advertisement of the 2.0/24 network but because they already know a better path to this network that is not influenced by the arrival of the information - namely, the fact that the network is directly connected and thus each router is "its own next hop" into it - the path through their neighbor will simply appear to be longer than the one that is already readily available.

Please also note that in RIPv1 and RIPv2, the incrementing is actually done when sending routing information to neighbors, not when receiving it. In other words, if a router knows a route to a destination whose metric is 5, it will itself advertise that network with the metric 6 and its neighbors will just take this metric of 6 as the resulting metric. This is different to other routing protocols.

q1) However, in fact when enable debug ip rip, router B isn't even advertising 2.0/24 network to router A. This can be explain because 2.0/24 are directly connected network for both Router A and B.

Actually, this is due to split horizon. The network would need to be advertised over an interface that is used to reach that network - in this case, the directly connected network itself. If you deactivated split horizon on both these routers on this common network using the per-interface no ip split-horizon command, the network 2.0/24 would be advertised just like any other.

But this bring back the question --> How does Router B knows Router A has the same connected network of 2.0/24 ?!

There is no such assumption going on in RIP. What you observed was split horizon in action.

q2) Base on our initial theory of comparing metric/hop count before installing a route,  Oak advertisement of hop count 2 + 1 is obviously more then original/current Hay's routing to 192.168.3.0/24 with hop count of 1. Why does Hay still accept the routing update from Oak ?

Because to Hay, Oak is still the next hop. What most textbooks about RIP fail to mention is that if a next hop suddenly advertises a higher metric than previously, you do not ignore it - rather, you accept it right away and increase your own metric as a result. This is because until you change the next hop, you are still following the path over the existing next hop whose own distance has increased, so your own distance must have increased as well.

It's like buying a milk at your favourite grocery store. If they decide to increase their prices overnight and you come to buy a new bottle of milk in the morning, you may not like that it's going to cost more but unless you decide to go to a different store, you will be buying that milk from the same store for more money than the day before.

This logic applies only to next hop suddenly advertising an increased distance. For other routers that are not next hops, the normal rules apply: If the path through them is more costly than the path through the current next hop, just ignore it.

Please feel welcome to ask further!

Best regards,
Peter

Hi Peter,

 

Thank you so much for the reply. I thought that the thread is lost.  I am going to read through it and get back asap.

 

But i just can't wait to say thank you 1st.

 

Regards,
Noob

Hi Peter,

Assuming Router A is connected to 192.168.1.0/24 and 192.168.2.0/24 network and Router B is connected to 192.168.2.0/24 network and 192.168.3.0/24 network, router A will simple ignore/drop 2.0/24 network advertisement from B because when it receive the advertisement, it will increase the hop count by 1 and compare it with its current hop count for the network 2.0/24

It is true that A and B will mutually ignore the received advertisements for 192.168.2.0/24 but not because of some increased metric but rather because that network is directly connected to both of them so each one of them will think: "Hey, that's my network, I know better!"

To be completely perfect with respect to theory, A and B could accept their neighbor's advertisement of the 2.0/24 network but because they already know a better path to this network that is not influenced by the arrival of the information - namely, the fact that the network is directly connected and thus each router is "its own next hop" into it - the path through their neighbor will simply appear to be longer than the one that is already readily available.

 

q1) By the same theory, can we say that because the administrative distance of directly connected route is 0, and hence RIP advertisement of 120 will not take effect ?

 

Please also note that in RIPv1 and RIPv2, the incrementing is actually done when sending routing information to neighbors, not when receiving it. In other words, if a router knows a route to a destination whose metric is 5, it will itself advertise that network with the metric 6 and its neighbors will just take this metric of 6 as the resulting metric. This is different to other routing protocols.

Noob - Duly noted. I tried the debug and saw the metric actually being increased 1st before sending out :) Thanks.

Actually, this is due to split horizon. The network would need to be advertised over an interface that is used to reach that network - in this case, the directly connected network itself. If you deactivated split horizon on both these routers on this common network using the per-interface no ip split-horizon command, the network 2.0/24 would be advertised just like any other.

Yea peter, I tried it and yes, by issuing no ip split-horizon, the interface is sending out its connected network as advertisement also.  

q2) But why ? I thought split-horizon only prevents the interface from sending back routes advertisement that it learn from another router.  But seems like split horizon here also prevented the interface from sending its own connected route advertisement  ? How is this related to split horizon ?

 

Because to Hay, Oak is still the next hop. What most textbooks about RIP fail to mention is that if a next hop suddenly advertises a higher metric than previously, you do not ignore it - rather, you accept it right away and increase your own metric as a result. This is because until you change the next hop, you are still following the path over the existing next hop whose own distance has increased, so your own distance must have increased as well.

It's like buying a milk at your favourite grocery store. If they decide to increase their prices overnight and you come to buy a new bottle of milk in the morning, you may not like that it's going to cost more but unless you decide to go to a different store, you will be buying that milk from the same store for more money than the day before.

This logic applies only to next hop suddenly advertising an increased distance. For other routers that are not next hops, the normal rules apply: If the path through them is more costly than the path through the current next hop, just ignore it.

Hey peter, base on the understanding above, can we say that Oak has accepted Hay route advertisement of 3.0/24 in the 1st place is because its own route is down - right ?

Moving on to that, how does Hay know that Oak is its next hop and it must accept Oak's route advertisement ? because Hay is receiving Oak's route advertisement via S1 and it matches its current route entry (to exit via S1) - am i right ?

Having said that, if Router Fre send 3.0/24 route advertisement to Hay, Hay will ignore it, because Fre is not his next hop router, and its hop is 3 (currently same as what Hay is holding) - am i right ?

================

Lastly, as you said, the books DID not mentioned about accepting higher hop metrics from next hop address! where did you know all these information ..... 

 

Regards,
Noob

 

Hi Koh,

 

q1) By the same theory, can we say that because the administrative distance of directly connected route is 0, and hence RIP advertisement of 120 will not take effect ?

 

We have to be careful about not confusing the internal best path selection inside RIP with most trustworthy route installation into the routing table. We were originally talking about RIP and metrics to decide what path is going to be considered the best by RIP. Here, administrative distance has no authority or influence. Only after RIP decides what the best path is and offers this best path to the routing table manager, the routing table manager itself may have multiple "best paths" from different routing sources, and it must decide which route is the most trustworthy, and only now the administrative distance comes into play.

 

q2) But why ? I thought split-horizon only prevent the interface from sending back routes advertisement  that it learn from another router.  But seems like split horizon here also prevented the interface from sending its connected route advertisement  ?

 

We should first talk about the precise wording of the Split Horizon rule, and the wording is:

 

Never advertise a network through the interface you are using to reach that network.

 

In other words, don't advertise a network through the interface that is installed in the routing table as the egress interface (or next hop interface) toward that network. Notice that this formulation covers not only learned routes from neighboring routers but also your own directly connected networks.

 

Hey peter, base on the understanding above, can we say that Oak has accepted Hay route advertisement of 3.0/24 in the 1st place is because its own route is down - right ?

 

Yes, correct. To Oak, the 3.0/24 is simply gone, as if it was never there. So when Hay comes in and advertises the 3.0/24, Oak simply learns a new network it does not currently know anything about.

 

Moving on to that, how does Hay know that Oak is its next hop and it must accept Oak's route advertisement ? because Hay is receiving Oak's route advertisement via S1 and it matches its current route entry (to exit via S1) - am i right ?

 

Yes. Your next hop to a destination is known from the routing table by its IP address and your interface toward it. So if you receive an update about this particular network over this particular interface from this particular router, you know it's your next hop telling you something.

 

Having said that, if Router Fre send 3.0/24 route advertisement to Hay, Hay will ignore it, because Fre is not his next hop router, and its hop is 3 (currently same as what Hay is holding) - am i right ?

 

Well, actually, Hay already knows the network 3.0/24 with the metric of 3. If Fre sends an update about the same network with the same resulting metric of 3, now Hay will have two distinct routers claiming the same currently-lowest metric, so what will it do? Accept them both, of course, and do equal cost load balancing! :)

Lastly, as you said, the books DID not mentioned about accepting higher hop metrics from next hop address! where did you know all these information .....

Honestly, it's years of observing, experimenting, debugging... and applying common sense.

Best regards,
Peter

Hi Peter,

 

Thanks for the marvelous replies.  Just 2 more questions and i am done ;)

 

Never advertise a network through the interface you are using to reach that network.
In other words, don't advertise a network through the interface that is installed in the routing table as the egress interface (or next hop interface) toward that network. Notice that this formulation covers not only learned routes from neighboring routers but also your own directly connected networks.

q1)  From the above, it means that if i learn a route from my neighbour through an interface, my egress interface will be that interface and by the rule i shall not advertise the network through it. This results to what the book says about not advertising back routes to your neighbour where you learn them from. But the above "Never advertise a network through the interface you are using to reach that network."; is then the "actual reason" behind what the books have mentioned.  - isn't it.

 

Well, actually, Hay already knows the network 3.0/24 with the metric of 3. If Fre sends an update about the same network with the same resulting metric of 3, now Hay will have two distinct routers claiming the same currently-lowest metric, so what will it do? Accept them both, of course, and do equal cost load balancing! :)

q2) I believe the above is still under the "context" and decision of RIP and not the routing table manager right ? - as in to accept both paths as the "best path" and offering them to the route table manager

 

Peter, I hope its not too much to ask, I have another thread on RIP classful routing behaviour at

https://supportforums.cisco.com/discussion/12513906/rip-classful-routing-my-understanding-correct , it would be really good if i can have your opinion on it.

 

Thank you once again.

 

Regards,
Noob

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card