So in this section we are going to talk about two different things.
First,
how a Cisco device will determine the route to
choose when multiple sources exist, and second,
how OSPF specifically makes route selection when multiple OSPF options exist.
Cisco like some other networking vendors uses an administrative distance to
determine which source of routing information should be selected when
multiple entries exist to the same destination.
So when multiple entries exist, the source of the route is referenced.
The entries from the source with the lowest cost according to this
table will be placed into the routing table.
So for OSPF it is preferred over sources like IS-IS and RIP,
but below internal EIGRP.
Once OSPF is selected as the best route source,
another OSPF-specific route selection process is followed.
Before going into this too much,
we must review a few things about how OSPF can be configured.
These things will be covered in more depth in later modules,
but a basic understanding is required to discuss OSPF route selection.
The way that OSPF supports hierarchy is through the use of areas.
These areas are often configured to limit the overall size of the OSPF
link state database throughout a larger network.
There are several types of OSPF area including stub areas,
totally stubby areas, and not-so-stubby areas,
also referred to as NSSAs.
There are several differences between these different types of area,
but at this point the only thing that is important to understand is
that areas can exist and there are multiple types.
So with this covered, let's move into OSPF route selection.
When a route entry exists that was originally sourced from inside the
same area as the device performing the selection,
it is considered an intra-area entry.
An intra-area entry will always be preferred over other OSPF sources.
Next we have those route entries that are sourced from another OSPF area.
These routes are referred to as inter-area.
Inter-area entries are used if no intra-area OSPF entries exist.
Internal OSPF entries will either be considered intra- or inter-area.
If no internal OSPF entries exist,
but other external entries exist that have been redistributed into OSPF,
they are then considered.
As noted in the previous section,
there are two different types of external OSPF entry: type 1 and type 2.
Type 1 entries are preferred if both type 1 and type 2
external entries exist to the same destination.
And finally, we have two additional types of route entry.
These include external routes that are sourced inside a not-so-stubby area.
As with normal external route entry types,
there are two types, type 1 and type 2, and just as with normal external entries,
type 1 not-so-stubby area external entries are preferred over
type 2 not-so-stubby area external entries.
So to review this, in order of preference we have intra-area entries,
inter-area entries, external type 1 entries,
external type 2 entries, not-so-stubby area external type 1 entries,
and finally, not-so-stubby area external type 2 entries.
Remember that this route selection is only used by a device if
no conflicting source exists with a lower administrative distance for the same destination.