Course contents

Chapter 8: RoutingLesson 12 of 16

Distance vector vs link state

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
Distance vector and link state: two ways to learn routesDistance vector protocols such as RIP and EIGRP learn routes from neighbours' routing tables: routing by rumour. Link-state protocols such as OSPF and IS-IS flood link information so every router builds the same map and runs SPF itself.Distance vector (RIP, EIGRP)Shares its routing table with neighboursKnows distance and direction onlyTrusts what neighbours saySlower convergence, simpler, less CPURIP metric: hop countLink state (OSPF, IS-IS)Floods link information to the whole areaEach router builds the same map (LSDB)Runs Dijkstra SPF to find best pathsFast convergence, more CPU and memoryOSPF metric: cost (bandwidth)
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
Distance vector and link state compared; Distance vector (RIP); Advanced distance vector (EIGRP); Link state (OSPF). Knowledge: Neighbours' routing tables Neighbours' tables plus a topology table Full map of the area Updates: Entire table every 30 s Partial, triggered by change LSAs flooded on change, refreshed every 30 minutes Algorithm: Bellman-Ford DUAL Dijkstra SPF Metric: Hop count Bandwidth and delay by default Cost, from bandwidth Convergence: Slow Fast Fast Resources: Low Medium Higher CPU and memory Scaling: Small networks (15 hops) Large Large, with areas Administrative distance: 120 90 internal 110Distance vector (RIP)Advanced distance vector(EIGRP)Link state (OSPF)KnowledgeNeighbours' routingtablesNeighbours' tables plus atopology tableFull map of the areaUpdatesEntire table every 30 sPartial, triggered bychangeLSAs flooded on change,refreshed every 30minutesAlgorithmBellman-FordDUALDijkstra SPFMetricHop countBandwidth and delay bydefaultCost, from bandwidthConvergenceSlowFastFastResourcesLowMediumHigher CPU and memoryScalingSmall networks (15 hops)LargeLarge, with areasAdministrativedistance12090 internal110

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.