OSPFv2: Database and SPF

When a router receives LSAs from a its neighbors it places them into the respective link-state database (LSDB) for that particular area.

The router then follows a procedure to calculate the best loop free path to each destination. This computation is called the shortest-path first (SPF or Dijkstra) algorithm and uses three databases to evaluate which routes are the most favoured to be installed in the routing table.

Each router applies this algorithm by calculating the least cost path to the root (itself) from each node that has been discovered via an LSA and installed in the LSDB.