C++ code for Distance Vector Routing Algorithm in Computer Networks
A distance-vector routing (DVR) protocol requires that a router inform its neighbours of topology changes periodically. Historically known as the old ARPANET routing algorithm (or known as Bellman-Ford algorithm).
This is a c++ code for the DVR Protocol.
Here i have created router class which holds the distance vector and intermediate node for each router. Then i created an array of routers which will contain all the routers
To run this algorithm:
- You have to enter all the connections in form of source and destination routers with the cost of route.
- Once you have given the input, our algorithm will automatically generate the cost matrix.
- Then the cost of routing for each router will be calculated.
Thank you.