Question

There a quite a few questions here on this algorithm but I haven't been able to find that how would it handle negative weight cycles? Suppose a router x gets update from router y that cost of y to z is 5. Later, router x gets update from router y that cost of y to z is 2 now. What does router x do? My understanding is that Bellman Ford algorithm states that error should be raised in this case. But what distance vector routing algorithm do - simply update it or raise an error or something else?

Was it helpful?

Solution

Not sure if I'm reading this question right. Updates from routers can specify a new cost for a path whether it be higher or lower than before. If x gets an update from y for a path to z with cost of 2 (originally 5), then x should simply update its forwarding table with the new cost path and use this path to get to z if it is the least cost path.

OTHER TIPS

You have a conflict between the lower cost of bellman-Ford Algortihm and the next hop update of the link cost , the first can be done between two or more different interfaces to get the cheaper cost ,for exemple:

**Case 1:**Router A has 3 neighbors N1,N2,N3, and N1,N2,N3 have X as a neighbor

|---2----N1-----4----|
A`--4----N2-----3----X
|---1----N3-----2----|

For the router A we have :

 X via N1 =6 
 X via N2=7            the lowest is :**X Via N3=3**
 X Via N3=3

-Here A will choose X via N3(between N1,N2,N3) because it is the lowest one Case 2: if the link cost between (X-N3=2) have been changed to (X-N3=8)we suppose due to a configuration of the link (even 8 is more than 2 but it is an obligation ),N3 should inform A about that and A must update the cost from (X Via N3=3) to (X Via N3=9) , hence we return to case (1) : choose the lowest cost that will be via N1

     X via N1 =6 
     X via N2=7            ****the lowest is :**X Via N1=6******
     X Via N3=9  
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top