1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone)...

52
1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) [email protected] Office Hours: 2-4 p.m. 360 MB Course webpage: http://www.seas.upenn.edu/~swati/teaching.htm
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    215
  • download

    1

Transcript of 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone)...

Page 1: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

1

TCOM 799: Algorithms in Networking

Instructor: Saswati Sarkar

Contact Info: 215 573 9071(Phone)

[email protected]

Office Hours: 2-4 p.m. 360 MBCourse webpage: http://www.seas.upenn.edu/~swati/teaching.htm

Page 2: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

2

Topics covered in this course

• Routing algorithms– Point to point routing– Point to multipoint routing

• Flow control algorithms– Network flows– Optimization algorithms

• Resource scheduling algorithms– Matching– Integer Linear programming

Page 3: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

3

Direction of approach

• Basic Algorithmic Theory

• Recent Networking papers

Page 4: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

4

Gradation

• Homeworks (20 % of grade)– One set every month

• Term project (80 % of grade)

Page 5: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

5

Todays Class

• Brief Introduction

• Basics of algorithm analysis and design

• Point to point routing algorithms– Dijkstras algorithm– Bellman-ford algorithm– Overview of Internet routing

Page 6: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

6

Next Class

• Flloyd-Warshalls algorithm

• Johnsons algorithm

• Networking papers on point to point routing

Page 7: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

7

Keywords

• Networks– A bunch of users communicating among themselves

• Algorithm– A sequence of logical instructions

• Common problems in Networking– Find a route for a message

– Distribute the network resources among contending users

Page 8: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

8

SourceDestination

Routing

Resource Allocation

Bandwidth

Buffer Space

Page 9: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

9

• Need efficient algorithms to decide these

• Design an algorithm

• Prove its correctness– prove that it attains its objective

• Analyze its complexity– how much time does it take to finish– how much storage does it require

Page 10: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

10

• Run time is machine dependent– will define in terms of operations

• For i = 1 to N– ith num ->ith num + 1– Ith num->ith num*ith num + 1

• N memory accesses, 2N additions, N multiplications

• 4N operations– An operation takes a constant time

Page 11: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

11

• Broad nature of complexity function– Logarithmic in input size (log N)– Linear in input size (N)– Polynomial in input size (Nk)– Exponential in input size (exp(N))

• c1N and c2N are both linear, N is linear, 100000log(N) is logarithmic

• Constants do not matter

Page 12: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

12

• We are interested in the algorithm performance for large size inputs (asymptotic analysis)– All linear functions will show the same nature of

increase with increase in input size

– A logarithmic function will be less than a linear function for all sufficiently large input size independent of the constant

• Get rid of the constants in complexity analysis!

Page 13: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

13

Formal complexity analysis

• Refer to Supplement 1

Page 14: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

14

Routing Algorithms

• Shortest path routing• What is a shortest path?

– Minimum number of hops?– Minimum distance?

• There is a weight associated with each link– Weight can be a measure of congestion in the link,

propagation delay etc.

• Weight of a path is the sum of weight of all links• Shortest path is the minimum weight path

Page 15: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

15

1 1.5

0.5 2.5

SourceDestination

Path 1

Path 2

Weight of path 1 = 2.5

Weight of path 2 = 3.0

Page 16: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

16

Computation of shortest paths

• Enumerate all paths?– Exponential complexity

• Several polynomial complexity algorithms exist– Dijkstras algorithm (greedy algorithm)

– Bellman-ford algorithm (distributed algorithm)

– Flloyd-Warshall algorithm (dynamic programming)

– Johnsons algorithm

Page 17: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

17

Dijkstras algorithm•Assumes a directed graph

SourceDestination

•Given any node, finds the shortest path to every other node in the graph

•O(V log V + E)

Page 18: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

18

• Let source node be s• Maintains shortest path ``estimate’’ for every vertex

v, (d(v)) – ``estimate’’ is what it believes to be the shortest path from s

