Routing – Link-state routing Vs Distance-vector routing algorithm used confusion

protocol-theoryrouting

In Link-state routing protocol Dijkstra's algorithm is used. In Distance-vector routing protocol Bellman-Ford algorithm is used. My question is why we use two different algorithm. Why not only one algorithm?

Dijkstra's Algorithm can't work on negative edge, but in routing there can't be any negative edge. OK but in matter of debate let's say there can be any negative edge in case of malfunctioning. Then why not use Bellman-Ford in both protocol?

Best Answer

Distributed Bellman-Ford (BF) and Dijkstra work in opposite directions: BF builds path starting at the source of the routing information (the data sink), while Dijkstra starts at the data sender.

Since distance vector protocols work incrementally starting at the source, they cannot use Dijkstra, and hence use distributed BF. There is nothing in principle that would prevent a link-state protocol from using BF, but (non-distributed) BF has cubic complexity, while Dijkstra (if implemented correctly) is O(n² log n).

(Because of the different directions, BF and Dijkstra will build different paths with some very weird metrics — metrics that fail Sobrinho's isotonicity condition —, but the difference is unlikely to be relevant in practice.)

Related Topic