Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in C or c++ Implement distributed Distance Vector and Link State routing algorithms. Randomly generate a connected weighted graph and then apply the distributed Distance
in C or c++ Implement distributed Distance Vector and Link State routing algorithms. Randomly generate a connected weighted graph and then apply the distributed Distance Vector and Link State algorithms to find the shortest path between any two nodes. If there is a tie, you can randomly choose one path. We assume there are at most 10 nodes and the weight on each edge is randomly chosen between 1 and 10. The inputs are the weighted graph and a source and a destination. And the outputs are the source, intermediate nodes, the destiantion, and the shorted path length. You will get extra 10 points if your weighted graph is automatically generated. Also, print out all the shortest paths when multiple shortest paths exist from a source to a destination. Distance Vector Algorithm Each node maintains a vector of distances and next hops to all destinations 1. Initialize vector with 0 cost to self, infinity to other destinations 2. Periodically send vector to neighbors 3. Update vector for each destination by selecting the shorted distance heard, after adding cost of neighbor link 4. Use the best neighbor for forwarding Link State Algorithm 1. Nodes flood topology with link state packets Each node learns full topology 2. Each node computes its own forwarding table By running Dijkstra algorithm
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started