Distance vector protocols Distance Vector routing principles Routing loops and countermeasures to loops Bellman-Ford algorithm RIP, RIP-2 DV-1 S-38.2121 / Fall-06 / RKa, NB Distance Vector Routing Principles DV-2 S-38.2121 / Fall-06 / RKa, NB
Distance Vector Routing • Distance vector (DV) protocols are based on Routing table: the Bellman-Ford algorithm E to Link Distance • The routing table contains information E - 0 about other known nodes B 4 1 A 4 2 – link (interface) identifier D 6 1 – distance (cost) in hops C 5 1 • The nodes periodically send distance vectors based on the routing tables on all their links Distance vector: E=0, B=1, A=2, D=1, C=1 • The nodes update their routing table with received distance vectors • Routing Information Protocol (RIP) is a basic distance vector protocol DV-3 S-38.2121 / Fall-06 / RKa, NB Let us study the principles of DV protocols 1 2 Example network with nodes A, B, C, D, E A B C and links 1, 2, 3, 4, 5, 6. The cost of each link is 1. 3 4 5 D E Initial state: Nodes know their own addresses 6 and interfaces, nothing more. Node A creates its routing table: From node A to … Link Distance A - (local) 0 The corresponding distance vector (DV) is: A=0 DV-4 S-38.2121 / Fall-06 / RKa, NB
Generation of routing tables starts when all routers send their DVs on all interfaces Let’s look at reception in Node B. First the table of B is: 1 2 From node B to … Link Distance A B C B - 0 A=0 A=0 3 4 5 1. B receives the distance vector A=0 B increments the DV with +1 ÿ A=1 2. 3. B looks for the result in its routing table, no match D E 6 4. B adds the result to its RT, the result is From node B to … Link Distance B - 0 A 1 1 5. B generates its distance vector B=0, A=1 DV-5 S-38.2121 / Fall-06 / RKa, NB B creates its own DV and sends it to all neighbors C to Link Distance C - 0 B=0, A=1 A to Link Distance B 2 1 1 2 A - 0 A B C A 2 2 B 1 1 4 3 5 E to Link Distance D E A=2 > A=0 E - 0 6 B 4 1 A 4 2 DV-6 S-38.2121 / Fall-06 / RKa, NB
D sends its distance vector to all neighbors A to Link Distance 1 2 A - 0 A B C B 1 1 3 4 5 D 3 1 E to Link Distance D E E - 0 6 B 4 1 D=0, A=1 A 4 2 D 6 1 A=2 == A=2 ÿ no change DV-7 S-38.2121 / Fall-06 / RKa, NB The nodes whose RT changed create DVs and send them to neighbors A=0, B=1, D=1 1 2 A B C B to Link Distance 3 4 5 B - 0 D E 6 A 1 1 C=0, B=1, A=2 A B C D 1 2 1 2 C 2 1 3 4 5 E 4 1 D E 6 E to Link Distance D to Link Distance 1 2 E - 0 A B C D - 0 B 4 1 A 3 1 3 4 5 A 4 2 B 3 2 D E D 6 1 6 E 6 1 E=0, B=1, A=2, D=1 C 5 1 DV-8 S-38.2121 / Fall-06 / RKa, NB
Again the changes are sent ... B=0, A=1, D=2, C=1, E=1 1 2 C to Link Distance A B C A to Link Distance C - 0 A - 0 3 4 5 B 2 1 B 1 1 D E A 2 2 6 D 3 1 1 2 E 5 1 A B C C 1 2 D 5 2 3 4 5 E 1 2 D E D=0,A=1,B=2,E=1 6 D to Link Distance 1 2 A B C D - 0 3 4 5 A 3 1 A, D, and C create new B 3 2 D E DVs, send them, but 6 E=0,B=1,A=2, D=1,C=1 E 6 1 they have no impact. C 6 2 DV-9 S-38.2121 / Fall-06 / RKa, NB Processing of received distance vectors D = destination Legend: D = destination Legend: RT Routing Table d = distance + 1ink cost RT Routing Table d = distance + 1ink cost RT(dest) RT-entry RT(dest) RT-entry L = link of reception L = link of reception RT(dest, x) Field x of the entry RT(dest, x) Field x of the entry Yes D ⊂ RT D ⊂ RT No L==RT(D, l ) L==RT(D, l ) No d < RT(D, d ) d < RT(D, d ) Yes Add (D,L,d) to RT Add (D,L,d) to RT Yes Update RT(D) = (D,L,d) Update RT(D) = (D,L,d) Note: this is simplified, shows only the principle! DV-10 S-38.2121 / Fall-06 / RKa, NB
A link breaks... DV-11 S-38.2121 / Fall-06 / RKa, NB A round of updates starts on link failure A gives an infinite A to Link Distance B to Link Distance distance to the nodes A - 0 B - 0 reached through link 1 B 1 Inf. A 1 Inf. D 3 1 D 1 Inf. C 1 Inf. C 2 1 E 1 Inf. E 4 1 B=0,A=inf,D=inf,C=1,E=1 1 2 A B C A=0,B=inf,D=1,C=inf,E=inf 3 4 5 D E 6 DV-12 S-38.2121 / Fall-06 / RKa, NB
D, E and C update their routing tables B=0,A=inf,D=inf,C=1,E=1 A=0,B=inf,D=1,C=inf,E=inf C to Link Distance +1 = 1 2 A B C C - 0 A=1,B=inf,D=2,C=inf,E=inf B 2 1 3 4 5 A 2 Inf. D E 6 E 5 1 D 5 2 D to Link Distance E to Link Distance D - 0 E - 0 if L==RT(D, l) the routing A 3 1 B 4 1 table is updated even if B 3 Inf. A 4 Inf. the new distance is longer! E 6 1 D 6 1 (see ”processing of received C 6 2 C 5 1 distance vectors”) DV-13 S-38.2121 / Fall-06 / RKa, NB D, C, E generate their distance vectors... B to Link Distance B - 0 A to Link Distance A 1 Inf. A - 0 D 4 2 B 1 Inf. C 2 1 D 3 1 E 4 1 C 3 3 1 2 A B C C=0,B=1,A=inf,E=1,D=2 E 3 2 3 4 5 D E D=0,A=1,B=inf,E=1,C=2 E=0,B=1,A=inf,D=1,C=1 6 D to Link Distance E to Link Distance D - 0 E - 0 A 3 1 B 4 1 B 6 2 A 6 2 E 6 1 D 6 1 C 6 2 C 5 1 DV-14 S-38.2121 / Fall-06 / RKa, NB
A, B, D, E generate their distance vectors A to Link Distance B to Link Distance C to Link Distance A - 0 B - 0 C - 0 B 3 3 A 4 3 B 2 1 D 3 1 D 4 2 A 5 3 C 3 3 C 2 1 E 5 1 E 3 2 E 4 1 D 5 2 B=0,A=inf,D=2,C=1,E=1 A=0,B=inf,D=1,C=3,E=2 A B C 2 1 3 4 5 D=0,A=1,B=2,E=1,C=2 D E E=0,B=1,A=2,D=1,C=1 6 The result is that all nodes are able to communicate with all other nodes again . DV-15 S-38.2121 / Fall-06 / RKa, NB Routing loops A C B DV-16 S-38.2121 / Fall-06 / RKa, NB
The DV-protocol may create a transient routing loop 1 2 Let’s assume that cost of link 5 is 8. A B C 3 4 5 A stable initial state for routes to C would be: D E x to C Link Distance 6 from x A → C 1 2 B → C 2 1 C → C - 0 Let’s just look at the first D → C 3 3 link of each route. E → C 4 2 transient = hetkellinen, ohimenevä, väliaikainen DV-17 S-38.2121 / Fall-06 / RKa, NB Link 2 fails x to C Link Distance from x Intermediate DV from A to B arrives first A → C 1 2 state B → C 2 Inf. B=0,A=1,D=2,C=3,E=1 C → C - 0 D → C 1 2 3 3 A B C A=0,B=1,D=1,C=2,E=2 E → C 4 2 3 4 5 x to C Link Distance D E 6 from x A → C 1 4 B → C 1 3 All packets to C are sent to B. C → C - 0 B sends them to A. A sends them D → C 3 3 back to B… until TTL=0. E → C 4 4 (Bouncing effect) DV-18 S-38.2121 / Fall-06 / RKa, NB
A and E send their distance vectors x to C Link Distance from x A → C 1 4 1 B → C 1 5 C → C - 0 A=0,B=1,D=1,C=4,E=2 1 2 A B C D → C 3 5 E → C 3 4 5 4 4 2 D E 6 B generates a new DV: B=0,A=1,D=2,C=5,E=1 ÿ Distance seen by A to C grows to 6 Distance vectors sent by C do not change anything because of high link cost DV-19 S-38.2121 / Fall-06 / RKa, NB A sends a new distance vector x to C Link Distance from x A → C 1 6 1 B → C 1 7 C → C - 0 A=0,B=1,D=1,C=6,E=2 1 2 A B C D → C 3 7 E → C 3 4 5 4 6 2 D E 6 B generates a new DV B=0,A=1,D=2,C=7,E=1 ÿ Distance seen by A to C grows to 8 DV-20 S-38.2121 / Fall-06 / RKa, NB
A sends a new distance vector x to C Link Distance from x A → C 1 8 1 B → C 1 9 C → C - 0 A=0,B=1,D=1,C=8,E=2 1 2 A B C D → C 3 9 E → C 3 4 5 4 8 2 D E 6 B generates a new DV B=0,A=1,D=2,C=9,E=1 ÿ Distance seen by A to C grows to 10 DV-21 S-38.2121 / Fall-06 / RKa, NB A sends a new distance vector x to C Link Distance from x A → C 1 10 1 B → C 1 11 C → C - 0 A=0,B=1,D=1,C=10,E=2 1 2 A B C D → C 3 11 E → C 3 4 5 5 8 2 D E 6 B generates a new DV B=0,A=1,D=2,C=11,E=1 E generates a new DV E=0,B=1,A=2,D=1,C=8 DV-22 S-38.2121 / Fall-06 / RKa, NB
E sends a new distance vector x to C Link Distance 2 from x 1 A B C A → C 1 10 B → C 3 4 5 4 9 C → C - 0 D E D → C 6 6 9 E → C 5 8 E=0,B=1,A=2,D=1,C=8 DV-23 S-38.2121 / Fall-06 / RKa, NB B send its DV but the tables are already OK x to C Link Distance B=0,A=1,D=2,C=9,E=1 from x 1 2 A B C A → C 1 10 B → C 3 4 5 4 9 C → C - 0 D E D → C 6 6 9 E → C 5 8 • Each update round increased the costs by 2 • The process progresses in a random order, because it is genuinely parallel in nature. • During the process, the state of the network is bad. DV-packets may be lost due to the overload created by bouncing user messages DV-24 S-38.2121 / Fall-06 / RKa, NB
Counting to infinity occurs when failures break the network into isolated islands (1) • Link 1 is broken, A to Link Distance 1 2 A B C and the network D 3 1 has recovered. A - 0 3 4 5 B 3 3 D E E 3 2 6 • All link costs = 1 C 3 3 D to Link Distance D - 0 A 3 1 B 6 2 E 6 1 C 6 2 DV-25 S-38.2121 / Fall-06 / RKa, NB Counting to infinity occurs when failures break the network into isolated islands (2) • Also link 6 breaks. A to Link Distance 1 2 A B C D 3 1 A - 0 3 4 5 • D updates its B 3 3 routing table but D E E 3 2 6 has not yet sent its C 3 3 distance vector. D to Link Distance D - 0 A 3 1 B 6 Inf. E 6 Inf. C 6 Inf. DV-26 S-38.2121 / Fall-06 / RKa, NB
Recommend
More recommend