Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE 122: Intra-domain routing: Distance Vector

Similar presentations


Presentation on theme: "EE 122: Intra-domain routing: Distance Vector"— Presentation transcript:

1 EE 122: Intra-domain routing: Distance Vector
Computer Science Division Department of Electrical Engineering and Computer Science University of California, Berkeley, Berkeley, CA September 16, 2004 (* based partially on Kurose & Ross’ slides)

2 Problem How is a packet transmitted from source to destination in the Internet? Example: how does packet sent by B reaches D Host C Host D Host A Node 1 Node 2 Node 3 Node 5 Host B Host E Node 7 Node 6 Node 4

3 Forwarding vs. Routing Forwarding: the process by which a router sends an arriving packet to the next router towards final destination Routing: the process by which a router acquires the information to perform packet forwarding (e.g., routing tables)

4 IP Packet Forwarding Each router maintains a mapping of address prefixes to output ports Upon receiving a packet, a router performs the longest prefix matching on packet’s destination address and forwards it to corresponding output Prefix interface xxx 1 12.82.xxx.xxx 3 xxx 2 1 2

5 Internet Routing Internet organized as a two level hierarchy
First level – autonomous systems (AS’s) AS – region of network under a single administrative domain ASes run an intra-domain routing protocols Distance Vector, e.g., Routing Information Protocol (RIP) Link State, e.g., Open Shortest Path First (OSPF) Between ASes runs inter-domain routing protocols, e.g., Border Gateway Routing (BGP) De facto standard today, BGP-4

6 Example Interior router BGP router AS-1 AS-3 AS-2

7 Intra-domain Routing Protocols
Based on UDP (unreliable datagram delivery) Distance vector Routing Information Protocol (RIP), based on Bellman-Ford Each neighbor periodically exchange reachability information to its neighbors Minimal communication overhead, but it takes long to converge, i.e., in proportion to the maximum path length Link state Open Shortest Path First (OSPF), based on Dijkstra Each network periodically floods immediate reachability information to other routers Fast convergence, but high communication and computation overhead

8 Routing Goal: determine a “good” path through the network from source to destination Good means usually the shortest path Network modeled as a graph Routers  nodes Link edges Edge cost: delay, congestion level,… A E D C B F 2 1 3 5

9 Distance Vector Routing Algorithm
Iterative: continues until no nodes exchange info Asynchronous: nodes need not exchange info/iterate in lock steps Distributed: each node communicates only with directly-attached neighbors Each router maintains Row for each possible destination Column for each directly-attached neighbor to node Entry in row Y and column Z of node X  best known distance from X to Y, via Z as next hop (remember this !) Note: for simplicity in this lecture examples we show only the shortest distances to each destination

10 Distance Vector Routing
Each node: wait for (change in local link cost or msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors Each local iteration caused by: Local link cost change Message from neighbor: its least cost path change from neighbor to destination Each node notifies neighbors only when its least cost path to any destination changes Neighbors then notify their neighbors if necessary

11 Distance Vector Algorithm (cont’d)
1 Initialization: 2 for all neighbors V do if V adjacent to A D(A, V) = c(A,V); 5 else D(A, V) = ∞; 7 loop: 8 wait (until A sees a link cost change to neighbor V or until A receives update from neighbor V) 9 if (c(A,V) changes by d) for all destinations Y through V do D(A,Y) = D(A,Y) + d 12 else if (update D(V, Y) received from V) for all destinations Y do if (destination Y through V) D(A,Y) = D(A,V) + D(V, Y); else /* update D(A, Y) if there is a shorter path through V */ D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for destination Y) send D(A, Y) to all neighbors 20 forever

12 Example: Distance Vector Algorithm
Node A Node B Dest. Cost NextHop B 2 C 7 D - Dest. Cost NextHop A 2 C 1 D 3 3 B D 2 1 1 A C 7 Node C Node D 1 Initialization: 2 for all neighbors V do if V adjacent to A D(A, V) = c(A,V); 5 else D(A, V) = ∞; Dest. Cost NextHop A 7 B 1 D Dest. Cost NextHop A - B 3 C 1

13 Example: 1st Iteration (C  A)
Node A Node B Dest. Cost NextHop B 2 C 7 D - Dest. Cost NextHop A 2 C 1 D 3 3 B D 2 1 1 A C 7 (D(C,A), D(C,B), D(C,D)) 7 loop: 12 else if (update D(V, Y) received from V) for all destinations Y do if (destination Y through V) D(A,Y) = D(A,V) + D(V, Y); else D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) send D(A, Y) to all neighbors 20 forever Node C Node D Dest. Cost NextHop A 7 B 1 D Dest. Cost NextHop A - B 3 C 1

14 Example: 1st Iteration (C  A)
Node A Node B Dest. Cost NextHop B 2 C 7 D 8 Dest. Cost NextHop A 2 C 1 D 3 3 B D 2 1 1 A C 7 D(A, D) = min(D(A, D), D(A, C) + D(C,D) = min(∞ , 7 + 1) = 8 7 loop: 12 else if (update D(V, Y) received from V) for all destinations Y do if (destination Y through V) D(A,Y) = D(A,V) + D(V, Y); else D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) send D(A, Y) to all neighbors 20 forever (D(C,A), D(C,B), D(C,D)) Node C Node D Dest. Cost NextHop A 7 B 1 D Dest. Cost NextHop A - B 3 C 1

