Tom Kelliher, CS 325
Apr. 25, 2008
Read 4.6.
IP protocol.
Routing in the Internet.
Hence, we only need consider routing between routers.
Minimizes hop count.
Maximizing use of high speed links.
Discourage use of certain links.
Example network represented as a graph:
The algorithm might be run at one centralized location or multiple sites.
Referred to as link state algorithms.
How is link state information acquired? How much overhead in acquiring this information?
Routers only know the cost of their directly-connected links, and share routing information with their neighbors.
After a number of iterations, routers converge on the least-cost routes.
Referred to as distance vector algorithms, as routers maintain a vector of distances (costs) to other routers.
If no such edge exists, the cost is infinity.
c(u, v) could differ from c(v, u).
f(v) will be the first-hop router for forwarding.
This differs slightly from the algorithm given in the textbook, which stores the next-to-last vertex along the path in p(v), requiring post-processing to determine the first-hop routers.
The algorithm:
N' = {u}; // u is the source vertex. for each vertex, v, in N D(v) = c(u, v); if c(u, v) is finite // D(v) is finite only for u's neighbors. f(v) = v; do find w not in N' such that D(w) is a minimum; add w to N'; for each neighbor, v, of w that is not in N' if D(w) + c(w, v) < D(v) D(v) = D(w) + c(w, v); f(v) = f(w); while (N' != N);An efficient implementation will be . (A poor implementation would be , emphasizing the importance of paying attention in algorithms class!)
This will be the result:
Oscillations can occur if link cost is based on link traffic. Consider this example:
(Assume that this traffic density is repeated for each routing cycle.)
A solution to this problem is to prevent the routers from running the routing algorithm simultaneously. If this is not done carefully, the routers will tend to self-synchronize.
It iterates until it converges upon the shortest paths, at which time it ceases execution, until a link cost changes.
d_x(y)
is the cost of the least-cost path from x
to y.
d_x(y) = min_v{c(x, v) + d_v(y)}where
min_v{}
is taken over all of x's neighbors.
This equation is the heart of the DV algorithm.
DV_x = {D_x(y): y in N}
is the vector of estimated
least-cost distances from x to all vertices y in N.
Over time, these estimates converge upon the actual least-cost distances.
for all vertices y in N D_x(y) = c(x, y); // If x and y aren't neighbors, this cost is // infinity. for each neighbor w and all vertices y D_w(y) = infinity; for each neighbor w send DV_x to w; while true wait until a link cost to a neighbor w changes or a neighbor w sends a new distance vector; for each y in N D_x(y) = min_v{c(x, y) + D_v(y)}; if D_x(y) changed for any vertex y for each neighbor w send DV_x to w;
Consider the following link cost changes, ignoring x:
Two iterations.
-- ``Count to infinity'' problem.
This specific problem can be fixed if z reports to y that its distance to x is infinity. In general, if a uses b to route to c, a should report to b that its distance to c is infinity -- eliminating such routing loops.
-- ``Poisoned reverse.''
Unfortunately, poisoned reverse doesn't work for routing loops involving three or more routers.
LS info exchanges would be prohibitive. DV algorithms would never converge.
ISPs should be able to hide details of their networks from each other.
Within an AS, LS or DV algorithms are used.
Between AS's, network connectivity information is exchanged. This info must be propagated from the gateway routers to the interior routers.