06-02-2013, 11:24 AM
OPEN SHORTEST PATH FIRST ROUTING PROTOCOL
AIM:
To simulate the OPEN SHORTEST PATH FIRST routing protocol based on the cost
assigned to the path.
ALGORITHM:
1.Read the no. of nodes n
2.Read the cost matrix for the path from each node to another node.
3.Initialize SOURCE to 1 and include 1
4. Compute D of a node which is the distance from source to that corresponding
node.
5.Repeat step 6 to step 8 for n-l nodes.
6.Choose the node that has not been included whose distance is minimum
and include that node.
7.For every other node not included compare the distance directly from the
source with the distance to reach the node using the newly included node
8.Take the minimum value as the new distance.
9.Print all the nodes with shortest path cost from source node