Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCI 465 Data Communications and Networks Lecture 16

Similar presentations


Presentation on theme: "CSCI 465 Data Communications and Networks Lecture 16"— Presentation transcript:

1 CSCI 465 Data Communications and Networks Lecture 16
Martin van Bommel CSCI 465 Data Communications & Networks

2 Least Cost Routing Algorithms
Basis for routing decisions Network of nodes connected via bi-directional links Link has cost associated with it in each direction If just minimizing hop count – each link has cost 1 Usually link cost inversely proportional to capacity Link costs may include queue lengths For each pair of nodes, find path with least cost May be different for each direction Dijkstra’s or Bellman-Ford algorithms CSCI 465 Data Communications & Networks

3 CSCI 465 Data Communications & Networks
Dijkstra’s Algorithm Finds shortest paths from given source nodes to all other nodes Develop paths in order of increasing length Algorithm runs in stages Add node with next shortest path at each stage Terminates when all nodes added CSCI 465 Data Communications & Networks

4 CSCI 465 Data Communications & Networks
Dijkstra’s Method Step 1: Initialization T = {s} set of nodes incorporated so far (s = start node) L(n) = w(s, n) for n  s initial path costs are link costs Step 2: Get Next Node Find node x  T with minimum L(x) Add x to T and add the new edge leading to x Step 3: Update Least-Cost Paths L(n) = min [ L(n), L(x) + w(x, n) ] for all n  T CSCI 465 Data Communications & Networks

5 Dijkstra’s Algorithm Example

6 Dijkstra’s Iterations
L(2) Path L(3) L(4) L(5) L(6) 1 {1} 2 1–2 5 1-3 1–4 - {1,4} 4 1-4-3 1-4–5 3 {1, 2, 4} {1, 2, 4, 5} 1-4-5–3 1-4-5–6 {1, 2, 3, 4, 5} 6 {1, 2, 3, 4, 5, 6} 1-2 1-4

7 Bellman-Ford Algorithm
Find shortest paths from given node subject to constraint that paths contain at most one link Find shortest paths with constraint of paths of at most two links and so on … Uses Lh(n) – cost of least-cost path to node n using no more than h links CSCI 465 Data Communications & Networks

8 CSCI 465 Data Communications & Networks
Bellman-Ford Method Step 1: Initialization L0(n) =  for all n  s Lh(s) = 0 for all h Step 2: Update for each successive h ≥ for each n  s, compute Lh(n) = minj [ Lh( j ) + w( j, n) ] Connect n with the predecessor node j that achieves minimum (eliminate previous links from earlier iterations) Path from s to n terminates with j to n link CSCI 465 Data Communications & Networks

9 Bellman-Ford Example

10 Bellman-Ford Iterations
h Lh(2) Path Lh(3) Lh(4) Lh(5) Lh(6) - 1 2 1-2 5 1-3 1-4 4 1-4-3 1-4-5 10 1-3-6 3

11 Routing Algorithm Comparison
Dijkstra: Each node needs to know compete topology needs to know link costs of all links in network must exchange information with all other nodes Bellman-Ford: Each node needs link cost to neighboring nodes needs total cost from s to each neighbor can exchange information with direct neighbors can update costs and paths based on information from neighbors and knowledge of link costs CSCI 465 Data Communications & Networks

12 Routing Algorithm Evaluation
Dependent upon Processing time of algorithms themselves Amount of information required from other nodes Very implementation specific Both converge under static topology and costs converge to same solution If link costs change, attempt to catch up If dependent on traffic, may have instability CSCI 465 Data Communications & Networks


Download ppt "CSCI 465 Data Communications and Networks Lecture 16"

Similar presentations


Ads by Google