Page Content

Tutorials

What Is OSPFv2 Open Shortest Path First Version 2 In Network

What is OSPFv2?

What is OSPFv2
What is OSPFv2

A popular link-state Interior Gateway Protocol (IGP) for IPv4 networks, OSPFv2 (Open Shortest Path First version 2) is used to route IP packets within a single routing domain or Autonomous System (AS). Because OSPF is built on an open standard, it can be deployed by multiple vendors. RFC 2328 defines the OSPFv2 specification.

Finding the distance between two endpoints in a network and figuring out the optimum route between them is OSPFv2’s main goal.

Core Operation and Components

Operating on a link-state foundation, OSPFv2 mainly consists of three stages: path computation, Link-State Advertisement (LSA) flooding, and neighbour initialisation.

Also Read About What Is EIGRP Enhanced Interior Gateway Routing Protocol?

Link-State Database (LSDB) and SPF Algorithm

The three primary stages of OSPFv2, a link-state routing protocol, are adjacency and neighbour initialisation, Link-State Advertisement (LSA) flooding, and Shortest Path First (SPF) tree computation.

  • Every OSPF router keeps an LSDB in memory that contains all of the Link-State Advertisements (LSAs) that it has received from other routers. The entire network topology map or tree is contained in the LSDB.
  • LSA Flooding: OSPF describes the network architecture using LSAs, which are data structures that hold link-state and routing information. The router floods modified LSAs when the network changes.
  • SPF Algorithm: OSPFv2 processes the LSDB using the Dijkstra Shortest Path First (SPF) algorithm to identify the optimal paths.
    • The executing router is at the root of the shortest-path tree that the algorithm constructs.
    • The IP routing table is then updated with the best pathways from the SPF tree, displaying the subnet number, mask, outgoing interface, and IP address of the next hop.

OSPFv2 Metric and Route Selection

Cost is a measure used by OSPF. The path with the lowest overall cost is the best one.

  • The OSPF interface fees for each outgoing interface along the path are added up to determine the cost of a route.
  • Cisco Implementation: The cost of Cisco’s implementation is based on bandwidth. The formula 108/bandwidth (in bps) is used to determine the cost.
  • Changing the global auto-cost reference-bandwidth subcommand, modifying the interface bandwidth setting, or directly displaying the IP ospf cost on the interface are all ways that engineers can affect the cost. Notably, the OSPFv2 metric computation is unaffected by delay.
  • Administrative distance (AD): The administrative distance (AD) of 110 is the default value for OSPF. Because OSPF’s AD (110) is lower than RIP’s AD (120), OSPF routes are recommended over RIP routes.

Neighbor Adjacencies and States

Routers that share a subnet and exchange routing data are known as OSPF neighbours.

  • Hello Protocol: The OSPF Hello protocol uses Hello messages to manage relationship maintenance and dynamic neighbour discovery. The multicast address 224.0.0.5 (AllSPFRouters) is where hello packets are sent.
  • Neighbour States: Two-way key states indicate bidirectional communication and OSPF parameters that work. When the topological swap is finished, the neighbours are entirely adjacent, which is the ultimate state.
  • Adjacency Requirements: In order for routers to establish an adjacency, a number of requirements must be met, such as Hello/Dead timings and appropriate authentication configurations. Dead timers or mismatched OSPF greetings will stop neighbours from forming. Routers may be able to reach the 2-way state with mismatched IPv4 Maximum Transmission Unit (MTU) values, but they will not be able to exchange LSDBs, and eventually the neighbour relationship will break down.

Also Read About What Is Mitigation In Network Security? Techniques And Risks

Adjacency States

In order to achieve complete adjacency, OSPF routers go through multiple states:

  • The initial condition in which no Hello packets have been received is known as the “down state.”
  • Init State: The router has not yet seen its name included in the neighbor’s Hello packet, despite receiving a Hello packet.
  • Two-Way State: Since each router recognises its own Router ID in the neighbor’s Hello packet, bi-directional connection is verified.
  • ExStart/Exchange States: Routers exchange Database Description (DBD) packets summarising their LSDB contents and form a Master/Slave relationship (the router with the highest Router ID becomes the Master).
  • Loading State: Routers use Link-State Request (LSR) packets to request missing topological information, and they receive the necessary information in Link-State Update (LSU) packets.
  • Full State: Path calculation using SPF is possible because the adjacency is completely formed and the LSDBs are synchronised.

