Consider a campusarea network that runs the distancevector r
Solution
In distance vector routing each node shares its routing table with its immediate neighbours periodically and when there is a change.
1. Initial routing table of K
2. Modifies its routing table based on values received from Router J, assuming distance between Router K and J is 1 hop. It adds the cost between K and J(i.e. 1 hop) with each value in the second column of the table provided by J, since to reach a destination it needs to go through J.
3. Router K now comapres the new updated table with the initial table of its own and selects the shortest distance routes. If it learns of a new network it adds the entry to its table like for Net 22. If the next node entry is same, K chooses the new row entry. So for destination Net 42, the previous value through J was 2, but now it is 4. Since J is the node from which the value has been received, the new entry is chosen.
| Destination | Distance | Next Hop |
|---|---|---|
| Net 1 | 0 | direct |
| Net 2 | 0 | direct |
| Net 5 | 8 | Router L |
| Net 17 | 6 | Router M |
| Net 24 | 6 | Router J |
| Net 30 | 2 | Router Q |
| Net 42 | 2 | Router J |
