Distance Vector Routing (DVR) is a dynamic routing algorithm where routers determine the best path for data based on distance (usually hop count) and vector (direction/next-hop router). Each router shares its entire routing table with directly connected neighbors periodically, allowing them to calculate the shortest path to all destinations.
Distance-vector routing protocols measure the distance by the number of routers a packet has to pass; one router counts as one hop. Some distance-vector protocols also take into account network latency and other factors that influence traffic on a given route. To determine the best route across a network, routers using a distance-vector protocol exchange information with one another, usually routing tables plus hop counts for destination networks and possibly other traffic information. Distance-vector routing protocols also require that a router inform its neighbours of network topology changes periodically.
The term distance vector refers to the fact that the protocol manipulates vectors (arrays) of distances to other nodes in the network. The distance vector algorithm was the original ARPANET routing algorithm and was implemented more widely in local area networks with the Routing Information Protocol (RIP).
Simple to configure, low memory/computational requirements, and suitable for small networks.
Slow convergence (takes time to update all routers), prone to routing loops, and not scalable for large networks
Link state routing is
a dynamic routing method where each router builds a complete map (topology) of the network by exchanging status information about its directly connected links with all other routers. Using Dijkstra's algorithm, each router independently calculates the shortest path to every destination.
In link-state routing protocols, each router possesses information about the complete network topology. Each router then independently calculates the best next hop from it for every possible destination in the network using local information of the topology. The collection of best next hops forms the routing table.
This contrasts with distance-vector routing protocols, which work by having each node share its routing table with its neighbours. In a link-state protocol, the only information passed between the nodes is the information used to construct the connectivity maps.
Routers flood information about their neighbors, not their entire routing table, to all other routers.
Every router maintains an identical, synchronized database of the entire network structure.
When a network change occurs, routers quickly flood updates, allowing for rapid adaptation compared to distance-vector protocols.
Highly scalable for large networks, fast convergence, and reduced routing loops.
Requires more memory and CPU power to calculate routes and maintain the map
OSPF is essential for enterprise networks that need fast, reliable routing with efficient, fast convergence. It is a widely used link-state interior gateway routing protocol that calculates the shortest, most efficient path for data packets within an IP network, typically within a single autonomous system. It uses Dijkstra’s algorithm to determine routes, offering fast convergence, high scalability, and support for large, complex networks
Instead of sharing routing tables, OSPF routers share network topology information (Link State Advertisements - LSAs) to build a map of the network.
router calculates the best path independently based on a "shortest path first" approach.
OSPF improves scalability by dividing networks into areas. Area 0 (backbone) is mandatory,
It is vendor-neutral and supported by almost all network equipment providers.
Routers use Hello packets to find neighbors and establish adjacencies.