* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download 0 - SFU Computing Science
Deep packet inspection wikipedia , lookup
Piggybacking (Internet access) wikipedia , lookup
Network tap wikipedia , lookup
Wake-on-LAN wikipedia , lookup
Computer network wikipedia , lookup
Backpressure routing wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
List of wireless community networks by region wikipedia , lookup
IEEE 802.1aq wikipedia , lookup
Airborne Networking wikipedia , lookup
Dijkstra's algorithm wikipedia , lookup
CMPT 371 Data Communications and Networking Routing 2 0 © Janice Regan, CMPT 128, 2007-2012 Distance Vector Routing Each station (router) maintains a global routing table Routing table contains one entry for each station (router) in the network Each entry includes a measure of the ‘distance’ to a particular station (router) Periodically (or when its routing table changes) each router sends a copy of its routing table to its neighbors When updates (of neighbors routing tables) are received a routing algorithm is used to update the local routing table incorporating any changes from the recently received update Janice Regan © 2005-1012 1 Bellman Ford Algorithm Initialization D0, x ( y ) y x Dh , x ( x ) 0 h Update for each successive h≥0. For each v≠u compute Dh 1, x ( w) x wherev min w [ Dh , x ( v ) c( v, w)] is the source node is any node w is a neighborin g node h max imum numberof links in path c( a, b) cos t for propagation from a to b Dh , x ( v ) Janice Regan © 2005-1012 least cos t for propagation from x to v in h links 2 Bellman-Ford Algorithm: Find the minimum cost paths from station A to every other station in the network below A 6 5 D 6 4 4 4 2 E F 3 2 I C B 2 1 4 4 Janice Regan © 2005-1012 3 J H G 4 5 4 I 8 2 K 2 L 3 Initialization Set all paths from A to be ∞ (0,∞) A D 6 4 4 2 4 4 J (0,∞) Janice Regan © 2005-1012 I 2 F 3 (0,∞) C 4 E I 4 B (0,∞) (0,∞) (0,∞) 6 5 2 1 (0,∞) 8 H (0,∞) G (0,∞) 4 5 3 2 K 2 L (0,∞) (0,∞) 4 T A A A 0 B C D E F G H I J K L ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ Janice Regan © 2005-1012 5 Iteration 1 Find all minimum cost paths of length 1 hop from the station A (A,5) (0,∞) A (0,∞) (A,1) C D 6 4 { B, E, F} 4 4 (0,∞) (A,2) F 3 2 (0,∞) 4 B E I (0,∞) 6 5 2 1 (0,∞) 4 4 J (0,∞) Janice Regan © 2005-1012 I 2 8 H (0,∞) G (0,∞) 4 5 2 3 K 2 L (0,∞) (0,∞) 6 T A B A A 0 BEF A 0 A C D ∞ ∞ ∞ 5 ∞ ∞ Janice Regan © 2005-1012 E F ∞ A 1 A G H I J K ∞ ∞ 2 ∞ L ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ 7 Iteration 2 Find all minimum cost paths of length 2 hops from the station A A (A,1) C B D 6 4 E F 2 I 4 4 { C,B, E , F G 4 3 (F,5) (E,3) (0,∞) 6 5 2 1 (0,∞) (B,11) (0,∞) (F,6) (A,5) (B,9) (A,2) 4 4 J (0,∞) (F,6) Janice Regan © 2005-1012 I 2 8 G (0,∞) (F,4) 5 I, J,K } H (0,∞) 4 2 3 K (0,∞) (F,7) 2 L (0,∞) 8 T A B A A 0 BEF A 0 CGIJK A 0 C D E F ∞ ∞ ∞ A 5 ∞ ∞ A 1 A 5 11 ∞ A 1 AB Janice Regan © 2005-1012 ∞ G H I J K L ∞ ∞ ∞ ∞ ∞ ∞ ∞ A 2 ∞ ∞ ∞ ∞ ∞ ∞ A 2 4 ∞ 7 ∞ AF AE 3 AF 6 AF 9 Iteration 3 Find all minimum cost paths of length 3 hops from the station A (B,11) (G,10) (A,5) A C 6 4 4 4 E F 3 2 I 4 B 2 1 (A,1) 6 5 (0,∞) (G,8) D (C,15) (E,3) I (J,10) 4 (I,6) (A,2) Janice Regan © 2005-1012 G, H I, J, K, L H (0,∞) (K,11) (G,12) 4 2 3 J (K,10) (i,7) (F,6) 8 G (C,12) (F,4) 5 4 2 { C, D K 2 L (0,∞) (K,9) (J,9) (F,7) 10 } T A B C D E F G H I J K L A A 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ BEF A 0 A 5 ∞ ∞ A 1 A 2 ∞ ∞ ∞ ∞ ∞ ∞ CGIJK A 0 A 5 AB 11 ∞ A 1 A 2 AF 4 ∞ AE 3 AF 6 AF 7 ∞ CDHL A 0 A 5 AFG 10 15 A 1 A 2 AF 4 11 AE 3 AF 6 AF 7 Janice Regan © 2005-1012 AFG AFK AFK 11 9 Iteration 4 Find all minimum cost paths of length 4 hops from the station A (D,12) (G,10) (A,5) A (A,1) D (G,8) C B 6 4 E F 2 I 4 4 4 3 (E,3) 6 5 2 1 (H,15) 4 4 J (F,6) Janice Regan © 2005-1012 I (A,2) 2 D, H, L } (D,12) H (K,11) (L,11) (C,12) 8 G (H,19) 4 (F,4) 5 { C, 2 3 K 2 L (H,13) (K,9) (F,7) 12 T A B C D E F G H I J K L A A 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ BEF A 0 A 5 ∞ ∞ A 1 A 2 ∞ ∞ ∞ ∞ ∞ ∞ CGIJK A 0 A 5 AB 11 ∞ A 1 A 2 AF 4 ∞ AE 3 AF 6 AF 7 ∞ CDHL A 0 A 5 AFG 10 AFG 15 A 1 A 2 AF 4 AFK 11 AE 3 AF 6 AF 7 AFK 9 A 0 A 5 AFG 10 AFG 15 A 1 A 2 AF 4 AFK 11 AE 3 AF 6 AF 7 AFK 9 Janice Regan © 2005-1012 13 Distance Vector Routing Distributed Bellman-Ford algorithm Each station (router) maintains a routing table Routing table contains one entry for each station (router) in the network Each entry includes a measure of the ‘distance’ to a particular station (router) ‘distance’ metric may be one of, or a combination of measures including the following number of hops number of packets queued for transmission delay between stations ( measured using and ECHO packet which directly measures the transmission time) Janice Regan © 2005-1012 14 Distance Vector Routing Once every T seconds each station i, (router) sends each of its neighbors (station one hop distant) a list, of estimated delays d ij from itself to every station j. Similarly each station will receive routing information from each of its neighbors every T sec. d min [d l ] kj iA ij ki The routing data received are used to update the routing table of the station Note: the existing routing table for station i at time t is not used directly to compute the routing table for station i at time t+T, the ‘distance’ to each neighbor station k, lki, and the delay vectors from each neighbor station j, dij are used Janice Regan © 2005-1012 15 First Generation Internet Distance Vector Routing (ARPANET) Used the distributed version of the Bellman-Ford algorithm. Network data updated every 128ms Di delay vector from node i d i1 si1 Si successor node vector d s sij next node in minimum i2 i2 delay route from i to j Di Si N # of nodes in network lki current estimate of d iN siN delay k to I A set of neighbor nodes d kj min [d ij lki ] iA skj i i minimizes expressioni above Janice Regan © 2005-1012 16 Distance Vector Routing : from node J Original network A 5 B 2 1 F 2 4 J D 4 8 H G 4 5 4 4 I 6 2 3 4 C 4 E I 6 3 2 K 2 L F I A A 2 E 3 F 6 F 7 B B 4 F 7 F 8 F 9 C G 8 F 11 F 12 H 12 D G 6 F 9 F 10 H 8 E I 5 E 2 I 6 F 8 F 0 0 F 3 F 4 F 5 G G 2 F 5 F 6 F 7 H K 5 J 11 K 3 H 4 I I 3 0 0 I 4 J 7 J J 4 J 4 0 0 J 3 K K 5 J 7 K 3 0 0 L K 7 J 9 K 5 L 2 Delay lJi lJF 4 J lJI 4 K lJK 3 Janice Regan © 2005-1012 17 Calculate new routes at node J iA Delay vectors received Measured Delay lJi lJF 4 lJK 3 lJI 4 SF DF SI DI 5 SK DK A A 2 E B A 7 E 10 F 10 C G 9 F 13 H 9 D G 7 F 11 H 6 E A 5 E 2 F 8 F 0 0 F 4 F 3 G G 3 F 7 F 6 H K 3 F 10 H 4 I I 4 0 0 F 7 J J 2 J 3 J 4 K K 3 J 7 0 0 L K 6 F 10 L 3 Janice Regan © 2005-1012 skj i d kj min [d ij lki ] Later time, some routes weights have changed F 5 DK [d k1 , d k 2 ,, d kN ]T DF+IJF DF+4 DI+IJI DI+4 6 11 13 11 9 4 7 7 8 6 7 10 9 14 17 15 6 8 11 14 4 7 11 14 DK+IJK DK+3 8 13 12 9 11 6 9 7 10 7 3 6 New table for node J SJ DJ F F K K I F F K I 0 K K 6 11 12 9 6 4 7 7 4 0 3 6 18 First Generation Internet The first generation internet routing algorithm was a distributed version of the Bellman Ford algorithm The distance metric used was queue length on each outgoing node. This is a local measure and does not require information from neighbor nodes Routing data exchanges occurred every 128ms Janice Regan © 2005-1012 19 Problems with first generation Algorithm considered only queue length as a measure of link delay to nearest neighbors, capacity of the link was not considered. This worked reasonably when all links had the same capacity, but as the network grew higher capacity links were introduced. Processing time was not considered The algorithm responded slowly to congestion and failure (Count-to-infinity problem) Thrashing occurred when packets followed minimal congestion route rather than aiming for the destination Janice Regan © 2005-1012 20 Count to Infinity problem The example of the distributed Bellman Ford algorithm we considered assumed that all stations in the network already knew of the changes in costs. In practice when conditions in a network change, the change will take time to propagate across the network. Good news propagates quickly across a network Bad news propagates slowly across the network Janice Regan © 2005-1012 21 Count to Infinity problem: Consider a linear network with 6 stations A B C D E F A is down initially and all other stations know this A comes up, at the time of the first exchange of routing information after A comes up B learns that A is alive At the time of the second exchange of routing information after A comes up C learns that A is alive This pattern continues till the time of the sixth data exchange after A comes up, when F learns that A is alive. At this point all stations in the network have learned the good news Janice Regan © 2005-1012 22 Count to Infinity problem: Linear network with 6 stations (all single hop costs 1) A B C D E F A is up initially and all other stations know this A goes down, at the time of the first exchange of routing information after A goes down B hears nothing from A. Since there is no direct path to A, B chooses an indirect path to A through C (which actually goes through B itself, but B doesn’t know this) The first eight exchanges are illustrated on the next slide. Janice Regan © 2005-1012 23 Count to Infinity problem: Linear network with 6 stations, single hop costs 1) A INITIALLY AFTER 1 EXCHANGE AFTER 2 EXCHANGES AFTER 3 EXCHANGES AFTER 4 EXCHANGES AFTER 5 EXCHANGES AFTER 6 EXCHANGES AFTER 7 EXCHANGES AFTER 8 EXCHANGES B 1 3 3 5 5 7 7 9 9 Janice Regan © 2005-1012 C 2 2 4 4 6 6 8 8 10 D 3 3 3 5 5 7 7 9 9 F E 4 4 4 4 6 6 8 8 10 5 5 5 5 5 7 7 9 9 24 Count to Infinity problem: Linear network with 6 stations (all single hop costs 1) A B C D E F The number of iterations necessary to indicate that the link to 1 is down (cost infinite) is in fact infinite. It is clear that the delay increases as the number of iterations increase, but it is still necessary to ‘count to infinity’ to reach the correct link costs for link A-B down. Janice Regan © 2005-1012 25 Poison Reverse Consider router A in a network Router A’s neighbors are routers B, and C Any entry in A’s routing table will be either 1. learned from B’s routing table distance to B + the distance from B to the destination 2. Learned from C’s routing table distance to C + the distance from C to the destination Poison reverse means the routing table that A sends to its neighbors will be different for each neighbor 1. Routes learned from B’s routing table will have costs set to ∞ when A’s table is sent back to B 2. Routes learned from C’s routing table will have costs set to ∞ when A’s table is sent back to C Janice Regan © 2005-1012 26 Why Poison Reverse Removes the possibility of loops between two neighboring nodes Does not remove the possibility of longer loops Example: loop between neighboring nodes Router B determines the cost to destination X should pass through router C This information is sent to router C (poison reverse means that the path to X has cost ∞) The connection between router C and X has failed, so C is looking for an alternate route to X Without poison reverse C could choose to route to X through B not knowing B’s path through X included C With poison reverse the cost of the link through B is ∞ so C will choose any other path in preference and avoid the count to infinity problem Janice Regan © 2005-1012 27 Second generation internet Distributed Dijkstra (Link State Routing) Developed to correct the problems of the first generation algorithms. Followed these steps: Find neighbors (addresses) and measure delay to neighbors Send a packet containing addresses and delays to neighbors information to all other routers Receive similar packets from other routers and use the information to construct shortest path to every other router using Dijkstra’s algorithm Janice Regan © 2005-1012 28 Second generation internet Developed to correct the problems of the first generation algorithms. Followed these steps: Find neighbors (addresses) using a HELLO packet Measure delay to neighbors using an ECHO packet to measure round trip time ( may include queuing time) Send a packet containing addresses and delays to neighbors information to all other routers every ten seconds using flooding Receive similar packets from other routers and use the information to construct shortest path to every other router using Dijkstra’s algorithm Janice Regan © 2005-1012 29 Problems: second generation Flooding caused significant overhead The assumption that the measured packet delay was a good predictor of future link delay sometimes lead to oscillations. When two paths connect two subnets oscillation may occur: One path between subnets become congested The second path is chosen for subsequent traffic. All traffic is then routed through the second path causing congestion on that path and low use on the original path. The original path is chosen for subsequent traffic The original path again becomes congested and the cycle repeats At any time only one of the two paths is being fully utilized Janice Regan © 2005-1012 30 Third generation internet To correct the shortcomings of the second generation internet a new distance metric was devised. The measured delay, T, is converted to a utilization (cost), ρ, using a single server queuing model. The service time, Ts, for a standard is the network wide average packet size divided by the data rate. 2(Ts T ) /(Ts 2T ) The result is smoothed by averaging it with the previous estimate, to give an average utilization at step n U(n) U (n 1) 12 [ (n 1) U (n)] The link cost is set as a function of the average utilization that is designed to provide a reasonable estimate of cost while avoiding oscillations Janice Regan © 2005-1012 31 Random Routing Simple and robust. Similar to flooding but reduces the traffic load created by flooding. Each station randomly chooses one of its neighbors to send the packet to rather than sending it to all neighbors. For an intermediate station, the station is selected from nearest neighbors excluding the station the packet originated from Each nearest neighbor is assigned a probability. The sum of the probabilities for all nearest neighbors is 1. The probability for the ith nearest neighbor is based on some cost measure, for example data rates Pi= (Data rate of Link i)/( Janice Regan © 2005-1012 data rates for all nearest neighbors) 32