What is the difference between distance-vector and link-state routing?
MediumConceptRouting Protocols
Answer
In distance-vector routing, each router knows only its distance (cost) to every destination and which neighbour to use, and it periodically shares its whole table with its neighbours. In link-state routing, each router floods information about its own links to every router, so all routers build the same map of the network and compute shortest paths themselves.
| Distance vector | Link state | |
|---|---|---|
| Knowledge | neighbours' tables only | full topology |
| Algorithm | Bellman-Ford | Dijkstra |
| Typical metric | hop count | link cost based on bandwidth |
| Convergence | slow; count-to-infinity possible | fast |
| Resources | little memory and CPU | more memory and CPU |
| Example | RIP | OSPF, IS-IS |
- Distance vector is often called "routing by rumour", because a router trusts whatever its neighbours report.
- Between autonomous systems (networks run by different organisations), the internet uses BGP, a path-vector protocol that advertises the full list of networks a route passes through.
Example: Finding a railway station in a new city: distance vector is asking the person at each junction "how far is the station from here?" and trusting the answer; link state is giving everyone the full city map so each can work out the shortest route alone.