11.1.6 Route selection criteria
The OSPF protocol performs SPF calculation whenever LSAs are updated by LSA generation or learning. In SPF calculation, routes are selected based on the SPF algorithm. When a destination becomes unreachable, the protocol deletes the route to that destination.
An area border router selects routes based on SPF algorithms separately for all areas it belongs to.
Route selection criteria for OSPF are listed below in order of precedence. You cannot change this priority.
-
Type of routing information
OSPF internal AS routes (intra-area routes or inter-area routes) take precedence over external AS routes.
-
Learning source domain
If routes exist in more than one domain, the protocol selects the route with the smallest distance. When the distances are equal, the protocol selects the route with the smallest OSPF domain number.
-
Route destination type
-
Internal AS route
The intra-area route has priority over the inter-area route.
-
External AS route
Routes advertised by AS border router in an area take precedence over routes advertised by AS border router in another area.
-
-
External AS route type
The external AS route whose metric type is Type1 has precedence over the external AS route of Type2.
-
Areas traversed by external AS route
For a router located at an area border, when a destination AS boundary router connects to more than one area, the area with the smallest cost to the AS boundary router is selected. When the cost values are equal, the area with the largest area ID is selected.
-
Cost
-
Internal AS route
The route with the smallest cost to the destination takes precedence.
-
Type1 external AS route
The route for which the sum of the metric of the external AS route and the cost to the AS boundary router is smallest is selected.
-
Type2 external AS route
Selects the route with the smallest metric for the external AS route. If the metrics are equal, the route with the smallest cost to the AS boundary router is selected.
-
-
Next hop address
The protocol selects the address with the smallest next-hop address.
- <Structure of this section>
(1) Distance value
When the Switch learns more than one route to the same destination via a number of protocols, it compares the distance of each route and applies the route with the highest priority.
In OSPF, you can set default distances on a per-domain basis. You can assign different distances to external AS routes, intra-area routes, and inter-area routes. To change distances, use the distance command.
(2) Next-hop selection for external AS routes
The destination (next-hop address) of an external AS path is either the address of a neighboring OSPF router, or the forwarding address advertised by LSA. Details are given below.
(a) Targeting a AS border router
The figure below shows an example of a system configuration in which an AS boundary router is a target for packet forwarding. In this example, when Router 1 injects a route that Router 1 learns from Router 3 as an external AS route, Router 1 is designated as the forwarding destination. As the route to Router 1, a route selected by the internal AS route selection process is used.
|
(b) Targeting a forwarding address
The figure below shows an example of a system configuration in which a forwarding address is a target for packet forwarding. In this example, when Router 1 injects a route that Router 1 (an AS boundary router) learns from Router 3 as an external AS route, the destination (forwarding address) is the address of the Network 1 interface of Router 3. When Router 4 forwards packets to Network 1, it selects the route that passes through Router 2 to forward packets to the injected external route if this route is less costly.
|
(3) Packet-forwarding destinations for external AS routes in NSSA
When the routing protocol injects routing information as external AS routes, it must designate a forwarding destination address. If the routing information is injected by a broadcast OSPF interface, the forwarding destination is the address of the injection source. Otherwise, the forwarding destination is the address of an arbitrary interface in the NSSA. The figure below shows an example of a system configuration in which packet forwarding targets an arbitrary interface. In this example, when Router 1 injects a route that Router 1 learns from Router 2 as an external AS route, an arbitrary interface in the NSSA is designated as the forwarding destination. Router 4 selects the route to the forwarding destination of the external AS route by an inter-area path selection process.
|
(4) Notes on NSSA
The routing protocol selects the forwarding destination address for an external AS route from among the OSPF-enabled interfaces in the NSSA. The forwarding destination is changed if the interface goes down. In the period after the forwarding address changes but before the new external AS route is advertised, the route may be temporarily deleted. To ensure that the forwarding destination remains constant, we recommend that you configure as an OSPF interface the broadcast interface that is the source of the routing information.