Friday, February 17, 2012

OSPF Basics

Lets take a very basic question on OSPF which requires an explanation

Q: OSPF being a link state routing protocol prepares Link State Database. I would like to understand, if OSPF advertises and redistributes routes from its Link State Database table or from its Routing Table.

A: Within the ospf flooding domain or an area ospf process exchanges LSA's (LSA type1, LSA type 2) and based on that all the ospf running routers maintain the same copy of the LSDB. Now it is upto the individual router which runs independent spf calculation for selecting the best route to reach a perticular destination.

But when ospf process needs to send an LSA (type 3,4) outside its own area it behaves like a distance vector becuase the other area routers when receives a summary LSA (type3,4) they believe on the ABR which sends those LSA into the area so these routers just need to run spf to determine cost to reach to the ABR that means these routers adds up the cost (what ABR is advertising plus cost to reach to the ABR) to reach to the routes in the other area. So technically its wrong to say aospf is advetising routes because ospf just exchanges LSAs i.e within area type 1 and 2 while from other area type 3 and 4. 

Now if you are considering redistribution of ospf process into some other IGP(RIP,EIGRP etc or other OSPF process), the redistribution will always performs from the ospf routing table i.e "show ip route ospf". In this by default "show ip route ospf" routes and "show ip ospf interface br" routes will be redistributed from ospf process to other IGP and these ospf routes will end up in the database of other IGP on the device on which redistribution is performed. The other IGP domain will then select the best path based on its best path selection procedures.