Chapter 5 Routing Algorithm in Networks. How are message routed from origin to destination? 1) Circuit-Switching → telephone net. Dedicated bandwidth.

Slides:



Advertisements
Similar presentations
Ch. 12 Routing in Switched Networks
Advertisements

Bellman-Ford algorithm
1 Routing Protocols I. 2 Routing Recall: There are two parts to routing IP packets: 1. How to pass a packet from an input interface to the output interface.
Ch. 12 Routing in Switched Networks Routing in Packet Switched Networks Routing Algorithm Requirements –Correctness –Simplicity –Robustness--the.
* Bellman-Ford: single-source shortest distance * O(VE) for graphs with negative edges * Detects negative weight cycles * Floyd-Warshall: All pairs shortest.
Chapter 4 Distributed Bellman-Ford Routing
Chapter 5 Shortest Paths: Label-Correcting Algorithms
William Stallings Data and Computer Communications 7 th Edition Chapter 12 Routing.
Data and Computer Communications Ninth Edition by William Stallings Chapter 12 – Routing in Switched Data Networks Data and Computer Communications, Ninth.
What is “Routing”? Routing algorithm that part of the network layer responsible for deciding on which output line to transmit an incoming packet Adaptive.
EE 4272Spring, 2003 Chapter 10 Packet Switching Packet Switching Principles  Switching Techniques  Packet Size  Comparison of Circuit Switching & Packet.
Shortest Paths Definitions Single Source Algorithms –Bellman Ford –DAG shortest path algorithm –Dijkstra All Pairs Algorithms –Using Single Source Algorithms.
TCOM 501: Networking Theory & Fundamentals
Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router.
Shortest Paths Definitions Single Source Algorithms
1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: (Phone) Office Hours: 2-4 p.m. 360 MB Course.
1 Routing Algorithms. 2 Outline zBellaman-Ford Algorithm zDijkstra Algorithm.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 21 Introduction to Computer Networks.
1 Shortest Path Algorithms. 2 Routing Algorithms Shortest path routing What is a shortest path? –Minimum number of hops? –Minimum distance? There is a.
SAvPS – úvod Genči 2009 (bsaed on Tanenbaum’s slides.
Chapter 4: Finding the Shortest Path Lesson 1: Dijkstra’s Algorithm
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
1 Pertemuan 20 Teknik Routing Matakuliah: H0174/Jaringan Komputer Tahun: 2006 Versi: 1/0.
Routing in Communication Networks Routing: Network layer protocol that guides information units to correct destinations. A complex collection of decision.
Distributed Asynchronous Bellman-Ford Algorithm
1 Network Optimization Chapter 3 Shortest Path Problems.
Review: routing algorithms. –Choose the appropriate paths. –Routing algorithms Flooding Shortest path routing (example). –Dijkstra algorithm. –Bellman-Ford.
Link-state routing  each node knows network topology and cost of each link  quasi-centralized: each router periodically broadcasts costs of attached.
10.- Graph Algorithms Centro de Investigación y Estudios Avanzados del Instituto Politécnico Nacional Introduction Routing Algorithms Computation of Shortest.
Network and Communications Ju Wang Chapter 5 Routing Algorithm Adopted from Choi’s notes Virginia Commonwealth University.
13 – Routing Algorithms Network Layer.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Chapter 5 Network Layer.
Network Layer4-1 Distance Vector Algorithm Bellman-Ford Equation (dynamic programming) Define d x (y) := cost of least-cost path from x to y Then d x (y)
The Network Layer & Routing
Data Communications and Networking Chapter 11 Routing in Switched Networks References: Book Chapters 12.1, 12.3 Data and Computer Communications, 8th edition.
1 The Floyd-Warshall Algorithm Andreas Klappenecker.
Lecture 16. Shortest Path Algorithms
Diverse Routing Algorithms
Network Layer4-1 Distance Vector: link cost changes Link cost changes: r node detects local link cost change r updates distance table (line 15) r if cost.
Data Structures & Algorithms Shortest Paths Richard Newman based on book by R. Sedgewick and slides by S. Sahni.
Internet Routing r Routing algorithms m Link state m Distance Vector m Hierarchical routing r Routing protocols m RIP m OSPF m BGP.
Introduction to Algorithms All-Pairs Shortest Paths My T. UF.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
Graph Algorithms Why graph algorithms ? It is not a “graph theory” course! Many problems in networks can be modeled as graph problems. Note that -The topology.
Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …). Determine a path of shortest.
EMIS 8374 Shortest Path Trees Updated 11 February 2008 Slide 1.
Network Layer (2). Review Physical layer: move bits between physically connected stations Data link layer: move frames between physically connected stations.
Distance Vector Routing
1587: COMMUNICATION SYSTEMS 1 Wide Area Networks Dr. George Loukas University of Greenwich,
COMPUTER NETWORKS CS610 Lecture-17 Hammad Khalid Khan.
Chapter 7 Packet-Switching Networks Shortest Path Routing.
1 Network Layer: Routing Distributed, Distance Vector Protocols Y. Richard Yang 4/11/2016.
William Stallings Data and Computer Communications
Centralized vs Distributed Routing
Network Layer – Routing 1
Routing: Distance Vector Algorithm
EMIS 8374 Dijkstra’s Algorithm Updated 18 February 2008
Disjoint Path Routing Algorithms
Routing in Packet Networks Shortest Path Routing
Lecture 10 Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CS3516: These slides are generated from.
Dijkstra’s Algorithm for the Shortest Path Problem
Chapter 6 Dynamic Programming
ECE453 – Introduction to Computer Networks
Shortest-Path Property 4.1
Chapter 4: Finding the Shortest Path Lesson 1: Dijkstra’s Algorithm
Delivery, Forwarding, and Routing
Wide Area Networks (WANs), Routing, and Shortest Paths
Network Layer (contd.) Routing
Wide Area Networks (WANs), Routing, and Shortest Paths
OSPF Protocol.
Presentation transcript:

