# OSPF

## 1. Protocol Overview

OSPF (Open Shortest Path First) is a type of IGP (Interior Gateway Protocol) and a link-state dynamic routing protocol based on graph theory.
This product supports the following OSPF protocols:

- OSPFv2 (RFC2328)
  This is designed for IPv4 networks to resolve the scale limitations inherent in distance vector routing protocols such as RIP (Routing Information Protocol), which are also IGPs.
  Compared to RIP, it has the following features:

  - When a route is changed, it propagates quickly.

  - Problems caused by equipment failures or other reasons can be detected quickly.

  - The entire network can be divided into multiple areas and managed.

  - The handling of routes (external routes) using protocols other than OSPF is specified.

  - The protocol is complex and requires significant CPU power and memory.

- OSPFv3 (RFC5340)
  This protocol follows the OSPFv2 specification and is designed for IPv6 networks.
  Compared to RIPng, an interior gateway protocol that supports IPv6, it has the following features:

  - When route information changes, the route stabilizes in a short time.

  - The entire network can be divided into multiple areas and managed.

  - The handling of routes obtained by protocols other than OSPFv3 (external routes) is specified.

  - The protocol is complex and requires significant CPU power and memory.

  The basic concepts and algorithms of OSPFv3 are almost the same as those of OSPFv2.
  However, there are some differences due to differences in the protocol systems between IPv4 and IPv6 and changes in some concepts.
  The main differences are as follows:

  - Except when using virtual links, link-local addresses are used for database synchronization.

  - Authentication of OSPF packets has been removed from the OSPFv3 specification.

  - An instance ID is assigned to the interface to allow multiple OSPFv3 routing domains to be configured on the same link.

This page provides an overview of OSPF.
For command descriptions, configuration guides, and configuration examples for actually building an OSPF network, refer to the related documentation.

## 2. Definition of Terms Used

Notation in RFCs | Abbreviation | Notation on this page
--- | --- | ---
Router ID | - | Router ID
Internal Router | - | Internal Router
Area Border Router | ABR | Area Border Router
AS Boundary Router | ASBR | AS Boundary Router
Link State Advertisement | LSA | Link State Advertisements
Link State Database | LSDB | Link State Database
Designated Router | DR | Designated Router
Backup Designated Router | BDR | Backup Designated Router
Neighbor | - | Neighboring Router
Adjacency | - | Adjacent Router
Virtual Link | - | Virtual Link
AS External route | - | External Route

## 3. Number of Routes and Number of Recommended Neighbors

The number of routes and recommended number of neighbors that can be handled by OSPFv2 and OSPFv3 are as follows:

- OSPFv2

  Models | Number of routes | Recommended number of neighbors
  --- | --- | ---
  SWX3200-28GT SWX3200-52GT | 4096 | 50
  SWX3220-16MT SWX3220-16TMs | 8192 | 50
  SWX3220-30MC SWX3220-30TCs | 16384 | 50

- OSPFv3

  Models | Number of routes | Recommended number of neighbors
  --- | --- | ---
  SWX3200-28GT SWX3200-52GT | 2048 | 50
  SWX3220-16MT SWX3220-16TMs | 8192 | 50
  SWX3220-30MC SWX3220-30TCs | 16384 | 50

## 4. Function Overview

### 4.1. OSPF Area

In OSFP, the network is divided into regions called "areas," and route information is managed for each area.
The backbone area is the core of the OSPF network, and other areas are placed around it depending on their intended use.

There are four types of OSPF areas:

Area Name | Description
--- | ---
Backbone Area | This is the central area required for an OSPF network. It is decided to use "0.0.0.0" as the area ID. Areas other than the backbone area must be directly connected to the backbone area. Route information between areas is exchanged by Area Border Routers (ABRs) located at the boundaries between the backbone area and other areas.
Stub Area | This area is provided for using OSPF on devices with limited resources such as memory. Compared to backbone areas and standard areas, stub areas have the following limitations: * External route information (route information advertised by routing protocols other than OSPF) is not advertised from the backbone area. * Routing to external destinations within a stub area uses the default route advertised by the area border router (ABR). * AS boundary routers (ASBRs) cannot be placed within stub areas. * Route information from the backbone area to other areas is advertised, but this can be limited. * Virtual links are not supported.
NSSA (Not So Stubby area) | This area is provided as an extension of the stub area. Compared to stub areas, it allows for the placement of an AS boundary router (ASBR) and enables the collection of a small amount of external route information. Compared to backbone areas and standard areas, stub areas have the following limitations: * External route information (route information advertised by routing protocols other than OSPF) is not advertised from the backbone area. * Routing to external destinations within a stub area uses the default route advertised by the area border router (ABR). * Route information from the backbone area to other areas is advertised, but this can be limited. * Virtual links are not supported.
Standard Area | Areas other than those mentioned above. There are no particular restrictions on advertising route information.

Devices that belong to an OSPF area are called "OSPF routers" and are identified by a unique "router ID."
OSPF routers are classified into the following three types depending on where they are located:

Type | Abbreviation | Description
--- | --- | ---
Internal Router | - | A router that is deployed only within a specific area. SWX (1) in Figure 1 is an internal router.
Area Border Router | ABR | A router located at the boundary between the backbone area and other areas. SWX (2), SWX (3), and SWX (4) in Figure 1 are area border routers.
AS Boundary Router | ASBR | A router located at the boundary between an OSPF network and a network using a routing protocol other than OSPF. The SWX (5) in Figure 1 is an AS boundary router.

### 4.2. OSPF Messages

