cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1321
Views
5
Helpful
10
Replies

OSFP database - feasible routes with cost

SJ K
Level 5
Level 5

Dear all,

I have 2 OSPF peers (PeerA and PeerB) connected to one another via 2 x equal cost links.
Each link is a /30 and all the interfaces are in the same area0

 

PeerB has re-distributed a static route to networkX (172.16.2.0/24) over to PeerA   (type-1 default metric)


On PeerA, when issuing

show ip route

 

I can see that there are 2 equal cost O E1 routes to network X

PeerA
O E1     172.16.2.0
           [110/21] via 200.200.200.201, 04:28:49, GigabitEthernet1/0/6
           [110/21] via 100.100.100.101, 04:26:40, GigabitEthernet1/0/5

 

When i adjust the cost of interface gi1/0/6 to a higher cost (e.g int gi1/0/6 -> ip ospf cost 50),  the 2nd route via gi1/0/6 disappear from the show ip route table due to its higher cost.

When i issue other show ip ospf database commands, i am not able to actually see the 2nd route via gi1/0/6 anymore.
PeerA and PeerB are still adjacent neighbours with FULL status.

Neighbor ID     Pri   State           Dead Time   Address         Interface
0.0.0.2           1   FULL/BDR        00:00:38    200.200.200.201 GigabitEthernet1/0/6
0.0.0.2           1   FULL/BDR        00:00:37    100.100.100.101 GigabitEthernet1/0/5

 

I am sure each link in PeerB is adverting the same networkX / external LSA to Peer A.  But on PeerA i am only able to see 1 external LSA for networkX  172.16.2.0/24

e.g. show ip ospf database external

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

                Type-5 AS External Link States

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 1394
  Options: (No TOS-capability, No DC)
  LS Type: AS External Link
  Link State ID: 172.16.2.0 (External Network Number )
  Advertising Router: 0.0.0.2
  LS Seq Number: 80000157
  Checksum: 0x6CC4
  Length: 36
  Network Mask: /24
        Metric Type: 1 (Comparable directly to link state metric)
        MTID: 0
        Metric: 10
        Forward Address: 0.0.0.0
        External Route Tag: 0

 

Q1) is peer B advertising one or two Type 5 LSA for network 172.16.2.0/24 to peer A ?  Since Peer B has 2 connections /30 network to Peer A in the same area.

 

Q2) How do i see the feasible (2nd) route to network 172.16.2.0/24 that is now configured with a higher cost ? Although it is not inside the current routing table,  is it still store in the OSPF database ?

 

Regards,

Noob

10 Replies 10

Joseph W. Doherty
Hall of Fame
Hall of Fame
I believe OSPF is not like EIGRP, in that it doesn't keep less feasible routes. If the best route is lost, OSPF needs to recalculate a replacement.

Hi Joseph,

 

Good to see you around.

I also realize another behaviour which i am not sure if it is intended.

 

I have change PeerB to redistribute its static route (172.16.2.0/24) as a type-2.  So right now in PeerA, the routing table looks like this

 

O E2     172.16.2.0
           [110/20] via 200.200.200.201, 00:00:02, GigabitEthernet1/0/6
           [110/20] via 100.100.100.101, 00:00:02, GigabitEthernet1/0/5

The cost is a straight out 20.  It doesn't factor in the cost for the link (cost=1) between Peer A and B.

 

Base on this theory,  if the cost of the interface is no longer use for calculating the final cost,  adjusting the cost of the interface won't make a difference for a type-2 redistributed route.

 

However, when i change the cost of the interface in gi1/0/6 to > 1 (int gi1/0/6 -> ip ospf cost 10), the route is removed from the routing table.

O E2     172.16.2.0
           [110/20] via 200.200.200.201, 00:00:02, GigabitEthernet1/0/6 << no longer showing
           [110/20] via 100.100.100.101, 00:00:02, GigabitEthernet1/0/5

 

if a Type-2 LSA5 has a fix metric/cost (default=20),  why does changing the interface cost cause it to be removed ?

 

Is my understanding about Type-2 external LSA wrong ?

 

Regards,

Noob

 

Hello SJ,

 

E1 = Cost of entire path to ASBR

E2 = Default metric @ redistribution

 

OSPF makes path decisions based on the OSPF metric.  If you have identical metrics, you have accomplished ECMP and it will share traffic across both links equally. 

 

If you make 1 metric more favorable over the other, then it will use the more favorable metric only.  You should still be able to see both paths in the OSPF DB, but only 1 route.

 

If you use E2, then the metric for both paths will be 20 (in your case). However, if you manipulate your intra-area cost, you will still make 1 path more favorale over the other.

 

If you use E1, then it will take int account the inter-area cost fo the path to the ASBR.

mmanthe
Level 1
Level 1

you can usually routes not installed in the RIB via OSPF with:

 

SHO IP OSPF RIB

 

The OSPF database is *not* a database of routes - it is a database showing how SPT is solved between nodes in an area and between areas and to ASBRs for off-domain routing. The 'ext' (LSA 5) portion of the database should never show 2 paths from the same RID to a given destination. It only shows the LSID (prefix) as it is associated with the ID (not route) of the advertising router. You recurse from there to find both paths. In this case, LSA5 is advertised via 0.0.0.2. You then recurse from there to see if there is an LSA1 entry for ID 0.0.0.2. THAT entry will show you both of your transit paths...and so on.

Hi Mmanthe,

 

Thanks for your reply.

The 'ext' (LSA 5) portion of the database should never show 2 paths from the same RID to a given destination.

