Question: Write a program to simulate the path-vector algorithm (Table 20.3). Table 20.3 Path-vector algorithm for a node 1 Path_Vector_Routing ( ) 2 { // Initialization
Write a program to simulate the path-vector algorithm (Table 20.3).
![Table 20.3 Path-vector algorithm for a node 1 Path_Vector_Routing ( ) 2 { // Initialization for (y = 1 to N) 3 { if (y is myself) Path[y] = myself else if (y is a neighbor) 9. Path[y] = myself + neighbor node 10 else 11 Path[y] = empty 12](https://dsd5zvtm8ll6.cloudfront.net/si.question.images/images/question_images/1607/4/8/9/3825fd057660847a1607489381626.jpg)
Table 20.3 Path-vector algorithm for a node 1 Path_Vector_Routing ( ) 2 { // Initialization for (y = 1 to N) 3 { if (y is myself) Path[y] = myself else if (y is a neighbor) 9. Path[y] = myself + neighbor node 10 else 11 Path[y] = empty 12 Send vector {Path[ 1], Path[2], .., Path[yl} to all neighbors I/ Update 13 14 15 repeat (forever) 16 17 wait (for a vector Path, from a neighbor w) 18 for (y = 1 to N) 19 { 20 if (Path, includes myself) 21 discard the path Il Avoid any loop 22 else Path[y] = best (Path[yl, (myself + Path, ly])} 23 24 25 If (there is a change in the vector) Send vector {Path[1], Path[2], .., Path[y]} to all neighbors 26 27 28 // End of Path Vector
Step by Step Solution
3.56 Rating (163 Votes )
There are 3 Steps involved in it
The third program simulates the PathVector protocol The input o... View full answer
Get step-by-step solutions from verified subject matter experts