and the list of vertices for whom the shortest path is known

• Initially the list of vertices for whom the shortest path is known is empty and

the estimates are infinity for all vertices except the source vertex itself.

Page 19: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

19

• It holds that whenever the estimate d(v) is finite for a vertex v, there exists a path from the source s to v with weight d(v)

• It turns out that the estimate is accurate for the vertex with the minimum value of this estimate– Shortest path is known for this vertex (v)

• This vertex (v) is added to the list of vertices for whom shortest path is known

• Shortest path estimates are upgraded for every vertex which has an edge from v, and is not in this ``known list’’.

Page 20: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

20

Estimate Upgrade Procedure

• Suppose vertex v is added to the list newly, and we are upgrading the estimate for vertex u– d(v) is the shortest path estimate for v, d(u) is

the estimate for u– w(v, u) is the weight of the edge from v to u

d(u) -> min(d(u), d(v) + w(v, u))

Page 21: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

21

Intuition behind the upgrade procedure

• Assume that d(u) and d(v) are finite• So there exists a path to v from s of weight d(v), (s,

v1, v2,…..v)• Hence there exists a path from s to u (s, v1, v2,…..v,

u) of weight d(v) + w(v, u)• Also, there exists a path to u of weight d(u). • So the shortest path to u can not have weight more

than either d(u) or d(v) + w(v, u). • So we upgrade the estimate by the minimum of the

two.

Page 22: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

22

Notation

• Source vertex: s• Set of vertices: V• Set of edges: E• Shortest path estimate of vertex v: d(v)• Weight of edge (u, v): w(u, v)• Set of edges originating from vertex v: Adj(v)• Set of vertices whose shortest paths are known: S• Q = V \ S• Refer to supplement 3 for algorithm statement

Page 23: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

23

Example

0

s

7

2 5

7

2

1

8

5

3 4

2

2

28

5s

0

73

1

5

4

2

5

7

10

0

3

2 7

s7

2

2

1

85

5

4

5 6

854

s

0

7

2

32

1

52

5

7

6

3 85

s

0

7

2

2

1

5

4

2

5

7

6

53

1

s

0 2

28

5

4

7

Page 24: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

24

Algorithm Complexity

• Statement 1 is executed |V| times• Statements 2 and 3 are executed once• Loop at statement 4 is executed |V| times• Every extract-min operation can be done in at most |V|

operations• Statement 4(a) is executed total |V|2 times• Statements 4(b) and 4© are executed |V| times each

(total)• Observe that statement 4(d) is executed |E| times

Page 25: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

25

• So overall complexity is O(|V|2 + |E|) and this is same as O(|V|2)

• Using improved data structures complexity can be reduced– O((|V| + |E|)log |V|) using binary heaps– O(|V| log |V| + |E|) using fibonacci heaps

Page 26: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

26

Proof of Correctness

• Exercise:– Verify that whenever d(v) is finite, there is a

path from source s to vertex v of weight d(v)

Page 27: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

27

Assumptions

• Assume that source s is connected to every vertex in the graph, and all edge weights are finite Also, assume that edge weights are positive.

• Let p(s, v) be the weight of the shortest path from s to v.

• Will show that the graph terminates with d(v)=shortest path weights for every vertex

Page 28: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

28

• Will first show that once a vertex v enters S, d(v) equals the shortest path weight from source s, at all subsequent times.– Clearly this holds in step 1, as source enters S in

step 1, and d(s) = 0– Let this not hold for the first time in step k > 1

• Thus the vertex u added has d(u) > p(s, u)

• Consider the situation just before insertion of u.• Consider the true shortest path, p, from s to u.

Page 29: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

29

•Since s is in S, and u is in Q, path p must jump from S to Q at some point.

Let the jump have end point x in S, and y in Q (possibly s = x, and u = y)

We will argue that y and u are different vertices

S Q

su

yxPath p

