Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
Distributed Bellman Ford Algorithm
Studying the effects of deleting of nodes over a graph
Four ‘O’ Four Prashant Rao
pxr5260 Anshika Garg
axg3637
OverviewIn this project we study the effects of deletion of nodes on a well known routing algorithm
called Bellman Ford.Distributed Bellman Ford also known as Distance Vector Routing Algorithm a well
known shortest path routing algorithm with time complexity of O(|V||E|) where, V is vertices and E is edges. This algorithm takes care of negative weight cycles.
AlgorithmA step by step explanation of the algorithm has been explained below.
Step 1:Lets say node n1 sends its distance vector to node n2 and n3 (i.e. its
neighbours)
fig 1.a fig 1.b
Step 2:Node n2 sends its distance vector to its neighbors.
fig 2.a
fig 2.bStep 3:
Node n4 sends out its information to its neighbors.
fig 3.a fig 3.b
Step 4:Node n3 sends out its information to its neighbors.
fig 4.a
fig 4.b
Step 5:Node n5 sends out its information to its neighbors.
fig5.a
fig 5.b
Step 6:All the nodes whose distance vector have been changed send out their distance
vector to their neighbours. This is done till the graph becomes stable.The tables given below are the final distance vectors to each node in the graph.
fig 6
Problems in Bellman ford AlgorithmBellman ford algorithm has a number of loopholes namely:
● Bouncing Effect● Count to Infinity● Looping
Bouncing Effect
fig 7.a [4]
Lets say that edge n1n2 fail and node n3 wants to send some data packets to node n1. We can clearly see that n2 is the prefered neighbor for n3 and n1 is the prefered neighbour for n2. n3 therefore sends the data packet to n1 through n2. But, the link between n2 and n1 failed so, n2 sends the data packets to n3 with an updated distance vector of 2 and node 3 updates its distance vector to 3(which is the cost for the data packets to be sent from n3 to n1). This kind of bouncing keeps happening between the two nodes till the cost of sending the data packet increases to over 100 then, it is sent directly from n3 to n1. This effect causes a lot of time wastage and cost.
Count to Infinity
fig 7.b [4]In this case along with the link between n1 and n2 the link between n1 and n3 breaks. In
this case the data packets can not be sent to node n1 but, because the network is not aware of it the data packets sent over to node n2 keep bouncing between n3 and n2 and this time the count would be done till infinity. This cases a lot of delay and cost for transferring of packets.
Looping
fig 7.c [4]In this case lets say the link between n1 and n5 and the link between n3 and n5 breaks. In
this case the nodes n1 and n3 update their neighbours about the updated distance vectors. For instance the clockwise updation of the distance vector takes longer time than the anticlockwise updation. This way we know the prefered neighbours of the graph would not change. Because of which if a node wants to send some packets to node n5 it would form a loop and the data packets would keep looping till the time the anti clock wise data packets arrive thus providing the updated distance vector.
HypothesisDeletion of nodes in a graph simulating Bellman Ford Algorithm
causes the time for stabilizing the graph to increase.This just means that if increase the number of deleted nodes in a n node graph the
time to stabilize the graph by computing the distance vector on each node increases.
ApproachTo test the effects of deletion of nodes on Bellman Ford Algorithm we use node sensitive
graphs on which we simulate Bellman Ford Algorithm. Each time we increase the percentage of deleted nodes and check for the amount of time it takes to calculate the distance vectors of each node. We take the mean time for each percentage of deletions by doing ‘t’ trials on a ‘n’ node graph with ‘d’% node deletions.
Node Sensitive GraphsA node sensitive graph is one which tries to simulate a real world scenario. In this the
kind of a graph the nodes which are close to each other can have an edge between them unlike random graphs where nodes which are really far apart can have an edge between them.
In this kind of graph the user defines the radius of the node within which it can look for a node to connect to. It can not get connected any node which is further away than that distance.
fig 8. A node sensitive graph
StepbyStep Approach● In this project we would vary the no of nodes in a graph from 100-1,000.● We would check the time to stabilize the graph by increasing the percentage of deleted
nodes. We would increase from 1%-40%.● We would study the effects of increasing the deletion of nodes in each graph.● We would test the graphs for higher percentages of deletions too to check for any
interesting outputs.
We feel that increasing the percentage of deletion of nodes in the graph increases the amount of time it takes to compute the distance vector on each node.
Analysis of Research Paper I [4]This paper talks about the major drawbacks of the algorithm namely Bouncing Effect,
Count to Infinity and Looping. It suggests a few ways of avoiding this ills.Looping according to the paper can be avoided in a number of ways one could be by
knowing the size of the network but this would not work out well in case of a dynamic topology although a slowly changing network might work with this kind of a protocol. The other way to achieve loop freedom is by synchronisation but, this would make the algorithm slower and cause a lot of overhead cost. A freezing technique has been discussed where the node which has lost its prefered neighbour is not allowed to pass any data packets till its distance vector has been updated.
This paper describes an approach to avoid bouncing effect and count to infinity. In this approach we need to know the upper bound on the distance between the pair of nodes so that if a distance to node is greater than the upper bound it is considered disconnected. But, this approach has a disadvantage which is the prior knowledge of the upper bound. There is a second thing while trying to avoid count to infinity and bouncing effect. One should also try and follow simple paths in the graph and avoid looping. This can be done in the following manner. Along with the distances nodes need to store the path to the nodes too. This would help a node determine if the path is simple or is forming a loop. If a non simple loop is detected it just gets neglected. But, this approach causes a lot of overheads in storing the implicit path. To avoid this a concept of ‘head of the path’ was introduced where the head node of the path only stores the path information and not all this reduces the overheads to bear minimum.
The algorithm proposed by this paper removes count to infinity and bouncing effect but, it is still not able to remove the looping effect in this algorithm. Here, the proposed algorithm is able to reduce the amount of time required to stabilize the algorithm by a significant factor. In case of original Bellman Ford algorithm it takes O(N), time for single node failure/ recovery but in case of this algorithm it takes O(h) time where, h is the length of the shortest path in the graph.
Analysis of Research Paper II [2]This paper proposes a Loop free Bellman Ford Algorithm. It does not use the prior used
techniques where the graph needs to know the length or the one in which one needs to know the second to the last hop. This algorithm also eliminates the other two ills of this algorithm namely bouncing effect and count to infinity.
This algorithm is able to detect if a loop is getting formed in the graph and once it has detected the loop and it changes its successor to its destination and blocks the potential loop. The router should not send queries every time it has to change its successor to its destination because, it requires a lot of overheads. Instead it should compare the distance reported by its neighbour to the feasible distance and then take a decision. Thus, reducing the overheads of the algorithm.
Each router in this algorithm maintains a distance table, routing table and a linkcost table. The distance table at each router contains the distance and the predecessor for each destination and neighbour of the router. The routing table is a column matrix which contains the minimum distance, the predecessor, successor and the marker for each destination. The link cost table contains the cost of each link adjacent to the router.
The distance vector tables are updated when a router receives any changes information about the router. This is done to erase the old information in the distance vector table and update it to the new distance vector table.
Temporary loops can be blocked in this algorithm by following some feasibility conditions which are defined by the algorithm.
Routers are of two types while performing routing table updations namely active and passive. Passive routers are the one which have calculated the successor or they have figured out that they have no successor. The routers which are still looking for their successor are called active. Active router send infinite distance in their replies and queries till they find their corresponding successors. Simple paths are ensured in this algorithm using a technique called TRT.
This routing algorithm provides loop freedom something which has not been provided by any of the prior algorithms which have been suggested. Most of the algorithms which try to take care of the looping effect do that by blocking potential loops but, in this paper the algorithm sends path information to its neighbours in update messages containing labels of fixed sizes. It uses TRT to ensure usage of simple paths. Another technique called DT makes routers check for predecessor information reported by all the neighbours each time an input is done. It is scalable and updates only the tables which have been affected by the input.
Analysis of Research Paper III [3]This paper talks about the comparison between distance vector and link state routing
algorithm. Distance vector routing algorithm sends the data packets to its immediate neighbours to be sent to the destination node. In link state routing algorithm the nodes should know the topology of the whole graph. This paper talks about the ills of the two types of algorithms and the best fit situation in which they can be used.
In this project we are only concerned about the distance vector algorithm and the problems this algorithm faces and the steps that should be taken to improve it. So, we would only talk about that part of the paper. A concept called diffusing computation was introduced to check the termination of distributed computation. In this the initiating node is informed when the computation is over. In this case when the computation grows by sending queries and shrinks by receiving replies. Each node contains the length and the successor of the shortest path to each destination.
The first step in this algorithm occurs when a link failure occurs and it sends out messages and queries. The last step of the algorithm occurs when, all the replies are received for all the messages and queries. The space complexity for the algorithm suggested is O(|N|D) where, N is the number of nodes in the graph and D is the maximum degree of nodes. The time complexity is O(x) where, x is the number of active nodes in the graph. The time complexity of bellman ford algorithm is O(|N|) and communication and space complexity is O(|N2|).
The performance of the algorithm deteriorates with increasing nodal failures or network partitioning. Adding a wait state might improve the algorithm. In this, all the nodes wait for the reset message to be sent to them after a querying message is passed. This system works perfectly for single nodes but in case for multiple node failures it may cause the nodes to wait forever for a reset message.
This research paper helped us understand the time and space complexity of Bellman Ford Algorithm. This was great problem for us because detecting the model parameters for our project was an important step in proving or disproving our hypothesis
Design of the SoftwareControl Flow Diagram
Class Diagram
fig 9.b
Developer’s ManualThis project is a simulation so, it does not need any lengthy manner of compilation. We
need a computer which has Java 1.6 installed and we need to type in the following command:javac *.java
For compiling this software we would require the Parallel Java Library which is available on this link: http://www.cs.rit.edu/~ark/pj.shtml which can be installed and usd using the following this link: http://www.cs.rit.edu/~ark/pj.shtml#usage
So, before we type the above command on command line we would need to add this library to our class path.
User’s ManualThis project is a simulation so, it works on a simple java environment. We have tested it
on Java 6. Running this project requires the following command to be typed in:
java DistanceVector <seed> <minNumOfNodes> <maxNumOfNodes> <numOfEdgesFactor> <maxDistanceBetweenNodes>
<seed> = Random seed<minNumOfNodes> = Min Number of node<maxNumOfNodes> = Max Number of nodes<numOfEdgesFactor> = number of Nodes * factor<maxDistanceBetweenNodes> = Max Distance Between two vertices of the graphs
eg:java DistanceVector 12345 100 1000 10 10
Data CollectedThis graph has 100 nodes and we increase the number of deleted nodes and
observe the stabilizing time.
table 1
graph 1
This graph has 300 nodes and we increase the number of deleted nodes and observe the stabilizing time.
table 2
graph 2
This graph has 500 nodes and we increase the number of deleted nodes and observe the stabilizing time.
table 3
graph 3
This graph has 700 nodes and we increase the number of deleted nodes and observe the stabilizing time.
table 4
graph 4
This graph has 900 nodes and we increase the number of deleted nodes and observe the stabilizing time.
table 5
graph 5
Data AnalysisThis graph has 500 nodes and we increase the number of deleted nodes and
observe the stabilizing time.
The model parameters for this simulation isa+b*|N*d|where, N stands for the number of nodes
d stands for the number of deleted nodesThe value of pvalue in the above simulation clearly shows that the results do not match
the required results. Thus, disproving our hypothesis.In our hypothesis, we said that with the increase in the percentage of deletion the amount
of time required to compute the stabilizing time increase which is not true either. We can clearly see from the graphs 1 to 5 that after about 45 percent of deletions the stabilizing time starts decreasing thus, disproving our hypothesis clearly.
Future WorkWe figured out the major issues with this routing algorithm. We could work
towards improving the algorithm so as to avoid the major evils of this algorithm namely Count to Infinity, Bouncing Effect and Looping. This would help making the algorithm more dynamic and decreasing the amount of time it takes to re-compute the routes.
Learnings
○ This project helped us get a better understanding of routing algorithms.○ Through this we understood how to simulate a distributed algorithm.○ This also gave us an idea as to how this algorithm can be improved to
incorporate dynamic graphs like the ones we used in our project.○ This project helped us understand how the computation time of the algorithm
increases with the increasing number of deletions in the graph.
Contribution of Team MembersThis was a team project where, Prashant took care of the third research paper we
analysed . He designed the the node sensitive graph and took care of the simulation of the basic protocol of the bellman ford algorithm. Anshika analysed the first and second research paper and worked on the deletion of nodes in the algorithm and testing the response of the graph.
References[1] http://www.csanimated.com/animation.php?t=BellmanFord_algorithm
[2] A PathFinding Algorithm for LoopFree Routing, J. J. GarciaLunaAceves and Shree Murthy, IEEE ACM Transactions on Networking, February,1997, http://delivery.acm.org.ezproxy.rit.edu/10.1145/250000/245233/00554729.pdf?ip=129.21.35.191&acc=ACTIVE%20SERVICE&CFID=274186591&CFTOKEN=75197995&__acm__=1360533589_fcdde1d4f35051e225c870ae8e707918[3] A unified approach to loop free routing, J.J. GarciaLunaAceves, 1989 ACM, http://delivery.acm.org.ezproxy.rit.edu/10.1145/80000/75268/p212garcialunaaceves.pdf?ip=129.21.35.191&acc=PUBLIC&CFID=274186591&CFTOKEN=75197995&__acm__=1360461693_a3a3e766f0b19c6b5004d979c7c9cd43[4] A loop free Bellman Ford routing Protocol without bouncing Effect, J.J. GarciaLunaAceves, 1989 ACM, http://delivery.acm.org.ezproxy.rit.edu/10.1145/80000/75269/p224cheng.pdf?ip=129.21.35.191&acc=PUBLIC&CFID=274186591&CFTOKEN=75197995&__acm__=1360534002_ae402e0ae75608c9a50062bc17255dfc[5] Simulation simplified[6] Parallel Java Library