1. Trang chủ
  2. » Công Nghệ Thông Tin

routing algorithms

20 308 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 20
Dung lượng 133,83 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Given a topology, link costs, and a source-destination SD pair, determine a route from S to D so that the route has the minimum cost i.e., is the shortest... Routing Metrics¾ Link state:

Trang 1

Routing Algorithms

Suggested Reading:

Bertsekas and Gallager: 5.1 (5.1.1, 5.1.2), 5.2.3 (on Bellman-Ford and Dijkstra’s)

Kurose and Rose (2001 Edition): 4.1, 4.2, 4.3, 4.4

Also http://www.stanford.edu/class/cs224a: routing protocol

Trang 2

™ Flooding

™ Distributed Bellman Ford Algorithm

™ Dijkstra’s Shortest Path First Algorithm

Trang 3

Given a topology, link costs, and a source-destination (SD) pair, determine a route from S to D so that the route has the minimum cost (i.e., is the shortest)

Trang 4

Example network

The shortest route A to B:

R1, R2, R5, R8

R7

R6

R4

R2

2 4

R8

A

B

R5

R3

Trang 5

Routing Metrics

¾ Link state: up or down (stability)

¾ Delay to send an average size packet (Make high speed links

attractive, but closeness counts)

¾ Bandwidth

¾ Link utilization

For simplicity, our examples assume that the cost for the path is additive.

Trang 6

Example network

In this simple case, solution is clear from inspection

R7

R6

R4

R2

2 4

R8

A

B

R5

R3

Trang 7

Advantages:

Disadvantages:

Routers forward packets to all ports

except the ingress port

R1

Trang 8

Spanning Trees

Find the lowest cost route from each of (R1, …, R7) to R8 (the same as from R8 to the rest for this case)

R5

R3

R7

R6

R4

R2

2 4

R8

Trang 9

A Spanning Tree

R3

R1

R5

R4

R8

R6

™ The solution is a spanning tree with R8 as the source of the tree.

™ Tree: There are no loops

™ Spanning: All nodes included.

™ Will see two algorithms that build spanning trees automatically:

™ The distributed Bellman-Ford algorithm

™ Dijkstra’s shortest path first algorithm

R2

R7

2 4

3

Trang 10

Bellman Ford Algorithm*

™ Finds the shortest paths, from a given source node, say node 8, to all other nodes (i is the index for destinations).

General idea:

–First find the shortest single arc path,

–Then the shortest path of at most two arcs, etc.

–Let d ij be the cost between node i to j; and d ij =∞ if (i,j) is not directly linked

Let D i (h) be the shortest distance from 8 to i using at most h hops/arcs (h can be regarded as time also.)

–D i (1) = d 8i for i≠8, D 8 (h) = 0 for all h.

–D i (h+1) = min {j} [D j (h) +d ji ] for i≠8

If all weights are positive, algorithm terminates in N-1 steps, where N is the

no of nodes in the network.

*Notations are similar to those used in Bertsekas and Gallager.

Trang 11

Bellman-Ford Algorithm

R5

R3

R7

R8

R6

R4

R2

R1

Example

2 4

R2

R8

R3

3

3

2

Trang 12

Bellman-Ford Algorithm

R7

R8

R6

R4

R2

2

3

3

2 4

6 4 6 2

4

R8

R6

R4

R2

R1

3

2

R7

Solution

Trang 13

Routing Table for R8

R7

R7

R6

R6

R5

R5

R5

R4

R3

R3

R5

R2

R5

R1

Destination Next Hop

Trang 14

Distributed Bellman-Ford

Let N(i) be a set of neighbors of node i:

D i (h+1) = min {j in N(i)} [D j (h) +d ji ] for i≠8; D 8 (h+1) = 0

Only need to keep/eachange distance information from/with neighbors.

Trang 15

Bellman-Ford Algorithm

Questions:

converges?

routers/links fail?

Trang 16

A Problem with Bellman-Ford

R4

R3

R2

“Bad news travels slowly”

Consider the calculation of distances from/to R 4 :

5,R2 4,R3

5,R2 3

3,R2 4,R3

3,R2 2

3,R2 2,R3

3,R2 1

1, R4 2,R3

3,R2 0

R3

R2

R1 Time

“Counting to infinity”

R3 R4 fails

d34=inf.

Trang 17

Counting to Infinity Problem

Solutions

when count = 16.

Bellman-Ford algorithm.

Trang 18

Dijkstra’s Shortest Path First Algorithm

™ Routers send out update messages whenever the state of a link changes Hence the name: “Link State” algorithm

™ Each router calculates lowest cost path to all others, starting from itself

™ At each step of the algorithm, router adds the next shortest (i.e lowest-cost) path to the tree

™ Finds spanning tree routed on source router

Trang 19

Dijkstra’s Shortest Path First Algorithm

Example

R6

R8

R6

R8

R5

R8

R5

R5

R7

8 5

3 7 6 2

8 5 6

3 7 2 4

8 5 6 7

3 2 4

Step 2:

Step 3:

Step 4:

=

=

=

=

=

=

Trang 20

Dijkstra’s SPF Algorithm

R3

R4

R2

R8

R6

3

2

{}.

}, ,

, , , , ,

=

=

C

R R R R R R R S

: 8

Step

Ngày đăng: 21/01/2016, 23:47

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w