15 Example: 1st Iteration (C  A)
Node A Node B Dest. Cost NextHop B 2 C 7 D 8 Dest. Cost NextHop A 2 C 1 D 3 3 B D 2 1 1 A C 7 7 loop: 12 else if (update D(V, Y) received from V) for all destinations Y do if (destination Y through V) D(A,Y) = D(A,V) + D(V, Y); else D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) send D(A, Y) to all neighbors 20 forever Node C Node D Dest. Cost NextHop A 7 B 1 D Dest. Cost NextHop A - B 3 C 1

16 Example: 1st Iteration (BA, CA)
Node A Node B Dest. Cost NextHop B 2 C 3 D 5 Dest. Cost NextHop A 2 C 1 D 3 3 B D 2 1 1 A C 7 7 loop: 12 else if (update D(V, Y) received from V) for all destinations Y do if (destination Y through V) D(A,Y) = D(A,V) + D(V, Y); else D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) send D(A, Y) to all neighbors 20 forever D(A,D) = min(D(A,D), D(A,B) + D(B,D)) = min(8, 2 + 3) = 5 D(A,C) = min(D(A,C), D(A,B) + D(B,C)) = min(7, 2 + 1) = 3 Node C Node D Dest. Cost NextHop A 7 B 1 D Dest. Cost NextHop A - B 3 C 1

17 Example: End of 1st Iteration
Node A Node B Dest. Cost NextHop B 2 C 3 D 5 Dest. Cost NextHop A 2 C 1 D 3 B D 2 1 1 A C 7 7 loop: 12 else if (update D(V, Y) received from V) for all destinations Y do if (destination Y through V) D(A,Y) = D(A,V) + D(V, Y); else D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) send D(A, Y) to all neighbors 20 forever Node C Node D Dest. Cost NextHop A 3 B 1 D Dest. Cost NextHop A 2 B 3 C 1

18 Example: End of 3nd Iteration
Node A Node B Dest. Cost NextHop B 2 C 3 D 4 Dest. Cost NextHop A 2 C 1 D 3 B D 2 1 1 A C 7 7 loop: 12 else if (update D(V, Y) received from V) for all destinations Y do if (destination Y through V) D(A,Y) = D(A,V) + D(V, Y); else D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for dest. Y) send D(A, Y) to all neighbors 20 forever Node C Node D Dest. Cost NextHop A 3 B 1 D Dest. Cost NextHop A 4 C B 2 1 Nothing changes  algorithm terminates

19 Link Cost Changes “good news travels fast” B A C 1 4 1 50 Node B D C N
7 loop: 8 wait (link cost update or update message) 9 if (c(A,V) changes by d) for all destinations Y through V do D(A,Y) = D(A,Y) + d 12 else if (update D(V, Y) received from V) for all destinations Y do if (destination Y through V) D(A,Y) = D(A,V) + D(V, Y); else D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for destination Y) send D(A, Y) to all neighbors 20 forever 1 B 4 1 A C 50 Node B D C N A 4 1 B D C N A 1 B D C N A 1 B D C N A 1 B “good news travels fast” Node C D C N A 5 B 1 D C N A 5 B 1 D C N A 2 B 1 D C N A 2 B 1 time Link cost changes here Algorithm terminates

20 Count-to-Infinity Problem
7 loop: 8 wait (link cost update or update message) 9 if (c(A,V) changes by d) for all destinations Y through V do D(A,Y) = D(A,Y) + d 12 else if (update D(V, Y) received from V) for all destinations Y do if (destination Y through V) D(A,Y) = D(A,V) + D(V, Y); else D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y)); 18 if (there is a new minimum for destination Y) send D(A, Y) to all neighbors 20 forever 60 B 4 1 A C 50 Node B D C N A 4 1 B D C N A 6 1 B D C N A 6 1 B D C N A 8 1 B “bad news travels slowly” Node C D C N A 5 B 1 D C N A 5 B 1 D C N A 7 B 1 D C N A 2 B 1 time Link cost changes here; recall that B also maintains shortest distance to A through C, which is 6. Thus D(B, A) becomes 6 !

21 Split Horizon Don’t send the routes learned from each neighbor to that neighbor A C 1 4 50 B 60 Node B D C N A 4 1 B D C N A 60 1 B D C N A 60 1 B D C N A 51 1 B D C N A 51 1 B Node C D C N A 5 B 1 D C N A 5 B 1 D C N A 50 B 1 D C N A 50 B 1 D C N A 50 B 1 time Link cost changes here; C won’t sent to B, D(C, A) = 5 since C has learned about this path from B itself. Thus D(B,A) becomes 60. Algorithm terminates

22 Poison Reverse Stronger version of split horizon: if a node X has learned a route to Y from V, it sends to V, D(X, Y) = ∞  make sure that V won’t use X to reach Y! Does this completely solve the count to infinity problem?

23 Is “Count To Infinity” Solved?
60 No! Split horizon and poison reverse only work for loops involving two nodes. B 4 1 A C 1 50 2 Node B D D C N D 1 C 8 A N 2 B 5 A 4 A C 1 C D 1 D Exercise: continue… Note: you need also to write C’s routing table Node D D C N A 5 B B 1 B C 2 C time Link cost changes here; in a previous iteration D told B that it can reach A through B with cost 7 (split-horizon is not invoked!) so B concludes that it can reach A through D with cost 8!


Download ppt "EE 122: Intra-domain routing: Distance Vector"

Similar presentations


Ads by Google