Can i check in actual scenario, does the adv router actually send 2 x Type5 LSA (1 down each link) to its peer ? (even though in the receiving Peer, it will only show 1 entry for that Type5 LSA in show ip ospf database external)

 

Regards,

Noob

 


@SJ K wrote:

Hi Mmanthe,

 

Thanks for your reply.

The 'ext' (LSA 5) portion of the database should never show 2 paths from the same RID to a given destination.

Can i check in actual scenario, does the adv router actually send 2 x Type5 LSA (1 down each link) to its peer ? (even though in the receiving Peer, it will only show 1 entry for that Type5 LSA in show ip ospf database external)

 

Regards,

Noob

 


No - there would not be more than 1 Type 5 LSA sent. You must stop thinking of LSAs as route advertisements like EIGRP or RIP - they are *not*. LSAs are just the bits and pieces that OSPF uses to build a topology graph. Once that graph is built (and relevant data extracted from the LSAs such as metrics, SPT calculations, etc.), then the NLRI is gleaned from the data in the LSAs (as it pertains to the topology it has built) and routes are created and put into the RIB (or not).

 

In your case, the type 5 LSA tells you that the advertising router ID is the one who you would go to to get to the 'external' subnet. Well then, how do I get to that advertising router? Well - in your case you look to see if you have a type 1 'router' LSA to that router ID. Do you? Yes! So you then look at that type 1 LSA for the advertising router and see what it tells you about the transit links to that router ID. Does it show you both of those transit links? Most likely - yes (it will also show the different metrics for each transit link). THAT's how you determine that there are 'technically' 2 paths to your external subnet. It is - like I mentioned earlier - a matter of recursing through the LSAs to 'weed out' the NLRI.

 

Hope this helps...

Hi Mmanthe,

 

Thanks again for the reply.

 



No - there would not be more than 1 Type 5 LSA sent. You must stop thinking of LSAs as route advertisements like EIGRP or RIP - they are *not*. LSAs are just the bits and pieces that OSPF uses to build a topology graph. Once that graph is built (and relevant data extracted from the LSAs such as metrics, SPT calculations, etc.), then the NLRI is gleaned from the data in the LSAs (as it pertains to the topology it has built) and routes are created and put into the RIB (or not).

 

In your case, the type 5 LSA tells you that the advertising router ID is the one who you would go to to get to the 'external' subnet. Well then, how do I get to that advertising router? Well - in your case you look to see if you have a type 1 'router' LSA to that router ID. Do you? Yes! So you then look at that type 1 LSA for the advertising router and see what it tells you about the transit links to that router ID. Does it show you both of those transit links? Most likely - yes (it will also show the different metrics for each transit link). THAT's how you determine that there are 'technically' 2 paths to your external subnet. It is - like I mentioned earlier - a matter of recursing through the LSAs to 'weed out' the NLRI.

 

Hope this helps...


Yes.. i check that there are 2 paths

 

Coreswitch#show ip ospf database router adv-router 0.0.0.2

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

                Router Link States (Area 0)

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 1451
  Options: (No TOS-capability, No DC)
  LS Type: Router Links
  Link State ID: 0.0.0.2
  Advertising Router: 0.0.0.2
  LS Seq Number: 80000247
  Checksum: 0x1A6B
  Length: 48
  AS Boundary Router
  Number of Links: 2

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 100.100.100.102
     (Link Data) Router Interface address: 100.100.100.101
      Number of MTID metrics: 0
       TOS 0 Metrics: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 200.200.200.202
     (Link Data) Router Interface address: 200.200.200.201
      Number of MTID metrics: 0
       TOS 0 Metrics: 1

Sorry i am still not very sure on this part.. Since there are actually two paths,  which path will the advertising router use to send the Type-5 LSA to the receiving router ?

Regards,

Noob

“Since there are actually two paths,  which path will the advertising router use to send the Type-5 LSA to the receiving router ?”

 

That will depend on the metrics. In your case, it looks like both links have the same (OSPF) metrics. If that’s true, they’ll both be installed in the RIB and both be used as ECMP. So, if that’s the case - it’ll be up to CEF which link will be used for any given LSA exchange (or any packets for that matter) . OSPF is out of the picture at that point. 

Hi mmanthe,

Thanks for your reply.

Just to clarify, i am not referring to the actual traffic data.
Do you mean if the links has a different cost , the type5 LSA will be only send via the link with a lower cost (from the adv to the rcv peer) ? or the type5 LSA will be send via both links regardless the cost of the link ?

Regards,
Noob


@SJ K wrote:
Hi mmanthe,

Thanks for your reply.

Just to clarify, i am not referring to the actual traffic data.
Do you mean if the links has a different cost , the type5 LSA will be only send via the link with a lower cost (from the adv to the rcv peer) ? or the type5 LSA will be send via both links regardless the cost of the link ?

Regards,
Noob

No - if the links have different OSPF metrics (cost), then only the one with the lower cost will potentially be installed in the RIB. I only gave you the ECMP example because the the Type1 LSA you showed me had an equal metric for both transit links.

 

Also - remember that the the Type5 LSA in this case does not represent a route (it doesn't 'send' anything anywhere). It just tells OSPF which Type1 LSA to look at (by way of the advertising Router ID) to then find out which transit links it has available and what the metrics/costs are for those links. OSPF uses that recursed information to build a composite 'route' that it then presents to the the router's control plane as a candidate for RIB entry.

 

The exception to this is when there is a Type5 LSA that has been translated from a Type7 LSA that has a Forwarding Address that is *not* all 0s. But that's a whole different thing....

Review Cisco Networking for a $25 gift card