What is OSPF Protocol (Open Shortest Path First)?

OSPF (Open Shortest Path First) is an internal gateway hierarchical routing protocol or IGP (Internal Gateway Protocol) that uses the Dijkstra link-state algorithm (LSA – Link State Algorithm) to calculate the route. It uses “cost” as a metric measurement as possible, and additionally creates the same link-state database for all routers in the zone.

OSPF is the IAB response through IETF, given the need to create an internal routing that meets the internal routing Internet requirements shown by the RIP version 1:

  • Slow response to changes in the network topology.
  • It is used to measure the distance between nodes in measurements.
  • Inability to distribute traffic between two nodes over several paths if available due to network-saturated loops.
  • Impossible to distinguish between different types of services.
  • It is impossible to distinguish between hosts, routers and different network types within the same Autonomous System.

Some of these points have been resolved with RIP version 2, which has more metrics, as well as supporting CIRD, subnet routing, and multicast transmission, but the development of OSPF by IETF is based primarily on the use of a different algorithm. Standard routing protocols in TCP/IP are used to calculate the minimum path between two nodes of the network.

OSPF Features

Quick Response Without Loops to Changes

The SPF algorithm on which OSPF is based, with the available technology, allows a response time in the nodes to be much faster than the calculation mentioned in the RIP in terms of computation times for computing the local map of the network.

In addition, all nodes of the network compute the map in the same way, and because they have the same map, they are created without loops or nodes counted in infinity; It is the main problem experienced by protocols such as distance vector algorithms such as RIP.

Security Against Changes

For the routing algorithm to work properly, an identical copy of the network topology must exist on each node of the network. There are various failures in the network, such as synchronization errors or overflow protocols, memory errors, and identification of incorrect information. The OSPF protocol specifies that all exchanges between routers should be authenticated. OSPF allows various authentication schemes and also allows you to select a schema for a different field than the schema of another field. The idea behind authentication is to allow only trusted routers to propagate routing information.

Support for Multiple Measurements

Current technology makes it possible to support several measurements in parallel. Evaluating the path between the two nodes according to different measurements, in each case according to the metric used to have different best ways. This selection, the different measurements to be made according to the requirements in communication can be:

  • Higher performance
  • Low latency
  • Lower costs
  • Increased reliability

The possibility of using various measurements to calculate a route means that after selecting a metric for the OSPF to create a route, it provides a mechanism that is always the same for this packet, always providing the OSPF the same.

Load Balancing in Multiple Ways

OSPF allows load balancing between nodes with multiple paths. This applies to perform the balancing:

  • A modified version of SPF that prevents the creation of partial loops.
  • An algorithm that allows you to calculate the amount of traffic that must be sent to each road.
  • Scalability of growth of external routes.

Show Commands

A set of OSPF show commands that allow you to monitor and verify the operation of the protocol on the device:

Router# show ip ospf
Router# show ip ospf neighbor
Router# show ip ospf interface
Router# show ip route ospf

How Does It Work?

The basic sequence of operations performed by OSPF routers is:

  • OSPF discovers its neighbors.
  • Selects DR (designed router).
  • Synchronizes databases.
  • Calculates the routing table.
  • Identifies connection states.

The routers will perform all these steps during activation and repeat in response to network events. Each router must perform these steps for each network it is connected to, except to calculate the routing table. Each router creates and maintains a single routing table for all networks.

Protocol Messages

There are five types of OSPF protocol messages:

1) HELLO Message

  • Identifies your neighbors to create a local map database.
  • It sends signals to the rest of the routers to protect the local map.
  • Selects a designated router for the multicast network.
  • Finds the currently specified router.

2) Database Description

The router exchanges information to find missing data during the initialization or synchronization phase when two nodes establish a connection.

3) Link Status Request

Used to request data that is missing from a router’s database or that is not used during the exchange of information between two routers.

4) Link Status Update

Link status is used to respond to request messages and also to dynamically report changes in the network topology.

5) ACK Link Status

Used to confirm receipt of a Link Status Update.

Package Included

The package content that the protocol generates consists of:

Version Number: Identifies the OSPF Version.
Type: Defines the type of OSPF package (Hello, database status, status, and connection requirements).
Package Length: Specifies the size of the package containing the header.
Router ID: Defines the origin of the packets.
Field ID: Identifies the field to which the packets belong, all OSPF packets are bound to one field.
Checksum: Ensures that the integrity of the package is checked.
Authentication Type: It contains the OSPF authentication type (security).
Validation: Contains validation information.
Data: Contains the encapsulated top layer information.

OSPF is probably the most commonly used type of IGP protocol in large networks. You can work safely using MD5 (Message-Digest Algorithm 5, 128-bit encryption reduction algorithm) to verify your scores before moving to new routes and accepting connection status notifications.

   Related Articles

2. RIP
3. GNS3
4. OSPF Routing
5. GNS3 VM



In my personal blog, I will explain the solutions to the problems I encounter in the system, network, and information technologies for you. If you want to contact me or consult about a problem, you can send an e-mail to [email protected]