Chapter 5 Routing Algorithm in Networks

How are message routed from origin to destination? 1) Circuit-Switching → telephone net. Dedicated bandwidth (path) 2) Message-switching : using routing table share link bandwidth concept, 同一 msg 用 同一 path 3) Packet-switching : 不同路徑 for every packet out of order.

Routing Algorithm in Networks Out of order Re-assembly problem Virtual circuit – msg delivered in the order transmitted – sharing, i.e. no dedicated paths. Implementation centralized ─ distributed Vulnerable to failure Comm. Of control infomation

Shortest Path Algorithm -Graph G = (V, A) d ij is the src weight of (i, j)  A. d ij =  if (i, j)  A. Source node is node 1 Set of nodes Set of Direct arcs # of nodes |V|=N

§5.2.3 Shortest Path P.396 §Bellman-Ford Alg. (can handle negative weights but not negative cycles) Let D i (h) be the length of a shortest path from 1 to i using h or fewer arcs (or links) Initially D 1 (0) = 0 D i (0) = , i  1 For each h = 0, 1, 2, …, N-2

§5.2.3 Shortest Path [Thm] : The alg. Finds the correct shortest path lengths proof by induction. are the lengths of the shortest path using 1 or fewer links.

§5.2.3 Shortest Path Induction step : suppose D i (h) are the correct length of shortest paths using h or fewer links. k1k1 ik1k1 k1k1 d k1i d k2i d k3i

§5.2.3 Shortest Path Complexity: 1) The alg. Requires at most N-1 iterations. 2) For each iteration, the recursion is performed by N-1 nodes. 3) Each application of the recursion requires no more than N-1 addition & comparisons  O(N 3 ) complexity. Example : see P.397. Fig 5.31

§Dijkstra ’ s Algorithm.(position arc weights only.) Let p be the set of nodes that are permanently labeled. Step 0 : set P={1}, D 1 = 0, and D j = d 1j,  j  1 Step 1 : Find i  P, s.t.

§Dijkstra ’ s Algorithm.(position arc weights only.) Step 2 :

