Download presentation
0
Data Communications and Networking Routing 2
CMPT 371 Data Communications and Networking Routing 2
1
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 ©
2
Bellman Ford Algorithm
Initialization Update for each successive h≥0. For each v≠u compute where Janice Regan ©
3
Bellman-Ford Algorithm:
Find the minimum cost paths from station A to every other station in the network below 6 4 A 5 B C D 2 6 1 4 4 4 E 2 8 F G H 3 4 5 4 2 2 4 3 K 2 I I J L Janice Regan ©
4
Initialization Set all paths from A to be ∞ (0,∞) (0,∞) (0,∞) A B C D
6 4 A 5 B C D 2 6 1 4 4 4 (0,∞) (0,∞) E 2 8 F G H (0,∞) (0,∞) 3 4 5 4 2 2 4 3 K 2 (0,∞) I I J L (0,∞) (0,∞) (0,∞) Janice Regan ©
5
Janice Regan ©
6
Iteration 1 Find all minimum cost paths of length 1 hop from the station A (0,∞) (A,5) (0,∞) (0,∞) 5 6 4 A B C D { } B , E , F 2 6 1 4 4 4 (0,∞) (0,∞) (A,2) (0,∞) (A,1) E 2 8 F G H (0,∞) (0,∞) 3 4 5 4 2 2 4 3 K 2 (0,∞) I I J L (0,∞) (0,∞) (0,∞) Janice Regan ©
7
Janice Regan ©
8
Iteration 2 Find all minimum cost paths of length 2 hops from the station A (F,6) (A,5) (B,11) (0,∞) (0,∞) 5 6 4 A B C D 6 1 2 4 4 { } 4 C, B , E , F G I, J, K (B,9) (A,2) (A,1) E 2 8 F G H (0,∞) (0,∞) (F,4) 3 4 5 4 2 2 (F,5) 4 3 K 2 (E,3) I (0,∞) I J L (0,∞) (0,∞) (F,6) (0,∞) (F,7) Janice Regan ©
9
Janice Regan ©
10
Iteration 3 Find all minimum cost paths of length 3 hops from the station A (B,11) (0,∞) (A,5) (G,10) (G,8) 5 6 4 A B C D (C,15) 6 1 2 4 4 4 { } C, D G, H I, J, K, L (I,6) (A,2) (A,1) E 2 8 F G H (0,∞) (K,11) (C,12) (G,12) (F,4) 4 3 5 4 2 2 4 3 K 2 (E,3) I I J L (0,∞) (K,9) (K,10) (J,10) (i,7) (F,6) (J,9) (F,7) Janice Regan ©
11
Janice Regan ©
12
Iteration 4 Find all minimum cost paths of length 4 hops from the station A (D,12) (A,5) (G,10) (H,15) 5 6 4 A B C D (G,8) 6 1 2 4 4 4 { } C, D, H, L (D,12) (A,2) (A,1) E 2 8 F G H (K,11) (L,11) (H,19) (C,12) (F,4) 4 3 5 4 2 2 (H,13) 4 3 K 2 (E,3) I I J L (K,9) (F,6) (F,7) Janice Regan ©
13
Janice Regan ©
14
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 ©
15
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 from itself to every station j. Similarly each station will receive routing information from each of its neighbors every T sec. 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 ©
16
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 Si successor node vector sij next node in minimum delay route from i to j N # of nodes in network lki current estimate of delay k to I A set of neighbor nodes Janice Regan ©
17
Distance Vector Routing : from node J
Original network I J L K E F H G B D C 2 4 3 5 1 6 8 A 3 2 lJF 4 lJI 4 lJK 3 Delay lJi Janice Regan ©
18
Calculate new routes at node J
Later time, some routes weights have changed Delay vectors received Measured Delay lJi lJF 4 lJI 4 lJK 3 New table for node J DF+IJF DF+4 DI+IJI DI+4 DK+IJK DK+3 SK DK SJ DJ SF DF SI DI Janice Regan ©
19
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 ©
20
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 ©
21
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 ©
22
Count to Infinity problem:
Consider a linear network with 6 stations 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 A F B C D E Janice Regan ©
23
Count to Infinity problem:
Linear network with 6 stations (all single hop costs 1) 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. A F B C D E Janice Regan ©
24
Count to Infinity problem:
Linear network with 6 stations, single hop costs 1) A B C D E F 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 Janice Regan ©
25
Count to Infinity problem:
Linear network with 6 stations (all single hop costs 1) 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. A B C D E F Janice Regan ©
26
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 learned from B’s routing table distance to B + the distance from B to the destination 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 Routes learned from B’s routing table will have costs set to ∞ when A’s table is sent back to B Routes learned from C’s routing table will have costs set to ∞ when A’s table is sent back to C Janice Regan ©
27
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 ©
28
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 ©
29
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 ©
30
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 ©
31
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. The result is smoothed by averaging it with the previous estimate, to give an average utilization at step n 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 ©
32
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)/( data rates for all nearest neighbors) Janice Regan ©
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.