Distance Vector Algorithm (cont.):
9 wait (until I see a link cost change to neighbor V
10 or until I receive update from neighbor V)
12 if (c(X,V) changes by d)
13 /* change cost to all dest's via neighbor v by d */
14 /* note: d could be positive or negative */
15 for all destinations y: D (y,V) = D (y,V) + d
17 else if (update received from V wrt destination Y)
18 /* shortest path from V to some Y has changed */
19 /* V has sent a new value for its min DV(Y,w) */
20 /* call this received new value is "newval" */
21 for the single destination y: D (Y,V) = c(X,V) + newval
23 if we have a new min D (Y,w)for any destination Y
24 send new value of min D (Y,w) to all neighbors