How RIP, EIGRP and OSPF learn routes: split horizon, counting to infinity, LSAs and SPF, compared side by side.
Intermediate · 9 min read
Technical definition
Distance vector and link state are the two main ways an interior routing protocol learns routes. A distance-vector router shares its routing table with neighbours; a link-state router floods link information so that every router in the area builds the same map and computes its own best paths.
Two ways to learn a route
Distance vector and link state: two ways to learn routes
OSPF is link-state; RIP is distance vector; EIGRP is an advanced distance vector (sometimes called hybrid). BGP is a path-vector protocol.
Distance vector: routing by rumour
A distance-vector router knows only what its neighbours tell it: a destination, a distance (the metric) and a direction (the next hop). It does not see the whole network. RIP version 2, for example, sends its table to the multicast address 224.0.0.9 every 30 seconds, counts hops, and treats 16 hops as unreachable.
Because routers trust their neighbours, loops are a risk. Distance-vector protocols use several guards:
Split horizon: do not advertise a route back out the interface it was learned on.
Route poisoning: advertise a failed route with an infinite metric (16 in RIP).
Hold-down timers: ignore worse information about a route for a while after it fails.
Counting to infinity: without these guards, routers can keep raising the metric of a dead route between them; the maximum hop count stops it.
Link state: everyone has the map
A link-state router describes its own links in a Link State Advertisement (LSA) and floods it to every router in the area. Each router stores the advertisements in a link-state database, which is the same on every router in the area, and runs the Dijkstra shortest path first (SPF) algorithm on it. The result is a loop-free tree with the router at the root.
OSPF and IS-IS are the link-state protocols you will meet.
A change is flooded as soon as it happens, not on a timer.
Areas keep the database small by limiting how far detail travels.
Compared
Distance vector and link state compared
On small screens, swipe sideways or focus the diagram and use the arrow keys.
The distance-vector protocol column is RIP; EIGRP is shown separately because it is neither classic distance vector nor link state.
Choosing
Small, simple networks can use static routes or RIP. Most enterprise networks use OSPF or EIGRP. The CCNA exam concentrates on OSPF, so continue with the OSPF course.
Test yourself
Predict · scenario 1
Which routing protocol type builds a full map of the area and runs SPF?
Predict · scenario 2
What does split horizon prevent?
Predict · scenario 3
How many hops makes a RIP route unreachable?
FAQ
Is EIGRP distance vector or link state?
Cisco calls it an advanced distance-vector (or hybrid) protocol. It shares routes with neighbours like a distance-vector protocol but uses DUAL for loop-free fast reconvergence, and sends partial updates instead of full tables.
Which converges faster?
Link-state protocols usually do, because a topology change is flooded immediately and every router recomputes at once. Classic RIP waits for update timers and hold-down mechanics.
Is BGP distance vector?
BGP is a path-vector protocol: like distance vector it learns from neighbours, but it carries the full list of autonomous systems a route passed through to prevent loops.