You are on page 1of 2

Comparison of Bellman Ford and Dijkistra Algorithms

Hassan Ali, NabeelSafdar, Zubair Khan

University College of Engineering & technology The Islamia University of Bahawalpur, Pakistan Email:Nabeeltelecommunication@gmail.com,Zubi0313@gmail.com

Abstract Both Dijkstra and Bellman-Ford algorithms are prepared to find the shortest path in a network. The value of shortest path can vary according to the needs of the network. There may be a length or cost problem that is needed to be solved. From the perspective of finding the result, these two algorithms satisfy the same expectations. However, there are some differences which occur during the deciding procedure of vertexes that will be determined for finding the shortest path. Both of these algorithms provide OSPF (open shortest path first) from source to destination in communication network. If there are nonnegative values in the pre-defined paths of a specific network, Dijkistra algorithm is not useful to find the suitable shortest path. However, Bellman-Ford algorithm can handle negative weights/lengths and continue to complete the process unless there is a complete negative weighted cycle which is reachable from the source vertex in the network. The vertexes in Dijkistra algorithm contain the whole information of a network. There is no such thing that every vertex only cares about itself and its neighbors. On the other hand, Bellman-Ford algorithms nodescontain only the information that is related to. This information allows that node know about which neighbor nodes can it connect and the node that the relation come from, mutually. Dijkistra algorithm is faster than BellmanFords algorithm however the second algorithm can be more useful to solve some problems, such as negative weights just to of paths. Dijkstra cant deal with negative weights but Bellman Ford can deal with negative weights. In this paper we will discuss both the algorithms and compare them. We will also give examples of calculating OSPF from source to destination.

other hand, it offers more features than simpler protocols such as RIP. The custom in OSPF networks is to make the link cost inversely proportional to the bandwidth of a link.This isn't required, but it is common, and it is the default behaviour for Cisco routers. The reference bandwidth defines the link speed that has an OSPF cost of 1. By default, the reference bandwidth is 100 Mbps. There is interesting problem with the way OSPF calculates its metrics. The problem is the OSPF metric is only 16 bits long, giving it a maximum per-link cost value of 65,535. So, if your fastest links use 10 Gbps Ethernet and you set the cost of this link to 1, then a relatively common 56 kbps serial link would need to have a cost of 178,571, and a 128 kbps circuit would cost 78,125. Since this is not possible, OSPF would use the maximum link cost of 65,535 for both of these low-speed links. This could cause some very poor routing patterns. Here are some of OSPFs strengths: It converges quickly, compared to a distance-vector protocol. Routing update packets are small, as it does not send the entire routing table. It scales very well for large networks. It recognises the bandwidth of a link and takes this into account in link selection. It supports variable length subnet mask (VLSM) or Classless Inter-Domain Routing (CIDR). It uses MD5 authentication for routing information. Review of the state of art Comparison between Bellman ford and Dijkistra Strengths and weakness Problems and theorems

INTRODUCTION OSPF is a link state routing protocol that runs Dijkistra algorithm to calculate the shortest paths to other networks. Taking the bandwidth of the network link into account, it uses cost as its metric. OSPF works by developing adjacencies with its neighbours, periodically sending hello packets to neighbours, flooding changes to neighbours when a link status changes ,and sending paranoia updates to neighbours of all recent link state changes every 30 minutes.While OSPF is an excellent routing protocol for networks of all sizes, one of its weakness is that it can be quite complex to configure. On the

Problem statement Dijkistra algorithm doesnt work with negative weights. So we will make an algorithm which handles negative weights and find the shortest path in a network.

Routing protocols OSPF (Open Shortest path first) and RIP Information Protocol) both are used to shortest path. Dijkistra algorithm belongs to OSPF and ford algorithm belongs to RIP. Both algorithms find the shortest path but different techniques. Dijkstra algorithm

Dijkistra (Routing find the Bellman they use It converges compared to a vector protocol. quickly, distance-

Bellman Ford It converges slowly due to the information transfer only between neighbors. It is used for small networks (15 routers). It doesnt support VLSM.

It scales very well for large networks (150 routers). It supports variable length subnet mask (VLSM) or Classless Inter-Domain Routing (CIDR). It uses MD5 authentication for routing information. It uses cost as a metric. It uses less bandwidth. OSPF allows for better load balancing.

It converges quickly, compared to a distance-vector protocol. It scales very well for large networks. It recognises the bandwidth of a link and takes this into account in link selection. It supports variable length subnet mask (VLSM) or Classless Inter-Domain Routing (CIDR). If there are non-negative values in the pre-defined paths of a specific network, Dijkstras algorithm is useful to find the suitable shortest path. The vertexes in Dijkstras algorithm contain the whole information. Dijkstras algorithm is faster than Bellman-Fords algorithm Bellman-Ford algorithm

It doesn't use any authentication. It uses hop count as a metric. It uses more bandwidth. No concept of load balancing.

Distance vector routing is so named because it involves two factors: the distance, or metric, of a destination, and the vector, or direction to take to get there. Routing information is only exchanged between directly connected neighbours. This means a router knows from which neighbour a route was learned, but it does not know where that neighbour learned the route; a router can't see beyond its own neighbours

Conclusion When there is negative weight in the system then we will use Bellman-Ford because Dijkistra cannot support negative weights. But when there are non-negative weights than we will use Dijkistra algorithm. Bellman-Ford algorithm is used in small networks whereas Dijkistra algorithm is used for large networks.

You might also like