Question: (Distance Vector Routing) Modify the code for the distance vector routing protocol such that every node p has an input array linkCost: array [G] of
(Distance Vector Routing)
Modify the code for the distance vector routing protocol such that every node p has an input array
linkCost: array [G] of integer
where linkCost[g] is the cost of the link from the node to the neighbor g (assumed simply to be one in the current code). In addition to this, also add split-horizon with poisoned-reverse to the code.
Code Below

![such that every node p has an input array linkCost: array [G]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f30fb173976_29766f30fb10bc4b.jpg)
![of integer where linkCost[g] is the cost of the link from the](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f30fb212475_29766f30fb1a1974.jpg)


Code: declarations node p inp G set (g I g is a neighbor of ph up arayG of boolean, is my noighbor up var routing table) rtb array [NID] of G, cost array [NID] of integer, {cost to reach each node) (temporary variable) fic,mporary variables} d NID, c :aali lialyINIDI()ii ?liitegeoli, param g element of G g can be any neighbor) Code: declarations node p inp G set (g I g is a neighbor of ph up arayG of boolean, is my noighbor up var routing table) rtb array [NID] of G, cost array [NID] of integer, {cost to reach each node) (temporary variable) fic,mporary variables} d NID, c :aali lialyINIDI()ii ?liitegeoli, param g element of G g can be any neighbor)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
