Route calculation
OSPF computes routes in an area as follows:
Each router generates LSAs based on the network topology around itself, and sends them to other routers in update packets.
Each OSPF router collects LSAs from other routers to compose an LSDB. An LSA describes the network topology around a router, and the LSDB describes the entire network topology of the area.
Each router transforms the LSDB to a weighted directed graph that shows the topology of the area. All the routers within the area have the same graph.
Each router uses the SPF algorithm to compute a shortest path tree that shows the routes to the nodes in the area. The router itself is the root of the tree.