Open Shortest Path First (OSPF) Protocol Explained
Contents
What is OSPF:
OSPF is a standards-based link-state IP routing protocol described in RFC 2328.
Open Shortest Path First (OSPF) is a routing protocol for Internet Protocol (IP) networks. It uses a link-state routing (LSR) algorithm and falls into the group of interior gateway protocols (IGPs), operating within a single autonomous system (AS).
OSPF gathers link state information from available routers and constructs a topology map of the network. The topology is presented as a routing table.
There are 2 versions, OSPFv2 is for IPv4 and OSPFv3 is for IPv6.
Link-State Protocol Characteristics:
With link-state routing protocols (LSR), each router has the full picture of the network topology, and can independently make a decision based on an accurate picture of the network topology.
To do so, each link-state router keeps a record of:
- Its immediate neighbor routers.
- All the other routers in its area of the network, and their attached networks: The router recognizes other routers and networks through LSAs, which are flooded through the network. LSAs are stored in a topology table or database (which is also called an LSDB: Link-State DataBase).
- Then The best paths to each destination are calculated:
Each router independently calculates the best paths to each destination in the network using Dijkstra’s (SPF) algorithm.
The SPF algorithm accumulates costs along each path, from source to destination. The accumulated costs are then used by the router to build a topology table.
All paths are kept in the LSDB. The best paths are then offered to the routing table. Packets arriving at the router are forwarded based on the information held in the routing table.
OSPF LSAs (Link-State Advertisements) types
- When a change occurs in the network topology, the router experiencing the change creates a link-state advertisement (LSA) concerning that link. LSAs are also called link-state protocol data units (PDUs).
- The LSA is multicasted to all neighboring devices using either 224.0.0.5 or 224.0.0.6. Routers receiving the LSA immediately forward it to all neighboring routers.
Standard OSPF LSAs:
- OSPF Type 1 LSA (Route-LSA): Point-to-point connection to another router

- OSPF Type 2 LSA (Network-LSA): The link-state ID of the Type 2 LSA is the IP interface address of the DR.

- OSPF Type 3 LSA (Summary-LSA): advertise inter-area router information to other areas via the ABR.

- OSPF Type 5 LSA (AS-external-LSAs): Advertise external redistributed routes into the OSPF Areas via the ASBR.
- OSPF Type 4 LSA (ASBR-Summary): The ABR advertises this LSA to indicate the presence of an (ASBR) to the other areas (but ASBR to ABR communication is still LSA Type-1)

This Table summarises the Common OSPF LSA types:
|
LSA name |
Generated by |
Description |
1 |
Router-LSAs |
Each internal router within an area |
The link-state ID of the type 1 LSA is the originating router
ID. Router-LSAs, describe the following types of interfaces: ·
Point-to-point connection to another router ·
Connection to a transit network ·
Connection to a stub network (Reserved in v3) ·
Virtual link |
2 |
Network-LSAs |
The DR |
Originated for broadcasts and NBMA networks
by the designated router. This LSA contains the list of routers connected to
the network. The link-state ID of the type 2 LSA is the IP interface address
of the DR. |
3 |
Summary-LSAs |
The ABR |
Type 3 summary-LSAs describe routes to
networks. To inform other areas about inter-area routers. These routes
can also be summarized. |
4 |
ASBR-summary |
The ABR |
Type 4 describe routes to AS boundary
routers beyond its area. The area border router (ABR) generates this LSA to inform
other routers in the OSPF domain, that the matching router is an autonomous
system boundary router (ASBR), so that the external LSAs (Type 5 / Type 7) it
sent may be properly resolved outside its own area. |
5 |
AS-external-LSAs |
The ASBR |
Type 5 These describe routes advertised by
the ASBR. LSAs contain information imported into OSPF from other routing
processes. Together with Type 4 they describe the way to an external route. |
7 |
NSSA external link-state advertisements |
The ASBR, within a not-so-stubby area |
Type 7-LSAs are identical to type-5 LSAs. |
OSPF Areas
To minimize processing and memory requirements, OSPF can divide the routing topology into areas.
Characteristics of OSPF areas include:
- Minimizes routing table entries.
- Localizes impact of a topology change within an area.
- Detailed LSA flooding stops at the area boundary.
- Requires a hierarchical network design.
OSPF routers may function as either:
- Internal router
- Backbone router
- Area Border Router (ABR)
- Autonomous System Boundary Router (ASBR)
