OSPF Blog Content

OSPF - Open Shortest Path First

OSPF Explained Step By Step With Practicals From CCNA To CCIE Level

OSPF SPF Algorithm execution



Whenever there is a change in the topology, every router wants to find the best path to reach the subnet and runs SPF to make is successful
                * SPF calculates the best paths based on the topology that is described in the LSDB.
                * Changes in topology require SPF execution.
                * Only changed type 1 and type 2 LSAs trigger the SPF calculation

Router-1 SPF Algorithm
R1#show ip ospf statistics
         OSPF Router with ID (1.1.1.1) (Process ID 1)
Area 0: SPF algorithm executed 2 times
Summary OSPF SPF statistic
        SPF calculation time
Delta T          Intra D-Intra Summ         D-Summ         Ext         D-Ext         Total         Reason
00:01:33          4         0          0         0          0         0         4         R
00:00:51          0         4          0          0          0         0         4         R, N

Using this command we can check how many times SPF was executed and what was the reason

Inter-area changes
which are described in Inter-Area Prefix (Type 3) LSAs, do not trigger the SPF recalculation since the input information for the best path calculation remains unchanged. The router determines the best paths for interarea routes that are based on the calculation of the best path toward the ABR. The changes that are described in Inter-Area Prefix LSAs do not influence how the router reaches the ABR, so SPF recalculation is not needed

Filtering In OSPF



OSPF support two tyes of filtering
        * Database filtering
        * Routes filtering in Routing table

Database Fitlering
<>

Routes Filtering
This is standard way to filter routes in any protocol
Using distribute list we can filter Routes present in database, but cant filter database using that
In OSPF When we use distrbute list, that effect only that routing table, other routers use database to build routing table

Lets fitler routes on Router-1 using distribute List

Router-1 Commands
access-list 1 permit 5.0.0.0 0.255.255.255

route-map filter deny 10
match ip address 1
exit
route-map filter permit 20
exit

router ospf 1
distribute-list route-map filter in
exit

Lets check the database and routing table

Router-1 Database
R1#show ip ospf data
         OSPF Router with ID (1.1.1.1) (Process ID 1)
                 Router Link States (Area 0)...
                 Net Link States (Area 0)...
                 Summary Net Link States (Area 0)...

         Type-5 AS External Link States
Link ID          ADV Router          Age          Seq#          Checksum Tag
5.0.0.0          2.2.2.2          532          0x80000001 0x000186 0
35.0.0.0          2.2.2.2          532          0x80000001 0x0079EF 0


Router-1 Routing table
R1#show ip route

Gateway of last resort is not set

         1.0.0.0/32 is subnetted, 1 subnets
C         1.1.1.1 is directly connected, Loopback0
         2.0.0.0/32 is subnetted, 1 subnets
O     IA     2.2.2.2 [110/2] via 12.0.0.2, 00:00:06, FastEthernet0/0
         3.0.0.0/32 is subnetted, 1 subnets
O     IA          3.3.3.3 [110/3] via 12.0.0.2, 00:00:06, FastEthernet0/0
         4.0.0.0/32 is subnetted, 1 subnets
O         4.4.4.4 [110/2] via 14.0.0.4, 00:00:06, FastEthernet1/0
         6.0.0.0/32 is subnetted, 1 subnets
O         6.6.6.6 [110/3] via 14.0.0.4, 00:00:06, FastEthernet1/0


Here we can see the route is filtered by the routing table but still present in Database, because using distribute list here working on routing table not on database.

        
image
image
image
image