Question: Write a program to simulate the distance-vector algorithm (Table 20.1). for (y = 1 to N) { if (y is a neighbor) D[y] = c[myself][y]

Write a program to simulate the distance-vector algorithm (Table 20.1).

for (y = 1 to N) { if (y is a neighbor)

for (y = 1 to N) { if (y is a neighbor) D[y] = c[myself][y] else 10 D[y] = 0 11 } send vector {D[1], D[2], ..., D[N]} to all neighbors // Update (improve the vector with the vector received from a neighbor) repeat (forever) 12 13 14 15 { 16 wait (for a vector Dw from a neighbor w or any change in the link) for (y = 1 to N) 17 18 { 19 D[y] = min [D[y], (c[myself][w] + Dw[y])] // Bellman-Ford equation 20 } 21 if (any change in the vector) 22 send vector {D[1], D[2], ..., D[N]} to all neighbors 23 } 24 } // End of Distance Vector 6.

Step by Step Solution

3.62 Rating (174 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The first program simulates the DistanceVector protocol The input object ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Networking Questions!