OSPF Path Selection explained

Hello Rahul

E1 and E2 are two different ways of calculating an external route. An external route is one that has been introduced into OSPF from a different autonomous system. This external autonomous system could be running a different routing protocol, static routing or even another OSPF instance completely independent of the one in question.

When a route is defined as E1, it includes the cost from the ASBR to the particular router that we are looking at. An E2 route does not include this additional metric value. E1 is the default configuration for OSPF.

Take a look at the following diagram
image
R3 is an ASBR which has received an external route. If R3 is configured to view this redistributed external route as an E1 route, then as this route is propagated to R2 and R1, the cost to the originating ASBR is added to the route. So the routing tables in R2 and R1 will add the cost of each additional hop.

E2 routes, if defined as such in R3, when propagated will not have the cost of the distance to the ASBR added as they are propagated from router to router. Note here that the source of E1 and E2 routes are an ASBR.

In the case of N1 and N2 routes, the same logic applies except that the source of the routes is a router is an NSSA ASBR.

I hope this has been helpful!

Laz