OSPF is definitely the most sophisticated internal routing protocol. There is a lot of things which distinguishes its from the other and one of them is complexity. It is very important to understand how works, how neighborhood is established, how OSPF packets flow in order to troubleshoot and debug its.
OSPF Link State Advertisement (LSA) Packets and Link State Database (LSDB)
LSA Packets are used by OSPF in order to build its own LSDB. LSDB is counterpart of Topology Table in EIGRP. Based on LSDB, the router builds the routing table with the most adequate paths. Each router in domain needs to have the same LSDB – “Topology Table” before Djikstra algorithm starts to calculate best paths. Routers exchange theirs DBD (Data Base Descriptions) which contains LSA headers only. If any router doesn’t have idea about given network (DBD received from the neighbor is different then it stores in its memory) then sends LSR (Link State Requests) towards the router which sent DBD with given route in order to get more data. Querying router sends to the asking router LSU (Link State Update) packets with full information. Then router which obtained LSU packet sends LSAck (Link State Acknowledgement) and puts obtained information into its LSDB. Something like 3 way handshake during TCP conversation isn’t it ? Let’s have a look on the picture below.
Simple, so where is the complexity ? Because in OSPF we have AREAS which have been roughly invented in order to limit LSA packets flow, we distinguish a several types of LSA packets :
LSA 1 : ROUTER LSA – send only between 2 routers connected directly
LSA 2 : NETWORK LSA – send between routers in shared (multi-access) network (generates by Designated Router)
LSA 3 : SUMMARY (ABR SUMMARY ROUTE). It has nothing to do with prefixes summarization! LSA type 3 packets are being sent in order to enable the other routers in different OSPF Areas getting to know about prefixes in other Areas.
LSA 4 : SUMMARY (ASBR LOCATION). LSA type 4 lets to know routers in different Areas about connected networks in different routing protocols (points out where are ASBRs)
LSA 5 : EXTERNAL LSA ( ASBR SUMMARY ROUTE) . Contains information about routes and networks which originate from different routing protocols.
LSA 7 : Not-So-Stubby-Area LSA. Are propagated by ASBRs and are being changed into type 5 on the ABR, on the point of contact with Area 0
Here is a graphical explanation how LSA packets flow. I also changed AREA2 into NSSA area in order to see how LSA type 7 are generated and changed into LSA 5:
Above behaviour, regarding LSA packets takes place “out of the box”, immediately after OSPF implementation. As you can see, the flood of LSAs packets can be really large, especially if we assume having 40 routers in each Area. LSAs traffic may kill the network or limits significantly its performance. As a remedy, 4 types of Areas: 2 regarding ABR and 2 regarding ASBR have been invented, if we want to raise performance and limit LSA packets flood. Two of them, Tottaly Stub and Totaly Not So Stubby Area are Cisco proprietary.
ABR AREAS:
STUB AREA – routers in stub area don’t obtain external routes from ASBR (LSA type 4 and 5) only LSA type 3 (Summary LSA). Do we need to know where are placed ASBRs and theirs networks? We don’t need to, because we need to only get out of our Area and the routing process on further routers does everything properly. There are no other Areas behind our own, so we have only one path to get out. The configuration is really simple and boils down to running a command “area 1 stub” on ABR and each router in area 1 under ospf process.
TOTALLY STUBBY – totally stub is going one step further and put a question: Do we need any LSA packets at all? Everything what routers in totally stub area have to know is default route to the nearest ABR (which is the only gateway to the outside world). So there are no LSA 3,4,5 packets! Only default route to the ABR. To configure the area as totally stub, we have to run “area 1 stub” on each router in the area 1 and “area 1 stub no-summary” on the ABR router
ASBR AREAS:
NSSA (NOT SO STUBBY AREA) – There is no LSA 5 packets flood within NSSA area .LSA 5 packets are being changed into LSA 7. Those packets are being flooded further into the other Areas but firstly are changed into LSA5 on the ABR. Also LSA 4 will be blocked on ABR, there is no need to broadcast information about ASBR routers in other Areas since LSA type 5 with external routes has been flooded into them. To configure we run command “area 2 nssa” on each router within Area2 including ASBR and ABR.
TOTALLY NSSA (TOTALLY NOT SO STUBBY AREA) – the same rules alike NSSA but besides lack of LSA type 4 and 5 we get rid of LSA type 3. In return we have default route to the ABR. To configure we run “area 2 nssa” on each router within Area 2 and “area 2 nssa no-summary” on the ABR router.
As you see Stub is similar to NSSA and Totally Stub similar to Totally NSSA.