Interview Q&A / Computer Networks

IntermediateQuick answer1 min readUpdated 3 Oct 2026

What is the difference between distance vector and link state routing protocols?

SHORT ANSWER

Distance vector protocols like RIP share their routing table with neighbours and trust what they hear (routing by rumour). Link state protocols like OSPF flood the full network map to everyone, and each router computes shortest paths itself with Dijkstra's algorithm.

Explain it simply

Distance vector is asking a friend for directions and trusting "go via me, it is 5 km". Link state is everyone getting the same road map and working out the route themselves.

Example

text
                 Distance vector (RIP)        Link state (OSPF)
Shares           routing table with neighbours link descriptions, flooded to all
Metric           hop count (max 15)            cost, based on link bandwidth
Algorithm        Bellman-Ford                  Dijkstra (SPF)
Updates          periodic (30 s in RIP)        on change
Convergence      slower, loops possible        faster
Scale            small networks                large networks, with areas

Distance vector's weakness is count-to-infinity: bad news travels slowly, and routers can loop temporarily. RIP treats 16 hops as unreachable to stop the counting. Link state needs more memory and CPU, but every router sees the same map, so it converges quicker and avoids such loops.

Both are interior gateway protocols, used inside one organisation. BGP is used between organisations.

What to say in the interview

"Distance vector routers know only distances and next hops told by neighbours. Link state routers have a complete topology map and run Dijkstra. OSPF converges faster and scales better; RIP is simple but limited to 15 hops."

Common mistakes

  • Saying RIP uses bandwidth as its metric. It counts hops.

#routing#rip#ospf

Related questions

Practise more Computer Networks questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Computer Networks quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.