Description

We will understand the OSPF route selection preference.

 

A) When there are multiple routes available to the same network with different route types, routers use this order of preference (from highest to lowest):

  1. Intra-area routes
  2. Inter-area routes
  3. External Type-1 routes
  4. External Type-2 routes

B) If there are multiple routes to a network with the same route type, the OSPF metric calculated as cost based on the bandwidth is used for selecting the best route. The route with the lowest value for cost is chosen as the best route.

C) If there are multiple routes to a network with the same route type and cost, it chooses all the routes to be installed in the routing table, and the router does equal cost load balancing across multiple paths.

Solution

References:

(A)

  • This is explained under the RFC 2328, section-11, sub-section Path-type:
    • There are four possible types of paths used to route traffic to the destination, listed here in decreasing order of preference: intra-area, inter-area, type 1 external or type 2 external.

 

  • https://www.juniper.net/documentation/us/en/software/junos/ospf/topics/topic-map/ospf-overview.html#id-understanding-ospf-external-metrics
    • Both Type 1 and Type 2 external metrics can be present in the AS at the same time. In that event, Type 1 external metrics always takes the precedence.
    • Type 1 external paths are always preferred over Type 2 external paths.
    • When all paths are Type 2 external paths, the paths with the smallest advertised Type 2 metric are always preferred.

 

  • https://www.juniper.net/documentation/us/en/software/junos/ospf/topics/topic-map/configuring-ospf-areas.html#id-example-configuring-a-multiarea-adjacency-for-ospfv3
    • Intra-area paths are preferred over inter-area paths.

 

 

(B) https://www.juniper.net/documentation/us/en/software/junos/ospf/topics/topic-map/configuring-ospf-route-control.html#id-example-controlling-the-cost-of-individual-ospf-network-segments

  • All OSPF interfaces have a cost, which is a routing metric that is used in the link-state calculation. Routes with lower total path metrics are preferred to those with higher path metrics.

 

(C) https://www.juniper.net/documentation/us/en/software/junos/ospf/topics/topic-map/configuring-ospf-route-control.html#id-example-controlling-the-cost-of-individual-ospf-network-segments

  • If multiple equal-cost paths exist between a source and destination address, OSPF routes packets along each path alternately, in round-robin fashion.

Modification History

2024-02-24 : Article Created