Network layer The Dijkstra Algorithm or Dijkstras Shortest Path - - PowerPoint PPT Presentation

network layer
SMART_READER_LITE
LIVE PREVIEW

Network layer The Dijkstra Algorithm or Dijkstras Shortest Path - - PowerPoint PPT Presentation

IN2140: Introduction to Operating Systems and Data Communication Network layer The Dijkstra Algorithm or Dijkstras Shortest Path First Algorithm Non-Adaptive Routing Shortest Path Routing Non-Adaptive Shortest Path Routing Static


slide-1
SLIDE 1

Network layer

The Dijkstra Algorithm

  • r

Dijkstra’s Shortest Path First Algorithm

IN2140: Introduction to Operating Systems and Data Communication

slide-2
SLIDE 2

Non-Adaptive Routing

Shortest Path Routing

slide-3
SLIDE 3

IN2140 – Introduction to operating systems and data communication

University of Oslo

Non-Adaptive Shortest Path Routing

§ Static Procedure

− Network operator generates tables − Tables

  • Are loaded when IS operation is initiated and
  • Will not be changed any more

§ Characteristics

  • Simple
  • Good results with relatively consistent topology and traffic

− But

  • Poor performance if traffic volume or topologies change over time
slide-4
SLIDE 4

IN2140 – Introduction to operating systems and data communication

University of Oslo

§ Spanning Tree and Optimized Route

− Information about the entire network has to be available

  • i. e. application actually as a benchmark comparison

§ Example

− Link is labeled with distance / weight − Node is labeled with distance from source node along best known path (in parentheses) − Find the shortest path from A to D

Non-Adaptive Shortest Path Routing

A B C D E F G H

2 7 2 2 6 1 2 4 3 3 2

A B (●,-) C (●,-) D (●,-) E (●,-) F (●,-) G (●,-) H (●,-)

slide-5
SLIDE 5

IN2140 – Introduction to operating systems and data communication

University of Oslo

§

Procedure: e. g. according to Dijkstra

§

Find the shortest path from A to D

− Labels may be permanent or tentative − Initially, no paths are known

  • All nodes are labeled with infinity (tentative)

− Discover the labels that represent shortest possible path from source to any node − Make those labels permanent 1. Node A labeled as permanent (filled-in circle) 2. Relabel all directly adjacent nodes with the distance to A (path length, nodes adjacent to source) 3. Examine all tentatively labeled nodes, make the node with the smallest label permanent 4. This node will be the new working node for the iterative procedure (i.e., continue with step 2.)

Non-Adaptive Shortest Path Routing

slide-6
SLIDE 6

IN2140 – Introduction to operating systems and data communication

University of Oslo

Non-Adaptive Shortest Path Routing

§ Procedure: e. g. according to Dijkstra § Find the shortest path from A to D:

  • 1. A flagged as permanent (filled-in circle)
  • 2. Relabel all directly adjacent nodes with the distance to A
  • (path length, IS adjacent to the source):

2 7 2 2 6 1 2 4 3 3 2

A B (●,-) C (●,-) D (●,-) E (●,-) F (●,-) G (●,-) H (●,-) B (2,A) G (6,A)

slide-7
SLIDE 7

IN2140 – Introduction to operating systems and data communication

University of Oslo

Non-Adaptive Shortest Path Routing

§ Procedure: e. g. according Dijkstra § Find the shortest path from A to D:

− ...

  • 3. Compare all recent, not firmly flagged IS;
  • flag the one with the lowest number as fixed
  • 4. This IS is the origin of the iterative procedure
  • (i. e. continue with item 2.)

2 7 2 2 6 1 2 4 3 3 2

A C (●,-) D (●,-) E (●,-) F (●,-) H (●,-) B (2,A) G (6,A)

slide-8
SLIDE 8

IN2140 – Introduction to operating systems and data communication

University of Oslo

Non-Adaptive Shortest Path Routing

§ Procedure: e.g., according to Dijkstra § Find the shortest path from A to D:

  • 1. Node B has been labeled as permanent (filled-in circle)
  • 2. relabel all directly adjacent nodes with the distance to B

(path length, nodes adjacent to source):

  • A (does not apply, because it is the origin),

2 7 2 2 6 1 2 4 3 3 2

A C (●,-) D (●,-) F (●,-) H (●,-) B (2,A) E (4,B) G (6,A) C (9,B) E (●,-)

slide-9
SLIDE 9

IN2140 – Introduction to operating systems and data communication

University of Oslo

Non-Adaptive Shortest Path Routing

§

Procedure: e.g., according to Dijkstra

§

find the shortest path from A to D:

1. …

  • 2. …
  • 3. examine all tentatively labeled nodes;
  • make the node with the smallest label permanent
  • 4. this node will be the new working node for the iterative procedure ...

2 7 2 2 6 1 2 4 3 3 2

A D (●,-) F (●,-) H (●,-) B (2,A) C (9,B) E (4,B) F (6,E) G (6,A) H (9,G) G (5,E) D (10,H) H (8,F)

slide-10
SLIDE 10

IN2140 – Introduction to operating systems and data communication

University of Oslo

§ An alternative approach to Dijkstra’s algorithm

Non-Adaptive Shortest Path Routing

A B C D E F G H

2 7 2 2 6 1 2 4 3 3 2

A B C D E F G H

A B C D E F G H

0A 2A 6A

A

9B 4B

B

6E 5E

E

6E 9G

G

9B 8F

F

9B

10H

H

10H

C

slide-11
SLIDE 11

IN2140 – Introduction to operating systems and data communication

University of Oslo

§ An alternative approach to Dijkstra’s algorithm

Non-Adaptive Shortest Path Routing

A B C D E F G H

0A 2A 6A

A

9B 4B

B

6E 5E

E

6E 9G

G

9B 8F

F

9B

10H

H

10H

C

slide-12
SLIDE 12

IN2140 – Introduction to operating systems and data communication

University of Oslo

§ An alternative approach to Dijkstra’s algorithm

Non-Adaptive Shortest Path Routing

A B C D E F G H

0A 2A 6A

A

9B 4B

B

6E 5E

E

6E 9G

G

9B 8F

F

9B

10H

H

10H

C

A B C D E F G H A B C E F

slide-13
SLIDE 13

IN2140 – Introduction to operating systems and data communication

University of Oslo

Non-Adaptive Shortest Path Routing

A B C D E F G H B B B B B B B A B C D E F G E E E E E

  • G
  • H
  • H
  • A

B C D E F G H A B C E F

H D

  • A

C D B E F G H

Y reaches X through <cell> Y X

§ Build individual routing tables from tree

Perform a Depth First Search

  • leading to this visit sequence

C D H F G E B A

{C} {D} {D,H} {D,F,H} {G} {D,E,F,G,H} {B,C,D,E,F,G,H}

C F F F