§Dijkstra ’ s Algorithm.(position arc weights only.) After k iterations of the algorithm. P contains the k+1 nodes that are closest to node 1 and their permanent labels are the correct shortest path lengths from node

§Dijkstra ’ s Algorithm.(position arc weights only.) Proof by inductions: True for k=1: Inductive step: suppose statement is true for any k. P={1, i 1,i 2, …,i k } are (k+1) closest nodes to 1. D k is length of the shortest path from 1 to k,  k  P.

§Dijkstra ’ s Algorithm.(position arc weights only.) i k-1 i1i1 ikik i i k+1

§Dijkstra ’ s Algorithm.(position arc weights only.) By construction, i k+1 is at least as close to 1 as any other node in Complexity: 1) The algorithm requires N-1 iterations. 2) For each iteration: 1) Step 1 : requires at most N comparison 2) Step 2 : requires at most N addition & comparisons.  complexity is O(N 2 )

§Floyd-Warshall algorithm Finds shortest path between every pair of nodes O(N 3 ) Negative arc weights(but no negative cycle) Note: every pair Bellman-Ford O(N 4 ) Dijkstra O(N 3 )

§Floyd-Warshall algorithm D ij (n) = shortest path length between nodes I and j using only nodes 1,2,3 … n as intermediate nodes on paths. Initially, D ij (0) = d ij For n=0,1,2, …,N-1 D ij (n+1) = min[D ij (n+1), D i,n+1 (n+1) +d n+1,j ] for all i  j

§Floyd-Warshall algorithm Example see fig.? Proof by induction : Complexity : 1. N iterations 2. Each iteration require N(N-1) comparisons & additions  O(N 3 )

Centralized, synchronous Bellmen-Ford Algorithm Let D i (h) be the shortest (<=h) path length from node 1 to node I Initially, D 1 (h) = 0 for all h D i (0) =  for i = 1

Centralized, synchronous Bellmen-Ford Algorithm => h is an index for iteration # (the # of links allowed in paths) ← synchronous => 有困難 h 必須 all the same

§ Distributed Asynchronous Bellman-Ford Algorithm Let D i be the shortest path length from node i to 1. Let N(i) = { j|(i,j)  A }

§ Distributed Asynchronous Bellman-Ford Algorithm Let Di be the shortest path length from node i to 1. Let N(i) = { j|(i,j)  A } Neighbor At each time t, each node i  1 has available: D j i (t) : i ’ s latest estimate (sent by node i) of the shortest distance from node j  N(i) to node 1. D i (t) : i ’ s latest estimate (computed by node i) of the shortest distance from node i to 1

§ Distributed Asynchronous Bellman-Ford Algorithm At each point in time, each node. i  1 is doing one of the followings : 1. Node i update D i (t) by And leaves the estimate D j i (t), j  N(i) unchanged & sends D i, j  N(i) 2. Node i receives from one or more neighbors D i, j  N(i) computed by j at an earlier time. Node i update D j i (t) and leaves other estimate unchanged. 3. Node i is idle.

§ Distributed Asynchronous Bellman-Ford Algorithm  Prove convergence of the distributed asyn. B-F Alg. Let T i be the set of times at which node i update D i (t) Let T j i be the set of times at which node i update D j (t) Let {t 0, t 1 … } be the ordering of

§ Distributed Asynchronous Bellman-Ford Algorithm Assumptions: 1. nodes never stop updateing their estimate D i (t) and receiving msg. from all their neighbors D j i (t), j  N(i), T i, T j i have  # of elements. 2. All estimates D i (t), D j i (t),  i  V, j  N(i) are non-negative. 3. Old distance information is eventually purged from the system.

§ Distributed Asynchronous Bellman-Ford Algorithm Let D i k be the k-th iteration of Bellman- Ford (k=0,1,2 … ) for node i = 1,2, … N when Let D i k be the k-th iteration of Bellman- Ford when D i (0) = 0, i = 1,2, … N

§ Distributed Asynchronous Bellman-Ford Algorithm