01-06-2023
03:22 PM
- last edited on
01-09-2023
07:59 PM
by
Translator
I (think I) understand the difference in operation between type 1 and type 2 metric in AS External LSA, as explained here: https://ipwithease.com/ospf-external-e1-and-e2-routes/
However, I don't understand why I would ever choose type 2 metric versus type 1: since type 1 takes into consideration the cost within the AS to the ASBR that will lead to the external subnet, it seems to always be more accurate.
In an LSA with metric type 2, shown by the command
show ip ospf
database external, it says in a c3725:
Metric Type: 2 (Larger than any link state path)
This seems to imply that we use metric type 2 when we consider the cost outside the AS to be much higher than the cost inside the AS until the ASBR.
But even in this case, I don't understand why we should just ignore the cost to the ASBR. Can't this lead to inefficient routing inside the AS when going to the ASBR?
Can someone give me a use case where type 2 metric is superior to type 1?
Solved! Go to Solution.
01-06-2023
03:42 PM
- last edited on
01-09-2023
08:05 PM
by
Translator
Hello,
Its all about function. You need to know they exist so if a requirement ever came up, such as corporation wants the metric to remain the same through the routing domain, you know which one to implement. There are many reasons to use one over the other and to your point Can't this lead to inefficient routing inside the AS when going to the ASBR? - lots of things can also lead to inefficient routing to ASBR if the network engineer is not educated enough and doesn't understand OSPF fully.
But as for an example, one comes to mind. Maybe you have 2 ASBR that get you out of your network that also advertise the same routes because on the other side they connect to the same subnets. If you want your Internal OSPF process to choose one ASBR over the other you would advertise E2 (same metric of 20 throughout domain) vs: E1 (which adds on the metric) - route manipulation.
Or maybe you have a
route-map
that influences routing in terms of path cost. So the route map could say All routes with a metric of 20 (E2) do this thing or tag with this number, etc.
To your credit if both are used it will always choose the E1 routes over the E2 because as you have pointed out it is more accurate. So the OSPF process knows this, but as mentioned above its situational dependent.
If you look at it at its ore, its a way to control/influence routing behavior.
Edit: It is also less processor intensive as E2 route metrics don't have to be recalculated when the network changes as it will always be 20. E1 route types have to join in the SPF calculation when paths change, etc. Depending on the size of the network this can also be a factor.
Hope that helps
-David
01-06-2023
03:42 PM
- last edited on
01-09-2023
08:05 PM
by
Translator
Hello,
Its all about function. You need to know they exist so if a requirement ever came up, such as corporation wants the metric to remain the same through the routing domain, you know which one to implement. There are many reasons to use one over the other and to your point Can't this lead to inefficient routing inside the AS when going to the ASBR? - lots of things can also lead to inefficient routing to ASBR if the network engineer is not educated enough and doesn't understand OSPF fully.
But as for an example, one comes to mind. Maybe you have 2 ASBR that get you out of your network that also advertise the same routes because on the other side they connect to the same subnets. If you want your Internal OSPF process to choose one ASBR over the other you would advertise E2 (same metric of 20 throughout domain) vs: E1 (which adds on the metric) - route manipulation.
Or maybe you have a
route-map
that influences routing in terms of path cost. So the route map could say All routes with a metric of 20 (E2) do this thing or tag with this number, etc.
To your credit if both are used it will always choose the E1 routes over the E2 because as you have pointed out it is more accurate. So the OSPF process knows this, but as mentioned above its situational dependent.
If you look at it at its ore, its a way to control/influence routing behavior.
Edit: It is also less processor intensive as E2 route metrics don't have to be recalculated when the network changes as it will always be 20. E1 route types have to join in the SPF calculation when paths change, etc. Depending on the size of the network this can also be a factor.
Hope that helps
-David
01-06-2023 04:14 PM
Thank you for your answer! Your example presented a clear situation where its useful to have the type 2 metric, to make it so that the router advertising E1 would be chosen instead of the one advertising E2. As such, I have accepted it.
01-06-2023 04:18 PM
I think this part of story,
I see case you can not calculate cost to ASBR this happened in SP core when there is iBGP between two PE run eBGP to CE,
but this need time to lab, if you want to show you case please confirm that.
01-06-2023 04:20 PM
I was also doing some more digging. Not sure what level you are at but for CCNA/CCNP level you got the jist of it down, however for CCIE level you would need to dig deeper and the E2 routes "technically" use the metric to the ASBR, just kind in the background and not as pronounced as the E1 routes. Found this article that may shed some light on it.
https://ine.com/blog/2011-04-04-understanding-ospf-external-route-path-selection
-David
01-06-2023 04:25 PM - edited 01-08-2023 01:57 AM
....
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