Router ID and DR/BDR Election

  • Router ID (RID): The OSPF router’s unique 32-bit identification. Usually, it is the highest IP address of loopback interfaces that are configured, or, in the absence of a loopback, the highest IP address of physical interfaces that are currently in use.
  • DR and BDR stand for designated router and backup designated router, respectively. A DR and BDR are chosen for multi-access network types, such as broadcast Ethernet.
    • The DR is in charge of allocating LSAs across the shared network and reducing the amount of adjacencies. The BDR is used as a backup.
    • First, the OSPF interface with the highest priority (0–255) is used for election. The highest Router ID serves as the tiebreaker in the event that priority are tied.
    • Updates are routed to the multicast address 224.0.0.6 (AllDRouters) for the DR and BDR. DR/BDR election is not performed by point-to-point networks.

Scalability and Areas

In order to minimise the size of the LSDB, eliminate routing overhead, and lessen the computational load from frequent SPF computations, OSPFv2 allows hierarchical routing by segmenting the network into logical sections.

  • The primary and required region to which all other non-backbone areas must logically relate is known as region 0 (Backbone Area).
  • Area Border Routers (ABRs): These routers connect various areas and share routing information via Summary LSAs (Type 3). They have interfaces in Area 0 and at least one other area.
  • Autonomous System Boundary Routers (ASBRs): These routers link an external network using a different routing protocol (like BGP) to the OSPF routing domain.

Also Read About AH Authentication Header In Network Security & How AH Works

OSPFv2 Configuration

Router ospf process-id global command is used to start OSPFv2 configuration. There are two ways to enable interfaces for OSPFv2:

Conventional Router Configuration Mode Network Command:

  • In router configuration mode, the network-address wildcard-mask area area-id command is utilized.
  • On interfaces whose IP addresses are inside the designated network address range, this command activates OSPF.

Interface Configuration Mode, also known as Interface Subcommand Mode:

  • The interface makes explicit use of the ip ospf process-id area area-id command.
  • The network area command can be substituted with this technique.
  • It is very helpful for making unnumbered interfaces with various sections easier to configure.
  • The effects of the more general network area command for that particular interface are superseded if this command is used. Only OSPFv2 supports the command.

Security

In order to secure routing updates, OSPFv2 supports the following authentication methods:

  • A simple password is sent using plaintext authentication, which is unsafe.
  • The suggested technique for OSPFv2 is MD5 Authentication (Cryptographic), which employs Message-Digest Algorithm 5 to cryptographically sign the OSPF packets.

OSPFv2 Commands

You may use a range of display commands to check and troubleshoot OSPFv2 operations:

show ip protocols:The OSPF process ID, router ID, advertising networks, neighbours that are delivering updates, and the default administrative distance (110) are among the setup details that are verified.

show ip ospf neighbor: Confirms the establishment and adjacency of neighbour relationships.

show ip ospf interface: Shows the OSPF parameters that are set up on an interface, including the area, cost, process ID, and timer intervals (Hello/Dead).

show ip ospf database: Shows an overview of the database’s LSAs arranged according to LSA type.

show ip route ospf: Only the OSPF-learned routes that are presently active in the routing table are displayed by ospf.

clear ip ospf process: This causes the process to reselect the RID and resets the OSPFv2 neighbour adjacencies.

OSPFv2 vs OSPFv3

OSPFv2 vs OSPFv3
OSPFv2 vs OSPFv3

While OSPFv3 supports IPv6 routing, OSPFv2 supports IPv4. Despite having similar fundamental working principles, they retain different adjacency tables, OSPF topology tables, and IP routing tables and execute different SPF operations on the router.

Like OSPFv2, the OSPFv3 Router ID still needs a 32-bit IPv4 address. Link-local addresses are used by OSPFv3’s adjacencies and next-hop characteristics.

  • Multiplecast addresses for OSPFv2: 224.0.0.5 and 224.0.0.6.
  • The multicast addresses for OSPFv3 are FF02::5 and FF02::6.
  • OSPFv3 messages are contained in IPv6 packets, whereas OSPFv2 uses IPv4 packets for transit.
  • By using IPSec for authentication rather than the OSPFv2 customisable procedures, OSPFv3 eliminated the Authentication and AuType fields from the packet header.
Hemavathi
Hemavathihttps://govindhtech.com/
Myself Hemavathi graduated in 2018, working as Content writer at Govindtech Solutions. Passionate at Tech News & latest technologies. Desire to improve skills in Tech writing.
Index