OSPF is a more advanced interior gateway routing protocol. Unlike RIP, which is a distance-vector protocol, OSPF is a link-state protocol. Instead of determining the best route by looking at the distance (number of hops), link-state protocols run a shortest-path first (SPF) algorithm to create a database of the network's topology and, from that database, to determine the best (that is, shortest) path to a destination.
The nice thing about OSPF is that not only can hops be used as metrics, as in RIP, but you can set OSPF to determine the best path. The best path might use the fewest number of hops or the highest bandwidth links, while using one route for multicast and another for regular unicast packets. Setting up all this multi-topology OSPF routing is a lot of work, but doing so is often worth the effort.
As an IGP, OSPF operates within a single network administrative boundary or domain, which is sometimes called an autonomous system (AS).
Each router running OSPF goes through the following process to discover the network topology and determine the best path to each destination:
The router runs the Dijkstra SPF calculation to determine the shortest path to each destination in ...