# Network Layer - Routing Devices and Shortest Path Algorithms for Routing

Δίκτυα και Επικοινωνίες

18 Ιουλ 2012 (πριν από 6 χρόνια και 3 μέρες)

277 εμφανίσεις

159.334 Computer Networks
159.334 Computer Networks
Network Layer

Routing Devices and
Shortest Path Algorithms for Routing
Professor Richard Harris
Technology (SEAT)
Computer Networks
Computer Networks
-
-
1/
1/
7
7
159.334 Computer Networks
159.334 Computer Networks
Function of a Repeater
Computer Networks
Computer Networks
-
-
1/
1/
10
10
159.334 Computer Networks
159.334 Computer Networks
Learning Bridge
Computer Networks
Computer Networks
-
-
1/
1/
13
13
159.334 Computer Networks
159.334 Computer Networks
Routers
-
2
131.170.16.0 131.170.16.3
Default 131.170.16.1
Routing Table
131.170.8.0 131.170.8.1
131.170.16.0 131.170.16.1
131.170.24.0 131.170.24.1
Routing Table
131.170.16.3
131.170.16.1
131.170.16.0
131.170.24.1
131.170.24.0
131.170.8.1
131.170.8.0
Router
Computer Networks
Computer Networks
-
-
1/
1/
15
15
159.334 Computer Networks
159.334 Computer Networks
Routers
-
4
Computer Networks
Computer Networks
-
-
1/
1/
16
16
159.334 Computer Networks
159.334 Computer Networks
A Routing Example
159.334 Computer Networks
159.334 Computer Networks
Routing Algorithms
Dijkstra
and Bellman
-
Ford
Computer Networks
Computer Networks
-
-
1/
1/
26
26
159.334 Computer Networks
159.334 Computer Networks
Shortest Path:Example
-
1
1
4
3
4
3
3
2
Problem:
Find the shortest route fromnode 1
to each of the other nodes.
Problem:
Find the shortest route fromnode 1
to each of the other nodes.
1
3
2
4
5
Computer Networks
Computer Networks
-
-
1/
1/
29
29
159.334 Computer Networks
159.334 Computer Networks
Shortest Path Example
-
4
The smallest temporary label is on node 2,so we now
label it permanently (1*,1).
What is the meaning of the second field?
It means the node which determined the minimumvalue
-
or
predecessor
node.
1
4
3
4
3
3
2
1
3
2
4
5
(

,
-
)
(4,1)
(

,
-
)
(0,
-
)
(1,1)
Computer Networks
Computer Networks
-
-
1/
1/
30
30
159.334 Computer Networks
159.334 Computer Networks
Shortest Path Example
-
5

Step 4:
Now,there are still nodes left in the network with temporary la
bels,so we continue
the process.The most recently assigned permanent label is node
2,so we examine
links leaving this node as before:

Node 3:
Min(4,1+3) = 4 (tie)

Node 4:
Min(

,1+2) = 3

Node 5:
Min(

,1+4) = 5
In each case,the
predecessor
node is node 2

but we shall leave node 3 alone in this
case.
1
4
3
4
3
3
2
1
3
2
4
5
(

,
-
)
(4,1)
(

,
-
)
(0,
-
)
(1,1)
Computer Networks
Computer Networks
-
-
1/
1/
34
34
159.334 Computer Networks
159.334 Computer Networks
Application of
Dijkstra's
Algorithm
-
Another Example
Consider the following
directed
network:
2
10
3
2
3
2
4
4
3
3
2
1
You give it a try now!
3
2
1
4
5
6
8
7
9
Computer Networks
Computer Networks
-
-
1/
1/
38
38
159.334 Computer Networks
159.334 Computer Networks
Shortest Path:Example

1 (Again!)
1
4
3
4
3
3
2
Problem:
Find the shortest route fromnode 1
to each of the other nodes.
Problem:
Find the shortest route fromnode 1
to each of the other nodes.
1
3
2
4
5
d
1
=

d
2
=

d
3
=

d
4
=

d
5
=

Computer Networks
Computer Networks
-
-
1/
1/
40
40
159.334 Computer Networks
159.334 Computer Networks
Output from1
st
and 2
nd
passes
Computer Networks
Computer Networks
-
-
1/
1/
41
41
159.334 Computer Networks
159.334 Computer Networks
Output fromfinal passes and solution
Computer Networks
Computer Networks
-
-
1/
1/
42
42
159.334 Computer Networks
159.334 Computer Networks
Labelling after Pass#1
1
4
3
4
3
3
2
1
3
2
4
5
d
1
= 0;p
1
= 0
d
2
= 1;p
2
= 1
d
4
= 3;p
4
= 2
d
3
= 4;p
3
= 1
d
5
= 5;p
5
= 2