
Routing Protocols: OSPF
As we have looked at in earlier articles there are 2 types of routers: static and dynamic. As we have mentioned, a static router is manually added by administrators; the procedure for which can often be difficult in larger networks. That’s where dynamic routing protocols come in; they are responsible for updating this information automatically in the routing table of network attached devices.
We also looked at the RIP protocol which is a distance vector protocol, so the following article is discussing OSPF (Open Shortest Path First). This protocol is used to discover the best path for forwarding packets to their destination, via an interior gateway protocol.
The OSPF can be used to replace RIP on larger networks as it has more advantages, many of which are detailed in the table below:
One huge advantage is the fact that the OSPF does not send the entire routing table every 30 seconds, like the RIP does. The OSPF sends only a part of this routing table when a change occurs in the routing table.
RIP counts the hops and makes a decision where is best to send the packets, based on the hops. However, OSPF automatically calculates the best path based on the link bandwidth.
For example, there is a network with three types of connection, serial, Ethernet and gigabit Ethernet. The first serial path is only 2 hops. Another is an Ethernet path that is 3 hops away and the third is a path with 5 hops, however it’s from a network where all connections use gigabit Ethernet; it will select the 5 hops-path as the packets will arrive faster. There is a default reference bandwidth of 100000Kb/s which the router will divide each reference with the bandwidth metric (see the below table that explains the OSPF cost from each bandwidth) to find the lowest result it can for each path.
So, the calculation is made using the following formula:
Cost = (the above table) Divided by 100,000,000 (bps) : Cost = 100,000,000/ bandwidth (bps).
Now let’s see one more time a table with some examples of this formula being used:
OSPF uses an SPF algorithm and Dijkstra algorithm to calculate this metric.
Now you have a better idea how OSPF works, it is clearly far better than the RIP, as it can be used for large networks, and provide better routes for the packets to reach a network. It also provides support for up to a 255 hop count distance.
OSPF also discovers neighbours automatically by sending “hello” messages every 10 seconds using a multicast address of 224.0.0.5 which holds the signal for 40 seconds.
It supports MD5 authentication as well. See the below picture for more details.
In general, OSPF is particularly helpful for use by big companies’ with large IT infrastructures as it can support a lot of networks simultaneously and can expand the route information to extended networks; However this is what makes OSPF use more resources than RIP and therefore it completes calculations that the RIP doesn’t have to. As a result OSPF needs more processing power, but there are many routers capable of supporting OSPF and if it is needed by your company there is plenty of hardware out there ready to smoothly help the performance of your network infrastructure.