distance-vector routing
Imagine you are lost in a city with no map, but you can ask the people standing at each intersection. You ask a neighbor, 'How far is the train station from here, and which way?' Each neighbor answers with their own best guess. You take the neighbor whose answer (plus the walk to reach them) is smallest, and you keep refining as people update their estimates. Distance-vector routing is this 'ask the neighbors' approach — no router ever sees the whole map.
Concretely, each router keeps a vector (a list) of its current best-known cost to every destination, and periodically tells each neighbor that whole vector. When a router x hears neighbor v claim a cost D_v(y) to reach destination y, x reasons: my cost to y via v is c(x, v) + D_v(y), the cost to reach v plus v's cost from there. x takes the minimum of that over all its neighbors v — this is the Bellman-Ford update. Repeat as advertisements arrive, and the estimates settle to the true least-cost distances. Crucially, a router only learns distances and a direction (which neighbor to send to), never the full topology.
The appeal is simplicity and small state: a router talks only to its direct neighbors and stores only distances, not a global map. RIP, an old and still-seen interior gateway protocol, is a distance-vector protocol that uses hop count as cost.
An honest caveat: distance-vector's gossip can spread bad news slowly and loop. When a link fails, routers can keep believing each other's now-stale promises, slowly counting their distance estimates upward — the notorious count-to-infinity problem. Partial cures (split horizon, poison reverse) and a small 'infinity' (RIP caps at 16) tame it but do not fully cure it, which is one reason large networks prefer link-state.
x has neighbors v and w with c(x,v)=1, c(x,w)=5. v advertises distance 2 to destination y; w advertises distance 1 to y. x computes min(1+2, 5+1) = 3 via v, so x's best route to y is through v at cost 3.
Each router picks the neighbor minimizing (cost to neighbor + neighbor's advertised distance) — the Bellman-Ford update.
A router running distance-vector knows only 'how far and through which neighbor', never the full path or topology. That ignorance is both its simplicity and its weakness (count-to-infinity).