OSPF is a link-state routing protocol that uses flooding to distribute link state advertisements (LSAs) throughout an autonomous system. Each router runs Dijkstra's algorithm on its link state database to determine the shortest path to all known networks. OSPF routers establish adjacencies to exchange LSAs and maintain an identical link state database, allowing each router to independently calculate optimal routes.