OSPF setting Forward Address and Not setting it

 Hi,

      I am trying to understand why I am seeing the behavior I am seeing with the small OSPF Lab I have setup. R2 and R3 are both redistributing EIGRP routes into ospf. However, on R2 I am setting the forwarding address to a none 0.0.0.0 value by enabling ospf on the eigrp link on R2 which sets the forwarding address to 192.168.234.4. On R3 it's is setting the forwarding address to 0.0.0.0 R2 has a higher router-id of 200.200.200.200 and R3 has a router-id of 192.168.234.3. When I look at the ospf database for external networks and look specifically at the 4.4.4.4/32 network the LSA coming from R3 has the routing bit set so R1 is installing that route into the routing table. I would think that the routing bit would be set for the LSA coming from R2 since it has a higher router id. Can someone please explain why I am seeing this behavior. Below is the diagram. Please let me know what output you would like to see from the routers. Thank you

 

image

Comments

  • Hi drbk and All,

    Is this algorithm correct and complete?

      "Choosing between External LSAs for the same prefix:

      Type 1 over Type 2

      Else choose Least Metric

      Else if Type 2 and metric same; choose least forward metric

      Else if OSPF max paths 2 or greater; then choose both

      Else highest router id" 

    If above correct, then check "forward metric".  One extends from R1 to R4, while the other is between R1 and R3.

  • Close. The path selection for OSPF is 

    1)Internal over External
    2)Intra over Inter (O>O IA)
    3)type 1 over type 2
    4)lowest cost
    5)lowest fowarding metric
    6)compare metric to advertising router versus forwarding metric to forwarding address  <-- appears to be what you are hitting. I was taught that it chooses the path without the FA.


    7)N over E per RFC3103

     

    http://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/25493-type5-lsa.html#how1

     

  • Hi srsheely and All,

    Looks good.  Here with scarecrow logic graph. Presented for correction!

    image

     

  • Randy and all,

      Below is what R1 what sees regarding the 4.4.4.4 network and as you can see the metric is the same for both LSA a metric of 20. So why does R1 prefer the LSA being advertied from 192.168.234.3 which has forwading address of 0.0.0.0.

     

    R1#sh ip ospf data external 4.4.4.4


                OSPF Router with ID (1.1.1.1) (Process ID 1)


                    Type-5 AS External Link States


      Routing Bit Set on this LSA in topology Base with MTID 0

      LS age: 52

      Options: (No TOS-capability, DC, Upward)

      LS Type: AS External Link

      Link State ID: 4.4.4.4 (External Network Number )

      Advertising Router: 192.168.234.3

      LS Seq Number: 80000001

      Checksum: 0xA494

      Length: 36

      Network Mask: /32

            Metric Type: 2 (Larger than any link state path)

            MTID: 0 

            Metric: 20 

            Forward Address: 0.0.0.0

            External Route Tag: 0


      LS age: 55

      Options: (No TOS-capability, DC, Upward)

      LS Type: AS External Link

      Link State ID: 4.4.4.4 (External Network Number )

      Advertising Router: 200.200.200.200

      LS Seq Number: 80000001

      Checksum: 0xFD17

      Length: 36

      Network Mask: /32

            Metric Type: 2 (Larger than any link state path)

            MTID: 0 

            Metric: 20 

            Forward Address: 192.168.234.4

            External Route Tag: 0

              

    R1#

  • Hi drbk and All,

    I'm guessing that the forward metric to reach the two forwarding addresses are different.  

    What follows is my current understanding:

    E2 LSA5 have a metric.  The lowest metric in LSA is chosen.  Your example has a metric of 20 for each LSA5, which is a tie.  The next step is to compare their forward metrics, that is the ospf metric to reach their forwarding addresses.

    For path R1-R3-R4, the forwarding address is 0.0.0.0.  R3 is saying to R1 use any of my addresses.  R1 calculates the shortest path to R3 and uses that address, which is 192.168.13.3 as seen by "show ip ospf border-routers".  Note the metric (10?), that is the forward metric for selecting R3.

    For path R1-R2-R4, the forwarding address is 192.168.234.4.  show ip route 192.168.234.4 on R1 -- to view forward metric to reach R4 through R2.  Metric is 20?

    To check that forward metric comparison is selecting path:  

    increase cost on R1's e0/1 to 100, bumping up forward metric on path R1-R3-R4; clear ip route on R1; should switch from R3 to R2.

    See srsheely note above.  His explanation and link for Cisco doc is very informative.

    Here is my cartoon using GNS3 and IOS 12.4T for testing.


    image

    Why do E2's use two metrics?  Because we redistribute routes from Internet, and Internet uses AS hops as metric.  Manually setting metric to reflect AS hops and allow it to dominate OSPF selection process (cold potato to select end to end shortest path).  Use forward metric only as a tie breaker (hot potato).


    Please advise if above helps/or correct

    Cheers//RandyB


  • If OSPF receives 2 Type5 LSAs of the same type (E1 or E2), one with the FA set and one with the FA not set, there is NO such thing as it would prefer the one with FA set or not set, the decision is just done based on cost (which is just cost comparison for E1 or cost comparison and if a tie than forwarding metric comparison for E2).

    Close. The path selection for OSPF is 

    1)Internal over External
    2)Intra over Inter (O>O IA)
    3)type 1 over type 2
    4)lowest cost
    5)lowest fowarding metric
    6)compare metric to advertising router versus forwarding metric to forwarding address  <-- appears to be what you are hitting. I was taught that it chooses the path without the FA.


    7)N over E per RFC3103

     

    http://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/25493-type5-lsa.html#how1

     

     

  • A ASBR (in a non NSSA area), when it injects a Type5 LSA, it sets the FA to non-zero if it meets the FA setting rules, or it leaves it at the default of zero. A regular ASBR CANNOT choose to set the FA if it floods the type5 on area x or link x and not set the FA if it floods it on area y or link y. This makes sense as it would mean that the ASBR has to locally inject in its databse two type5 LSAs for the same prefix.

    Hi drbk and All,

    I'm guessing that the forward metric to reach the two forwarding addresses are different.  

    What follows is my current understanding:

    E2 LSA5 have a metric.  The lowest metric in LSA is chosen.  Your example has a metric of 20 for each LSA5, which is a tie.  The next step is to compare their forward metrics, that is the ospf metric to reach their forwarding addresses.

    For path R1-R3-R4, the forwarding address is 0.0.0.0.  R3 is saying to R1 use any of my addresses.  R1 calculates the shortest path to R3 and uses that address, which is 192.168.13.3 as seen by "show ip ospf border-routers".  Note the metric (10?), that is the forward metric for selecting R3.

    For path R1-R2-R4, the forwarding address is 192.168.234.4.  show ip route 192.168.234.4 on R1 -- to view forward metric to reach R4 through R2.  Metric is 20?

    To check that forward metric comparison is selecting path:  

    increase cost on R1's e0/1 to 100, bumping up forward metric on path R1-R3-R4; clear ip route on R1; should switch from R3 to R2.

    See srsheely note above.  His explanation and link for Cisco doc is very informative.

    Here is my cartoon using GNS3 and IOS 12.4T for testing.


    image

    Why do E2's use two metrics?  Because we redistribute routes from Internet, and Internet uses AS hops as metric.  Manually setting metric to reflect AS hops and allow it to dominate OSPF selection process (cold potato to select end to end shortest path).  Use forward metric only as a tie breaker (hot potato).


    Please advise if above helps/or correct

    Cheers//RandyB



     

  • 1)Internal over External
    2)Intra over Inter (O>O IA)-----if the O IA path is via a transit area, these are directly comparable via cost and O IA can win over O, and this makes sense....long discussion
    3)type 1 over type 2
    4)lowest cost
    5)lowest fowarding metric-----applicable only for E2/N2
    6)compare metric to advertising router versus forwarding metric to forwarding address  <-- appears to be what you are hitting. I was taught that it chooses the path without the FA.-----no such thing, does not make any sense


    7)N over E per RFC3103-----not true, it depends to which RFC the NSSA complies with, new or old RFC, long discussion

     

    Close. The path selection for OSPF is 

    1)Internal over External
    2)Intra over Inter (O>O IA)
    3)type 1 over type 2
    4)lowest cost
    5)lowest fowarding metric
    6)compare metric to advertising router versus forwarding metric to forwarding address  <-- appears to be what you are hitting. I was taught that it chooses the path without the FA.


    7)N over E per RFC3103

     

    http://www.cisco.com/c/en/us/support/docs/ip/open-shortest-path-first-ospf/25493-type5-lsa.html#how1

     

     

  • Hi,

      Assume both ASBR's inject a type5 LSA of the same type (E1 or E2), one with the FA not set (0.0.0.0) and one with the FA set(192.168.234.3). If it's E2, R1 will compare first the metric for the two LSA's, which is 20 by default, so there is a tie; secondly it will compare the forwarding metric (forwarding metric being the metric to reach the FA value, as the name says), which there is no tie in here as:

    -the forwarding metric for the LSA injected by R3 (with FA=0.0.0.0), is the metric of R1 to reach R3, (cost of 1 assuming the default cost of Ethernet); this is because FA=0.0.0.0 means calculate the forwarding metric as the metric to reach me. So FM=1 in here.

    - the forwarding metric for the LSA injected by R2 (with FA=192.168.234.4), is the metric of R1 to reach 192.168.234.1, which is a cost of 1 to reach R3 and a cost of 1 for R3's E0/1 OSPF link. So FM=2 in here.

    FM=1 is better than FM=2, so the LSA injected by R3 has a better FM, so OSPF sets the routing bit in the OSPF local RIB database, so OSPF sends that LSA to the global RIB, and as there is no other source of information for that prefix, you see it installed in the routing table.

    You should see the FA as the next-hop value from distance-vector protocols (as type5 LSA metric computation is actually distance-vector computation), where Fa=0.0.0.0 means next-hop/exit from OSPF domain is the ASBR itself, while FA=1.1.1.1 means the next=hop/exist from OSPF domain is the OSPF internal route of 1.1.1.1.

    Regards,

    Cristian.

     Hi,

          I am trying to understand why I am seeing the behavior I am seeing with the small OSPF Lab I have setup. R2 and R3 are both redistributing EIGRP routes into ospf. However, on R2 I am setting the forwarding address to a none 0.0.0.0 value by enabling ospf on the eigrp link on R2 which sets the forwarding address to 192.168.234.4. On R3 it's is setting the forwarding address to 0.0.0.0 R2 has a higher router-id of 200.200.200.200 and R3 has a router-id of 192.168.234.3. When I look at the ospf database for external networks and look specifically at the 4.4.4.4/32 network the LSA coming from R3 has the routing bit set so R1 is installing that route into the routing table. I would think that the routing bit would be set for the LSA coming from R2 since it has a higher router id. Can someone please explain why I am seeing this behavior. Below is the diagram. Please let me know what output you would like to see from the routers. Thank you

     

    image

     

  • Hi cristian and All,

    I agree.  With all you said.  

    My post is in reference to drbk563's topology, where R2 and R3 are ASBRs with R2 having an Area 0 configured on R2-R4 link, while R3-R4 does not.  Looking at my post, the topology I pasted is not fully labeled and only added confusion. Thank you for feedback and correction//RandyB


  • 6)compare metric to advertising router versus forwarding metric to forwarding address  <-- appears to be what you are hitting. I was taught that it chooses the path without the FA.-----no such thing, does not make any sense. <-- Well then perhaps I was misinformed during the INE bootcamp. Not trying to argue just want to make sure I understand the FA behavior. I through that in there because it contridicted the cisco doc that I linked. 


    7)N over E per RFC3103-----not true, it depends to which RFC the NSSA complies with, new or old RFC, long discussion <-- Agree but the cisco default is to be RFC3103 compliant is it not?

     

  • 6)compare metric to advertising router versus forwarding metric to forwarding address  <-- appears to be what you are hitting. I was taught that it chooses the path without the FA.-----no such thing, does not make any sense. <-- Well then perhaps I was misinformed during the INE bootcamp. Not trying to argue just want to make sure I understand the FA behavior. I through that in there because it contridicted the cisco doc that I linked. ------not sure who said what, or maybe it was missunderstood, but there is no path preference beween LSA5 with or without FA set.


    7)N over E per RFC3103-----not true, it depends to which RFC the NSSA complies with, new or old RFC, long discussion <-- Agree but the cisco default is to be RFC3103 compliant is it not?-------depending on the code you're running it may default to RFC3101 or RFC1587; with RFC3101, it prefers N path if P-bit is set, otherwise the E-path; this makes perfect sense as this is distance vector behaviour, for the ABR to make the 7/5 translation it has to actively use the N path, thus install it in the routing table.

     

Sign In or Register to comment.