Since path p is the shortest path from s to u, the segment of path p between s and x, is the shortest path from s to x, and that between s and y is the shortest from s to y

Page 30: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

30

Weight of the segment between s and x is d(x)

•since x is in S, d(x) is the weight of the shortest path to x

S Q

su

yxPath p

Weight of the segment between s and y is d(x) + w(x, y)

Also, d(y) <= d(x) + w(x, y) = p(s, y)

Thus, p(s, y) = d(x) + w(x, y)

Follows that d(y) = p(s, y)

However, d(u) > p(s, u). So, u and y are different

w(x,y)

Page 31: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

31

Since, y appears somewhere along the shortest path between s and u, but y and u are different, p(s, y) < p(s, u)

Using the fact that all edges have positive weight

ys u

Hence, d(y) = p(s, y) < p(s, u) < d(u)

Both y and u are in Q. So, u should not be chosen in this step

So, whenever a vertex u is inducted in S, d(y) = p(s, y).

Once d(u) equals p(s, u) for any vertex it can not change any further (d(u) can only decrease or remain same, and d(u) can not fall below p(s, u).

Since the algorithm terminates only when S= V, we are done!

Page 32: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

32

• We have proved only for edges with positive weight– CLR proves for edges with nonnegative weight

(Chapter 25)

• Shortcoming– Does not hold for edges with nonnegative

weight– Centralized algorithm

Page 33: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

33

Exercise: This computation gives shortest path weights only. Modify this algorithm to generate shortest paths as well!

Page 34: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

34

Bellman-ford Algorithm

• Applies as long as there are no nonpositive

weight cycles– If there are circles of weight 0 or less, then the

shortest paths are not well defined

• Capable of full distributed operation

• O(|V||E|) complexity– slower than Dijkstra

Page 35: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

35

Algorithm description

• Every node v maintains a shortest path weight estimate, d(v)

• These estimates are initialized to infinity, for all vertices except source, s, d(s)=0

• Every node repeatedly updates its shortest path estimate as follows

)),()((min)()(:

vuwudvduAdjvu

v

12

0.5

2.1

50.1d(v) = 2.6

Page 36: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

36

)),()((min)(1)(:

vuwuv dd tuAdjvut

Refer to supplement 3 for algorithm statement

Page 37: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

37

Example

0

s

7

3 5

7

2

1

8

5

2 4

22

28

5s

0

73

1

5

4

2

5

7

8

0

3

2 7

s7

2

2

1

85

5

4

5 6

53

1

s

0 2

28

5

4

7

0

3

2 7

s7

2

2

1

85

5

4

5 6

Page 38: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

38

Complexity Analysis

• Initialization step takes |V| + 1 steps

• The loop in statement 3 is executed |V| times

• Each execution takes |E| steps

• Overall, there are |V| + 1 + |V||E| steps– O(|V||E|)

Page 39: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

39

Proof that it works• Assume that all vertices are reachable from

source, s.– Thus there is a shortest path to any vertex v from s.

• Assume that the graph has no cycles of weight 0 or less– So the shortest paths can not have more than |V|-1

edges.

• We will prove that at the termination of Bellman-Ford algorithm, d(v)=p(s,v) for every vertex v.

• We will show that if there is one shortest path to a vertex of k hops, then after the kth execution of the loop in statement 3, d(v) freezes at p(s, v)

Page 40: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

40

We know the above holds for k = 0, as d(s) = p(s, s) = 0 at all times.

Let the above hold for 1,….,k. We will show that this holds for k + 1

So, by induction hypothesis, d(y) = p(s, y) after the kth iteration and at all subsequent times .

Consider a vertex u with a shortest path p of k + 1 hops.

ys u

p

Let vertex y be its predecessor. Clearly p1 is a shortest path to y and it has k hops. So weight of path p1 is p(s, y)

p1

So by the estimate update procedure, d(u) <= d(y) + w(y, u) = p(s, y) + w(y, u) = weight of path p = p(s, u) after the k+1 th iteration and all subsequent times.

Page 41: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

41

Again verify that as long as d(v) is finite, d(v) is length of some path to vertex v.

Hence d(u) >= p(s, u) always

Thus, d(u) = p(s, u), always after the k+1th iteration.

We have just shown that d(u) <= p(s, u) after the k+1 th iteration

Page 42: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

42

Features of this algorithm

• Note that a node needs information about its neighbors only!

• So we do not need a global processor.

• However, all nodes need to synchronize their clocks (compute at the same times, t = 1, 2,…..)– Difficult in practice

Page 43: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

43

Asynchronous Bellmanford

• Every node periodically receives estimates (d(u)) from its neighbors

• Every node periodically computes the shortest path estimates based on its knowledge of the estimates of its neighbors

v

12

0.5

2.1

0.15

Page 44: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

44

)),()((min)()()(: ,

vuwuv dd tuAdjvutvu

•Here, is the time of the last computation at u that reaches node v before t.

)(,t

vu

Here, is the computation at time at node u.

)()(

,

ud tvu

)(,t

vuNote that depend on u, v, t. )(

,t

vuThe only requirement is that updates come infinitely often from each neighbor, i.e., for all edges (u, v)

)(lim,t

vut

v

12

0.5

2.1

0.15

Page 45: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

45

The asynchronous updates converge to shortest path values starting from any initial condition (Bertsekas and Gallager(pp 406-410))

)),()(()()(

)( ,min uvwuv dd t

vAdjut

vu

Note that for both Dijkstra and Bellman ford we have discussed the computation of routes from a single source to all destinations.

We can obtain routes from all nodes to a single destination by using the above algorithms and a reversed graph (verify!)

Also, for Bellman-ford we can obtain the routes from all nodes to a single destination s, by initializing d0(s)=0, d0(v)=infinity, for all other vertices , and the following updates:

Page 46: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

46

Now is the distance to destination s from vertex v. )(vd t

Page 47: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

47

Current Internet Routing

• Packet headers have destination address.• Routers have routing tables with the next hop link

for every entry : Destination Next hop

a l1 b l2

When a packet arrives, a router checks the destination, locates it in the routing table and forwards it to the corresponding next hop link

Page 48: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

48

• Source Routing– The source puts the desired route in he packet, and the

routers forward in accordance wih the mentioned route.

• Routing tables are constructed as per shortest path routing

• Protocols for shortest pah computation– Link state (Dijkstra)

– Distance Vector (Bellmanford)

Page 49: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

49

Link state Protocols

• Every router maintains the entire topology of the network

• For this purpose, every router periodically broadcasts the status of links to its neighbors to the entire network

• Whenever a router gets a message indicating that there is topology change– It updates its topology record– Uses Dijkstras algorithm to compute shortest paths to

all destinations

Page 50: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

50

• Example protocol: OSPF (open shortest path forwarding)

• Refer to ``An Engineering Approach to Computer Networking’’, S. Keshav, Chapter 11

Page 51: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

51

Distance Vector Protocols

• Every router maintains the distance and next link to every destination in the network (routing table).

• It sends this routing table to all of its neighbors

v

12

0.5

2.1

0.15

Page 52: 1 TCOM 799: Algorithms in Networking Instructor: Saswati Sarkar Contact Info: 215 573 9071(Phone) swati@ee.upenn.edu Office Hours: 2-4 p.m. 360 MB Course.

52

•When a router gets an update, it recomputes the shortest paths to all the destinations as per Bellman ford update

),( xvd t

)),(),((),()(

)( ,min uvwxuxv dd t

vAdjut

vu

Here, is the distance from vertex v to destination x

v

12

0.5

2.1

0.15a

b

c

d e

Here, node v will compute dt(v,b), dt(v,c), dt(v,d), dt(v,e), dt(v, a).