Introduction to OSPF Routing Protocol

Why OSPF Routing Protocol?

In the previous posts, we have discussed the static routing, RIP routing, and EIGRP routing. These routing methods are suitable for a small-to-mid-sized network. But if you talk about the Internet, there are the unlimited number of routers that are being used. On the Internet, these routing methods might not be capable of handling the complex routing processes. Here comes the Open Shortest Path First (OSPF) routing protocol as a solution for this. In this post, we will discuss the various features and terms used with the OSPF routing protocol.

Features of OSPF Routing Protocol

Similar to the other routing protocols, the OSPF routing protocol has its own characteristics, features, and limitations. Some of the key features of the OSPF routing protocol are:

It supports load balancing with equal cost routes for the same destination.

It is an open standard routing protocol, means it can be implemented on all the routers whether it is Cisco or Juniper.

It uses the Shortest Path First (SPF) algorithm and Cost metric to calculate the best path for a destination.

It is a classless routing protocol that supports CIDR, VLSM, and route summarization.

Since it supports the unlimited number of hop counts, hence it can be implemented on an enterprise-sized network.

It is a link-state routing protocol.

The Administrative Distance (AD) value of OSPF is 110.

It uses trigger updates that allow faster convergence.

It consumes more resources, such as CPU and RAM to handle the routing process.

It is more complex to implement and difficult to troubleshoot than the RIP and EIGRP routing protocols.

It targets to maintain loop-free and precise routing tables.

OSPF Area

One of the most confusing terms used with the OSPF routing protocol is Area. It is really a difficult task to handle an OSPF-based enterprise network. An OSPF-based enterprise network can be divided into multiple sub-domains using the concept of area.

An area is a logical group of OSPF-based networks, routers, and links that have the same area number. Routers belong to the same area keep a topological database for the entire area. A router of an area does not have enough information about the network configuration of other areas. It helps to reduce the size of the OSPF database.

An OSPF area can be divided into three categories: Backbone area, Off backbone area, and Stub area.

Backbone area: As the name suggests, it is the area that handles the core (central) part of the network called backbone network. Typically, all the network traffic of an OSPF-based network, directly or indirectly, passes through the backbone area. In other words, you can say that all areas are required to connect to this area either through a physical link or through a virtual link. This area is always denoted by the Area0. Routes of the area 0 are required to maintain a complete database of the entire network.

Off backbone area: Areas other than the backbone area are called the off backbone areas. Routers of this area maintain only an area-specific database instead of the complete database of the entire network.

Stub area: This is also an off backbone area that contains only a single Area Border Router (ABR). ABR is discussed in the next section.

To understand the OSPF components, such as area, ABR, and ASBR, take a closure look up at the following figure.

OSPF Border Routers

Apart from the OSPF areas, you should also be familiar with the OSPF border routers. There are two types of OSPF border routers: ABR and ASBR.

Area Border Router (ABR): As the name suggests, ABR is a router (R) that is placed at the border (B) between the two or more areas (A).

Autonomous System Border Router (ASBR): As the name suggests, it is a router (R) that is placed at the border (B) between two or more Autonomous System (AS) networks.

Designated Router

OSPF uses the Link State Advertisement (LSA) packets to exchange routing information between routers. Exchanging LSA packets between all routers in a large network can significantly increase the traffic and reduce the response time. In an OSPF-based network, instead of exchanging LSA packets between all routers, the OSPF routing protocol elects a Designated Router (DR) for each area. All other routers in that area exchange routing information only with the DR. The DR then exchange OSPF routing information to all other routers within the same area, thus reducing the traffic. In simple words, DR acts as the central point for exchanging OSPF routing information of a specific area.

An LSA packet contains the link-state and routing information. Each OSPF router maintains a Link State Database (LSDB) that is a collection of all the LSA packets received by a router.

Backup Designated Router

Backup Designated Router (BDR) is a router that contains a backup copy of the routing information stored on DR. So if the DR router fails, BDR takes the responsibility of exchanging routing information between routers within a specific area.

Establishing OSPF Neighborship

OSPF routers exchange LSA packets and routing information only with the neighbors. To discover the neighbor routers in an OSPF area or a network segment, OSPF uses the hello packets that contain the essential configuration values and parameters. In order to establish the neighborship between two OSPF routers, these values and parameters must be same on both the routers.

The following OSPF configuration values and parameters must match between the routers participating in establishing the OSPF neighborship.

Area ID: Routers must be in the same area.

Authentication method: The authentication method/protocol/password must be same on both the participating routers.

Hello and dead intervals: The hello and dead intervals must be same on all the participating routers.

Stub flag: It contains the information about the Stub area. Routers that want to establish the OPSF neighborship must have the same stub area flags.

Maximum Transfer Unit (MTU): It is the maximum size of a single packet. It is an optional value that one should consider to matching.

OSPF Hello Packet

A hello packet is a special type of LSA packet used to discover the neighbor routers in the same network segment. When the OSPF routers establish neighborship, they use hello packets to maintain the neighborship. These packets are exchanged at the regular intervals called Hello Intervals through the multicast transmission.
The default value of the hello interval is 10 seconds. If a router does not receive a hello packet from its neighbor router within 40 seconds, it considers that router as dead. This interval time is called Dead Interval.