15-441 Computer NetworkingRoutingRouting Algorithm classificationDistance Vector Routing AlgorithmDistance Table: exampleDistance table gives routing tableDistance Vector Routing: overviewDistance Vector Algorithm:Distance Vector Algorithm (cont.):Distance Vector Algorithm: exampleSlide 11Distance Vector: link cost changesSlide 13Distance Vector: Split HorizonDistance Vector: Poison ReverseWhere Poison Reverse FailsGetting a datagram from source to dest.Slide 18Slide 19Slide 20RIP ( Routing Information Protocol)RIP (Routing Information Protocol)RIP: Link Failure and RecoveryRIP Table processingRIP Table example (continued)15-441 Computer NetworkingIntra-Domain Routing, Part IRIP (Routing Information Protocol)Lecture #9: 9-25-01 2RoutingGraph abstraction for routing algorithms:•graph nodes are routers•graph edges are physical links•link cost: delay, $ cost, or congestion levelGoal: determine “good” path(sequence of routers) thru network from source to dest.Routing protocolAEDCBF2213112535•“good” path:•typically means minimum cost path•other def’s possibleLecture #9: 9-25-01 3Routing Algorithm classificationGlobal or decentralized information?Global:•all routers have complete topology, link cost info•“link state” algorithmsDecentralized: •router knows physically-connected neighbors, link costs to neighbors•iterative process of computation, exchange of info with neighbors•“distance vector” algorithmsStatic or dynamic?Static: •routes change slowly over timeDynamic: •routes change more quickly•periodic update•in response to link cost changesLecture #9: 9-25-01 4Distance Vector Routing Algorithmiterative:•continues until no nodes exchange info.•self-terminating: no “signal” to stopasynchronous:•nodes need not exchange info/iterate in lock step!distributed:•each node communicates only with directly-attached neighborsDistance Table data structure •each node has its own•row for each possible destination•column for each directly-attached neighbor to node•example: in node X, for dest. Y via neighbor Z:D (Y,Z)Xdistance from X toY, via Z as next hopc(X,Z) + min {D (Y,w)}Zw==Lecture #9: 9-25-01 5Distance Table: exampleAEDCB781212D ()ABCDA1764B148911D5542Ecost to destination viadestinationD (C,D)Ec(E,D) + min {D (C,w)}Dw==2+2 = 4D (A,D)Ec(E,D) + min {D (A,w)}Dw==2+3 = 5D (A,B)Ec(E,B) + min {D (A,w)}Bw==8+6 = 14loop!loop!Lecture #9: 9-25-01 6Distance table gives routing tableD ()ABCDA1764B148911D5542Ecost to destination viadestination ABCD A,1D,5D,4D,4Outgoing link to use, costdestinationDistance tableRouting tableLecture #9: 9-25-01 7Distance Vector Routing: overviewIterative, asynchronous: each local iteration caused by: •local link cost change •message from neighbor: its least cost path change from neighborDistributed:•each node notifies neighbors only when its least cost path to any destination changes•neighbors then notify their neighbors if necessarywait for (change in local link cost of msg from neighbor)recompute distance tableif least cost path to any dest has changed, notify neighbors Each node:Lecture #9: 9-25-01 8Distance Vector Algorithm:1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = infty /* the * operator means "for all rows" */ 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor /* w over all X's neighbors */ XXXwAt all nodes, X:Distance Vector Algorithm (cont.):8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) 11 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 16 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 22 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 25 26 forever wXXXXXwwLecture #9: 9-25-01 10Distance Vector Algorithm: exampleXZ127YLecture #9: 9-25-01 11Distance Vector Algorithm: exampleXZ127YD (Y,Z)Xc(X,Z) + min {D (Y,w)}w==7+1 = 8ZD (Z,Y)Xc(X,Y) + min {D (Z,w)}w==2+1 = 3YLecture #9: 9-25-01 12Distance Vector: link cost changesLink cost changes:•node detects local link cost change •updates distance table (line 15)•if cost change in least cost path, notify neighbors (lines 23,24)XZ1450Y1algorithmterminates“goodnews travelsfast”Lecture #9: 9-25-01 13Distance Vector: link cost changesLink cost changes:•good news travels fast •bad news travels slow - “count to infinity” problem!XZ1450Y60algorithmcontinueson!Lecture #9: 9-25-01 14Distance Vector: Split HorizonIf Z routes through Y to get to X :•Z does not advertise its route to X back to Y•will this solve count to infinity problem? algorithmterminatesXZ1450Y60? ? ?Lecture #9: 9-25-01 15Distance Vector: Poison ReverseIf Z routes through Y to get to X :•Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z)•will this completely solve count to infinity problem? XZ1450Y60algorithmterminatesLecture #9: 9-25-01 16Where Poison Reverse Fails1111A•When link breaks, C marks D as unreachable and reports that to A and B•Suppose A learns it first•A now thinks best path to D is through B• A reports D unreachable to B and a route of cost=3 to C•C thinks D is reachable through A at cost 4 and reports that to B•B reports a cost 5 to A who reports new cost to C•etc...XBCDLecture #9: 9-25-01 17Getting a datagram from source to dest.IP datagram: 223.1.1.1223.1.1.2223.1.1.3223.1.1.4223.1.2.9223.1.2.2223.1.2.1223.1.3.2223.1.3.1223.1.3.27ABEmiscfieldssourceIP addrdestIP addrdata•datagram remains unchanged, as it travels source to destination•addr fields of interest here Dest. Net. next router Nhops223.1.1 1223.1.2 223.1.1.4 2223.1.3 223.1.1.4 2routing table in ALecture #9: 9-25-01 18Getting a datagram from source to dest.223.1.1.1223.1.1.2223.1.1.3223.1.1.4223.1.2.9223.1.2.2223.1.2.1223.1.3.2223.1.3.1223.1.3.27ABEStarting at A, given IP datagram addressed to B:•look up net. address of B•find B is on same net. as A•link layer will send
View Full Document