Skip navigation
Cisco Learning Home > Certifications > CCIE Routing & Switching > Discussions

_Communities

19127 Views 24 Replies Latest reply: Sep 4, 2013 12:37 AM by Naren RSS 1 2 Previous Next

Currently Being Moderated

OSPF External Routes Selection (E1 vs N1)

Jun 9, 2009 1:57 AM

Cliff Lo 32 posts since
Jun 6, 2009

If I have 2 routes, E1 and N1 with different metrics, which will be select? Does it base on metrics or LSA Type?

  • Krzysztof Przybylski 64 posts since
    May 8, 2009
    Currently Being Moderated
    1. Jun 9, 2009 6:45 AM (in response to Cliff Lo)
    Re: OSPF External Routes Selection (E1 vs N1)

    E1 means, that its redistributed into OSPF with a metric-type 1,
    and metric type 1 means that the cost is incremented by internal cost i.e. external + internal cost
    (its no constant, it depends of network topology)
    Type 2 cost is learned from ASBR to destination.

    Type 1 is always prefered than type 2, and by default routes are learned by redistribution as type 1 type 2

     

    N1 - it means that you have got NSSA configured (type 1)

     

    ok, and the answer:
    The route with the lowest metric is the better path and it is installed in the ro table, in OSPF its cost

     


    I hope I'm right

     


    Greetings

     

    - Krzysztof

  • Mohit Kansal  CCIE RS 109 posts since
    Feb 12, 2009
    Currently Being Moderated
    2. Jun 9, 2009 3:34 AM (in response to Cliff Lo)
    Re: OSPF External Routes Selection (E1 vs N1)

    Hi Cliff,

     

    OSPF-running routers use these criteria to select the best route to be installed in the routing table:

     

    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.

     

    In your scenario, both the routes are external one is connected to NSSA and other to a normal area. As both are external routes and type is one, selection will not be on the basis of LSA, it will be based on the metric value of routes.

  • Mohit Kansal  CCIE RS 109 posts since
    Feb 12, 2009

    Hi Krzysztof,

     

    You are right about the way the cost is calculated for Type 1 external route and Type 2 external route.

     

    But by default routes are learned by redistribution as type 2 and at time of selection type 1 has higher priority than type 2. Despite of cost, type 1 will be prefered over type 2.

  • Krzysztof Przybylski 64 posts since
    May 8, 2009

    Hi Mohit,

     

    You are absolutely right,

    I don't know why I wrote so total nonsense

    Type 1 has to be configured manualy (config-router)#redi **** metric-type 1 ****

    and by default is type 2 (O E2)

    (I've edited that post... because I can not look at that.....)

    For the future I'm gonna read carefully my post before publish.

     

    Thanks,

     

    Greetings

    Krzysztof

  • Krzysztof Przybylski 64 posts since
    May 8, 2009
    Currently Being Moderated
    6. Jun 9, 2009 12:11 PM (in response to Cliff Lo)
    Re: OSPF External Routes Selection (E1 vs N1)

    Hi,

     

    I've made some 'cisco lab investigation'

    Below my conclusion:

    P-bit is set to 1 only in NSSA (LSA 7) because in NSSA N1/N2 routes are redistribute by ASBR

    When ABR translate LSA 7 into LSA 5 then p-bit value is change into 0.

    So if you experience N1 or N2 routes, it means that p-bit = 1

    E routes doesn't have p-bit = 1 because they were translated from lsa7, so E1 or E2 have p-bit = 0.

     

    E-bit is strictly related with E1/E2 routes, when e-bit =1, then metric type is E2, and if it is set to 0, then metric type is E1

    Unfortunately I couldn't 'catch' that E-bit in my lab, .... anyway I will find him later

     

    IntraArea route is better than O-IA --> its rather not related with your issue.....:/

     

    Anyway, you mentioned that both routes E1 and N1 are with different metrics

    In that case route with better metric will be chosen - the one with lowest metric

     

    But I think, that you can perform some packet manipulation and inject fake lsa with different p-bit(NSSA) or e-bit(into area 0 --> it would be more interesting).

     

    Hope I'm right

     

     

    Greetings

    Pozdrawiam

     

     

    Krzysztof

  • Scott Morris - CCDE/4xCCIE/2xJNCIE 8,396 posts since
    Oct 7, 2008

    RFCs are all sorts of fun.

     

    First:

     

          1. An LSA with the P-bit set is preferred over one with the P-bit
             clear.

          2. If the P-bit settings are the same, the LSA with the higher
             router ID is preferred.

     

    Later:

     

    Preference is defined as follows:

              (a) Intra-area and inter-area paths are always preferred over
                  AS external paths.
                  [OSPF]

              (b) 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.
                  [OSPF]

              (c) If the new AS external path is still indistinguishable
                  from the current paths in N's routing table entry, and
                  RFC1583Compatibility is set to "disabled", select the
                  preferred paths based on the intra-AS paths to the
                  ASBR/forwarding addresses, as specified in Section 16.4.1.
                  Here intra-NSSA paths are equivalent to the intra-area
                  paths of non-backbone regular OSPF areas.
                  [NSSA]



    Murphy                      Standards Track                    [Page 13]

    RFC 3101       The OSPF Not-So-Stubby Area (NSSA) Option    January 2003


              (d) If the new AS external path is still indistinguishable
                  from the current paths in N's routing table entry, select
                  the preferred path based on a least cost comparison.  Type
                  1 external paths are compared by looking at the sum of the
                  distance to the ASBR/forwarding addresses and the
                  advertised type 1 metric (X+Y).  Type 2 external paths
                  advertising equal type 2 metrics are compared by looking
                  at the distance to the ASBR/forwarding addresses.
                  ~[OSPF]

              (e) If the current LSA is functionally the same as an
                  installed LSA (i.e., same destination, cost and non-zero
                  forwarding address) then apply the following priorities in
                  deciding which LSA is preferred:

                     1. A Type-7 LSA with the P-bit set.

                     2. A Type-5 LSA.

                     3. The LSA with the higher router ID.

    So your N1 with the P-bit set should take precedence over an E1 if the metrics are the same between the two!

    RFC 3101 by the way.

    They make your brain hurt sometimes, but all the answers tend to be buried someplace within!

    HTH,

    Scott
    smorris@internetworkexpert.com


     
  • Scott Morris - CCDE/4xCCIE/2xJNCIE 8,396 posts since
    Oct 7, 2008
    Currently Being Moderated
    9. Jun 9, 2009 8:43 PM (in response to Cliff Lo)
    Re: OSPF External Routes Selection (E1 vs N1)

    That sounds like an excellent summary there!

     

    Cheers,

     

    Scott

  • Krzysztof Przybylski 64 posts since
    May 8, 2009
    Currently Being Moderated
    10. Jun 9, 2009 10:46 PM (in response to Cliff Lo)
    Re: OSPF External Routes Selection (E1 vs N1)

    very good summary!,

     

    But in my opinion point 4 is wrong,

    P-bit is equal 0 beyound NSSA only.

    N routes have always p-bit = 1.

    So, if p-bit is 0, then we will experience just E routes.

     

    And I'm not sure if point 3 is right... i don't know.. probably you are right.

     

     

    Regards

    Krzysztof

  • Scott Morris - CCDE/4xCCIE/2xJNCIE 8,396 posts since
    Oct 7, 2008
    Currently Being Moderated
    14. Jun 10, 2009 12:24 AM (in response to Cliff Lo)
    Re: OSPF External Routes Selection (E1 vs N1)

    Yeah, that summary's better.  I apparently stopped reading (or processing) after #3 before! (grin)

     

    And Cliff, don't feel bad.  I've done that before too!  But the good news is you got to catch yourself before anyone else did!   heheheheh.

     

    Scott

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)