Adaptive Routing Proshanto Mukherji CSC 457: Computer Networks University of Rochester Introduction Networks are not static. They are subject to three classes of change: Topologies change as nodes are added and removed Traffic patterns change cyclically Overall network load changes So, routing algorithms that assume that the network is static don’t work in this setting Rotten Algorithms 1: DV 50 A C “I can reach C with cost 10” 20 Host Next Cost B B 20 C CB 50 30 10 B Host Next Cost A A 20 C C 10 Rotten Algorithms 2: LS “I see B (cost 10), and A (cost 50)” 50 A C “I see C (cost 10), and A (cost 20)” 20 10 50 A 20 10 C B Host Next Cost B B 20 C B 30 B Analyses Distance Vector: No. of messages: O( |E|.diam ) Size of each message: O( n ) Link State Diameter of graph Number of edges Number of hosts No. of messages: O( n.|E| ) Size of each message: O( e ) Edges per host Each generates O( n.|E| ) = O( n3 ) bytes of traffic! Perhaps ok for single execution, but not every time the load on the network changes When will you run the algorithm? A New Model We want instead to think of the routing protocol as always active Model the network as a dynamical system in the topology and link costs Q-Routing Qx(d, y) is the time that node x estimates it will take to deliver a packet to node d via its neighbor y When y receives the packet, it sends back a message (to node x), containing its (i.e. y’s) best estimate of the time remaining to get the packet to d, i.e. t = min(Qy(d, z)) over all z neighbors( y ) x then updates Qx(d, y) by: RTT: x y Time spent in queue at x [Qx(d, y)]NEW = [Qx(d, y)]OLD + .(s+q+t - [Qx(d, y)]OLD ) new estimate old estimate Q-Routing (contd.) message message to d y x Dest Next Qx(d, y) … d y 20 22 d w 21 … min(Qy(d, zi)) = 13; RTT = s = 11 Qy(d, z1) = 25 Qy(d, z2) = 17 Qy(d, ze) = 70 w [Qx(d, y)] += (0.25).[(11+17) - 20 ] Q-Routing (contd.) message to d y x Dest Next Qx(d, y) … d y 22 d w 21 … message w Qw(d, z1) Qw(d, z2) Qw(d, ze) Use this path next time Ants Ants Online: Routing Tables Each router x in the network maintains for each destination node d a list of the form: p = P(msg to d forwarded via y ) <d, <y1, p1>, <y2, p2>, …, <ye, pe>>, where y1, y2, …, ye are the neighbors of x, and p1 + p2 + …+ pe = 1 i This is a parallel (multi-path) routing scheme This also multiplies the number of degrees of freedom the system has by a factor of |E| i Ants Online: Generation Every destination host hd periodically generates an “ant” to a random source host hs An “ant” is a 3-tuple of the form: < hd, hs, cost> cost is a counter of the cost of the path the ant has covered so far Ants Online: Updation When a router x receives an ant < hd, hs, cost> from neighbor yi, it: 1. 2. Updates cost by the cost of traversing the link from x to yi (i.e. the cost of the link in reverse) Updates entry for host (<hd, <y1, p1>, <y2, p2>, …, <ye, pe>>) p = k / cost, for some k pi = pi + p 1 + p for j i, pj = normalizing sum of probabilities to 1 pj 1 + p Ants Online: Propagation (1) Two sub-species of ant: Regular Ants: P( ant sent to yi ) = pi Uniform Ants: P( ant sent to yi ) = 1 / e Regular ants use learned tables to route ants Uniform ants explore randomly Ants Online: Propagation (2) Regular Ants Uniform Ants Explore best paths very Explore all paths equally thoroughly; others hardly at all Propagate “bad news” extremely quickly, “good news” extremely slowly Propagate “good” and “bad” news equally fast Tends to find shortest paths Natural parallel (multi-path) routers Does not converge to QRouting Algorithm converges to QRouting in a static network Q-Routing vs. Ants Q-Routing only changes its currently selected route when the cost of that route increases, not when the cost of an alternate route decreases Q-Routing involves overhead linear in the volume of traffic in the network; ants are effectively free in moderate traffic Q-Routing cannot route messages by parallel paths; uniform ants can Summary Routing algorithms that assume a static network don’t work well in real-world networks, which are dynamic Adaptive routing algorithms avoid these problems, at the cost of a linear increase in the size of the routing tables Q-Routing is a straightforward application of QLearning to the routing problem Routing with ants is more flexible than Q-Routing Finis that’s all, folks