1 Dijkstra’s Shortest Path Algorithm Gordon College.

Slides:



Advertisements
Similar presentations
Introduction to Networking Project 3. Routing Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links  link.
Advertisements

13 –Routing Protocols Network Layer4-1. Network Layer4-2 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd.
Data Communication and Networks Lecture 11 Internet Routing Algorithms and Protocols December 5, 2002 Joseph Conron Computer Science Department New York.
Routing - I Important concepts: link state based routing, distance vector based routing.
Network Layer-11 CSE401N: Computer Networks Lecture-9 Network Layer & Routing.
Introduction to Networking Bin Lin TA March 3 rd, 2005 Recital 6.
Routing & IP Routing Protocols
Network Layer4-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing (path selection) m dealing with.
Network Layer Design Isues Store-and-Forward Packet Switching Services Provided to the Transport Layer The service should be independent of the router.
Katz, Stoica F04 EECS 122: Introduction to Computer Networks Link State and Distance Vector Routing Computer Science Division Department of Electrical.
Announcement r Project 2 extended to 2/20 midnight r Project 3 available this weekend r Homework 3 available today, will put it online.
Rensselaer Polytechnic Institute © Shivkumar Kalvanaraman & © Biplab Sikdar1 ECSE-4730: Computer Communication Networks (CCN) Network Layer (Routing) Shivkumar.
1 EE 122: Shortest Path Routing Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern.
4: Network Layer4a-1 14: Intro to Routing Algorithms Last Modified: 7/12/ :17:44 AM.
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.5 Routing algorithms m Link state m Distance.
Announcement r Project 2 due next week! r Homework 3 available soon, will put it online r Recitation tomorrow on Minet and project 2.
EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)
Routing Algorithm March 3 rd, Routing Graph abstraction for routing algorithms: graph nodes are routers graph edges are physical links  link cost:
4: Network Layer 4a-1 14: Intro to Routing Algorithms Last Modified: 8/8/ :41:16 PM.
Network Layer Goals: understand principles behind network layer services: –routing (path selection) –dealing with scale –how a router works –advanced topics:
1 Week 6 Routing Concepts. 2 Network Layer Functions transport packet from sending to receiving hosts network layer protocols in every host, router path.
Intra-Domain Routing D.Anderson, CMU Intra-Domain Routing RIP (Routing Information Protocol) & OSPF (Open Shortest Path First)
Link-state routing  each node knows network topology and cost of each link  quasi-centralized: each router periodically broadcasts costs of attached.
4: Network Layer4a-1 Chapter 4: Network Layer Chapter goals: r understand principles behind network layer services: m routing (path selection) m dealing.
IP routing. Simple Routing Table svr 4% netstat –r n Routing tables DestinationGatewayFlagsRefcntUseInterface UGH00emd UH10lo0.
Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
13 – Routing Algorithms Network Layer.
1 WAN Technologies and Routing. 2 Motivation Connect multiple computers Span large geographic distance Cross public right-of-way –Streets –Buildings –Railroads.
The Network Layer Part 1: Routing EE 122, Fall 2013 Sylvia Ratnasamy
The Network Layer & Routing
1 Week 5 Lecture 2 IP Layer. 2 Network layer functions transport packet from sending to receiving hosts transport packet from sending to receiving hosts.
1 More Routing EE122 Fall 2012 Scott Shenker Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson and.
Overview of Internet Routing (I) Fall 2004 CS644 Advanced Topics in Networking Sue B. Moon Division of Computer Science Dept. of EECS KAIST.
Routing 1 Network Layer Network Layer goals:  understand principles behind network layer services:  routing (path selection)  how a router works  instantiation.
Data Communications and Computer Networks Chapter 4 CS 3830 Lecture 20 Omar Meqdadi Department of Computer Science and Software Engineering University.
Internet Routing r Routing algorithms m Link state m Distance Vector m Hierarchical routing r Routing protocols m RIP m OSPF m BGP.
Switching, Forwarding and Routing. Network layer functions r transport packet from sending to receiving hosts r network layer protocols in every host,
Network Layer4-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,
Network Layer4-1 NAT traversal problem r client want to connect to server with address m server address local to LAN (client can’t use.
Internet and Intranet Protocols and Applications Lecture 9 Internet Routing Algorithms and Protocols March 27, 2002 Joseph Conron Computer Science Department.
Network Layer (2). Review Physical layer: move bits between physically connected stations Data link layer: move frames between physically connected stations.
4: Network Layer4-1 Chapter 4: Network Layer Last time: r Chapter Goals m Understand network layer principles and Internet implementation r Started routing.
R OUTING P ROTOCOLS 1. P LAN Aug 16 – Routing (CCNA2) Aug 23 – LAB Aug 30- Transport L. Sep 6– Application L. Sep 13 – Presentation Sep 20 – Packet Tracer.
CSE 421 Computer Networks. Network Layer 4-2 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 10: Intra-domain routing Slides used with.
IP tutorial - #2 Routing KAIST Dept. of CS NC Lab.
Application Layer 2-1 Chapter 4 Network Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A.
Routing Link-State, Distance-Vector CS168 Section 2.
Routing algorithms. D(v): the cost from the source node to destination that has currently the least cost. p(v): previous node along current least.
Network Layer.
Chapter 7 Dynamic Routing
CS 457 – Lecture 12 Routing Spring 2012.
Network layer functions
NAT traversal problem client want to connect to server with address
Chapter 4 – The Network Layer & Routing
Road Map I. Introduction II. IP Protocols III. Transport Layer
Lecture 10 Computer Networking: A Top Down Approach 6th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 CS3516: These slides are generated from.
CS 3700 Networks and Distributed Systems
Lowest-Cost Routing EE 122: Intro to Communication Networks
ECE453 – Introduction to Computer Networks
CS 3700 Networks and Distributed Systems
COMP/ELEC 429 Introduction to Computer Networks
Chapter 4: Network Layer
CS 455/555 Intro to Networks and Communications
ECSE-4730: Computer Communication Networks (CCN)
Chapter 4: Network Layer
Chapter 4: Network Layer
Network Layer.
Chapter 4: Network Layer
EE 122: Intra-domain routing: Link State
Presentation transcript:

1 Dijkstra’s Shortest Path Algorithm Gordon College

2 A Link-State Routing Algorithm Notation: c(i,j): link cost from node i to j. cost infinite if not direct neighbors D(v): current value of cost of path from source to dest. V p(v): predecessor node along path from source to v, that is next v N: set of nodes already in spanning tree (least cost path known) A E D CB F Examples: c(B,C) = 3 D(E) = 2 p(B) = A N = { A, B, D, E }

3 Dijsktra’s Algorithm 1 Initialization: 2 N = {A} 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v) 6 else D(v) = infinity 7 8 Loop 9 find w not in N such that D(w) is a minimum 10 add w to N 11 update D(v) for all v adjacent to w and not in N: 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N

4 Dijkstra’s algorithm: example Step N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F) A 2,A 5,A 1,A infinity,- infinity,- AD 2,A 4,D 1,A 2,D infinity,- ADE 2,A 3,E 1,A 2,D 4,E ADEB 2,A 3,E 1,A 2,D 4,E ADEBC 2,A 3,E 1,A 2,D 4,E ADEBCF 2,A 3,E 1,A 2,D 4,E E D CB F A

5 Spanning tree gives routing table BCDEF BCDEF B,2 D,3 D,1 D,2 D,4 Outgoing link to use, cost destination Result from Dijkstra’s algorithm Routing table: Step N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F) ADEBCF 2,A 3,E 1,A 2,D 4,E E D CB F A

6 Dijkstra’s algorithm performance Algorithm complexity (n nodes and l links) Computation –n iterations –each iteration: need to check all nodes, w, not in N –n*(n+1)/2 comparisons: O(n 2 ) –more efficient implementations possible: O(n log n) Messages –network topology and link cost known to all nodes –each node broadcasts its direct link cost –O(l) messages per broadcast announcement –O(n l)