In OSPF, routers exchange information called Link-State Advertisements (LSAs) to understand the topology both within and outside their areas. The link state is then managed by creating a link state database (LSDB) by combining the received LSAs with its own LSAs. All OSPF routers belonging to the same area maintain the same LSDB and are constantly synchronized. Therefore, even if there is a change in the route information, the changes are synchronized with the LSDB of other OSPF routers, allowing the failure to be detected and communication to be restored using an alternative route.

In OSPF, the following messages are used to search for OSPF routers that belong to the same area and to exchange route information.

Message type | Message Name | Abbreviation | Description
--- | --- | --- | ---
1 | Hello | Hello | Used to search for OSPF routers that belong to the same area. The router ID is included in the message and is also used to find the designated router. Route information is exchanged between OSPF routers that have established neighboring relationships using Hello messages using the following messages.
2 | Database Description | DD | To the OSPF router with which it has established a neighboring relationship, it sends a DD message containing the link state headers of all LSAs it holds. An OSPF router that receives a DD message compares the information in the link state header with the LSBD it holds, and if there is an LSA that needs to be acquired or updated, it requests the LSA from the sender of the DD message.
3 | Link State Request | LSR | If there is an LSA that needs to be acquired or updated upon receiving a DD message, an LSR message is used to request the LSA.
4 | Link State Update | LSU | Used to advertise LSAs. Multiple LSAs can be stored together.
5 | Link State Ack | LSAck | LSU acknowledgment.

The process flow up to obtaining LSA using the above message is as follows:

### 4.3. Designated Router (DR) and Backup Designated Router (BDR)

In OSPF, in a network that supports multicast, a designated router (DR) and a backup designated router (BDR) are selected from among the OSPF routers that belong to that area. The designated router is responsible for advertising any changes to route information to OSPF routers within the area. By eliminating notification of route information changes by other devices, unnecessary LSA exchanges can be reduced. If the designated router goes down, the backup designated router will serve as the designated router.
OSPF routers that are not selected as either the designated router or the backup designated router exchange LSAs only with the designated router and the backup designated router.

For example, in the configuration shown in Figure 3, if there is a change in the route information in Area 1 due to a network outage or other reason, SWX (3) sends an LSU to the designated router SWX (1) and the backup designated router SWX (2) to advertise the change in route information to the backbone area. The designated router that receives the LSU advertises it to other OSPF routers within the area. At this point, the backup designated router does not advertise the LSU.

### 4.4. Neighboring Routers and Adjacent Routers

OSPF routers located within a certain OSPF area are said to be in a "neighboring relationship" when they confirm that they are OSPF routers by sending Hello messages to each other. Also, a relationship in which LSAs are exchanged directly is called an "adjacency." OSPF routers can be classified into neighbors and adjacencies based on these relationships.

Category | Description
--- | ---
Neighboring Router (Neighbor) | OSPF routers that recognize themselves as belonging to the same area through Hello messages. SWX (3) and SWX (4) in Figure 3 are neighboring routers.
Adjacent Router (Adjacency) | OSPF routers that directly exchange LSAs after recognizing that they belong to the same area through Hello messages. For SWX (1) in Figure 3, SWX (2), SWX (3), and SWX (4) are adjacent routers.

### 4.5. Link State Advertisement (LSA)

There are six types of Link State Advertisements (LSAs), which are used depending on their purpose and type of advertisement:

LSA type | Type name | Origin | Description
--- | --- | --- | ---
1 | Router LSA | All OSPF routers | This LSA is used only within the area and contains link information for the source OSPF router.
2 | Network LSA | DR | This LSA is used only within the area and contains a list of OSPF routers maintained by the DR.
3 | Network Summary LSA | ABR | This is used when advertising reachable route information via the backbone area to areas connected to the backbone area. It is also used when advertising route information for areas connected to the backbone area to the backbone area itself.
4 | ASBR Summary LSA | ABR | This is used when advertising the ASBR router ID and the metric value to the ASBR.
5 | AS external LSA | ASBR | This is used when advertising external routes into an OSPF area. When an AS external LSA is advertised to an NSSA, it is converted to a type 7 NSSA AS external LSA before being advertised.
7 | NSSA AS external LSA | ASBR in NSSA | This is used when advertising external routes to an NSSA. When an external route is advertised from an ABR within an NSSA to the backbone area, it is converted into a Type 5 AS external LSA before being advertised.

### 4.6. Virtual Link

In OSPF, all areas must be directly connected to the backbone area. However, there are some networks that cannot be directly connected to the backbone area due to their physical configuration. In such cases, you can logically connect to the backbone area by using a virtual link.
For example, if a network is added to an initially constructed OSPF network, it does not necessarily have to be connected directly to the backbone area; it can be connected to the nearest standard area and logically connected to the backbone area using a virtual link.

Figure 4 shows an example of adding Standard Areas 2 and 3 to an OSPF network consisting of a backbone area and Standard Area 1. The backbone area and Standard Area 2 exchange route information via Summary-LSA that passes through Standard Area 1, so that Standard Area 2 is treated as a directly connected point-to-point network when viewed from the backbone area.
Between Standard Area 2 and Standard Area 3, route information is exchanged via the backbone area, but actual communication does not necessarily pass through the backbone area. If calculating the cost of each link determines that the shortest route is one that does not go through the backbone area, communication between Standard Area 2 and Standard Area 3 will only pass through Standard Area 1.

## 5. Points of Caution

None

## 6. Related Documentation

- OSPF Configuration Guide

- OSPFv2 Configuration Examples

Search result
No more search results.
There are no topics that match your search query.