cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3761
Views
40
Helpful
6
Replies

Administrative distance Metric and longest match

Glf20
Level 1
Level 1

So lets say for a moment we have 3 routes that exactly the same

192.168.12.0/24 using EIGRP

192.168.12.0/27 using RIP

192.168.12.0/28 using OSPF

From my understanding

Administrative distance should be first choosing the EIGRP route 

If all of these where using the same routing protocol then it would look at metric to decide and if both administrative distance and metric where all equal then the longest match would be used first.

I want to know if i understand this correctly or if i am missing something.

1 Accepted Solution

Accepted Solutions

I am glad that my explanation was helpful. It occurs to me that perhaps there is another way to explain the relationship that might be helpful:

- if there is more than one route to a network check the length of each route. If one route is more specific (has more significant bits  24 < 27 < 28) then we choose the longest match and the other attributes do not matter.

- if there is more than one route to a network and they have the same length then we evaluate how we learned them using Administrative Distance. If one has a better AD then we choose that one and the other attribute does not matter.

- if there is more than one route to a network and they have the same length and the same AD then check the metric. If one route has a better metric then put that one into the routing table and do not use the others. If more than one route has the same length, has the same AD, and has the same metric then put each of those routes into the routing table and perform load sharing using all of the eligible routes.

HTH

Rick

View solution in original post

6 Replies 6

Richard Burts
Hall of Fame
Hall of Fame

Unfortunately you are missing something. Your statement is that you have 3 routes that are exactly the same. But they are not exactly the same. They may all use the same network address, but their different lengths makes them different. The result would be that all 3 routes would be placed into the routing table. 

 

Here is a quick explanation of how the 3 elements relate to each other and how they are used:

- length of prefix is how many bits in the network address are significant. If there is more than one prefix available the longest match is the one that will be used.

- administrative distance is an attribute associated with how we learned the prefix. If there are more than one prefix with same length then we look at how we learned the prefix by evaluating the AD. Connected is better than static (at least the default value for static), which is better than BGP external, which is better than EIGRP (internal), which is better than OSPF, which is better than RIP, etc.

- each dynamic protocol assigns a metric to each prefix and evaluates the metric to choose the best route. So if there are more than one prefix with the same length and the same AD, then we evaluate the metric to choose the best path.

HTH

Rick

Alright I think i understand now, I can see how they're different when you say it like that. Thank you for your help. 

I am glad that my explanation was helpful. It occurs to me that perhaps there is another way to explain the relationship that might be helpful:

- if there is more than one route to a network check the length of each route. If one route is more specific (has more significant bits  24 < 27 < 28) then we choose the longest match and the other attributes do not matter.

- if there is more than one route to a network and they have the same length then we evaluate how we learned them using Administrative Distance. If one has a better AD then we choose that one and the other attribute does not matter.

- if there is more than one route to a network and they have the same length and the same AD then check the metric. If one route has a better metric then put that one into the routing table and do not use the others. If more than one route has the same length, has the same AD, and has the same metric then put each of those routes into the routing table and perform load sharing using all of the eligible routes.

HTH

Rick

Just to add a bit to the information that Rick already provided, be aware that there are defaults for routing protocols ADs and metrics, which can be overridden. The process of choice is as Rick describes, but don't always assume defaults are being used.

Further, Rick mentions "equal" route choices will all be placed into the route table and then there will be load sharing. Again, there are defaults for how that works too, and those defaults sometimes differ between routing protocols and device defaults. So, again, there are situations where you might not "see" all equal cost routes in a routing table that you might otherwise expect.

Lastly, one of the "features" of EIGRP (disabled by default) it can support multiple unequal cost routes (i.e. different EIGRP metric) in a route table and load share "proportionally".

Martin L
VIP
VIP

This has been an interesting discussion of some fundamental concepts. I am glad that it has been helpful for you and think that others in the community might also find it helpful. Thank you for marking this question as solved. This will help other participants in the community to identify discussions which have helpful information. This community is an excellent place to ask questions and to learn about networking. I hope to see you continue to be active in the community.

HTH

Rick
Review Cisco Networking for a $25 gift card