This site requires JavaScript for navigation. Please enable JavaScript for the best learning experience.

  1. Open Shortest Path First - OSPF Introduction
  2. Open Shortest Path First - OSPF Router Types
    1. Designated Router
    2. Backup Designated Router
    3. Internal router
    4. Backbone router
    5. Area Border Router
    6. Autonomous System Boundary Router
  3. Open Shortest Path First - OSPF Areas
    1. Backbone
    2. Not So Stubby
    3. Stubby
    4. Totally Stubby
    5. Virtual Links
  4. Open Shortest Path First - OSPF Operation
    1. Neighbor Discovery
    2. Forming Adjacencies
    3. Link State Advertisements (LSAs)
      1. Types (by type code)
        • 1 - Router LSA
        • 2 - Network LSA
        • 3 - Network summary LSA
        • 4 - ASBR Summary LSA
        • 5 - AS External LSA
        • 6 - Group Membership LSA
        • 7 - NSSA External LSA
        • 8 - External Attributes LSA
        • 9 - Opaque LSA (link-local scope)
        • 10 - Opaque LSA (area-local scope)
        • 11 - Opaque LSA (AS scope)
      2. Flooding
      3. Reliable Transport
    4. Shortest Path First Calculations
  5. Open Shortest Path First - OSPF Configuration
  6. Open Shortest Path First - OSPF Troubleshooting

Introduction to Open Shortest Path First (OSPF) - A Tutorial

Open Shortest Path First (OSPF) is a link state routing protocol which was first defined as version 2 in . It is used to allow routers to dynamically learn routes from other routers and to advertise routes to other routers. Advertisements containing routes are referred to as Link State Advertisements (LSAs) in OSPF. OSPF router keeps track of the state of all the various network connections (links) between itself and a network it is trying to send data to. This makes it a link-state routing protocol. OSPF supports the use of classless IP address ranges and is very efficient. OSPF uses areas to organize a network into a hierarchal structure; it summarizes route information to reduce the number of advertised routes and thereby reduce network load and uses a designated router (elected via a process that is part of OSPF) to reduce the quantity and frequency of Link State Advertisements. OSPF does require the router have a more powerful processor and more memory than other routing protocols.

OSPF selects the best routes by finding the lowest cost paths to a destination. All router interfaces (links) are given a cost. The cost of a route is equal to the sum of all the costs configured on all the outbound links between the router and the destination network, plus the cost configured on the inteface that OSPF received the Link State Advertisement on.

This tutorial will focus on explaining the basic components of OSPF, the operation of OSPF, basic configuration of OSPF and finally close with troubleshooting techniques used to verify correct OSPF configuration and operation.

OSPF Router Types

  • Internal Router
  • Backbone Router
  • Area Border Router (ABR)
  • Autonomous System Boundary Router (ASBR)
  • Designated Router (DR)
  • Backup Designated Router (BDR)
In this part of our OSPF tutorial, when speaking of an OSPF router, we are speaking of the OSPF routing process running on a given routing device. OSPF routers serve in various roles depending upon where they are located and which areas they participate in.
Internal Routers
An internal router connects only to one OSPF area. All of its interfaces connect to the area in which it is located and does not connect to any other area.

If a router connects to more than one area, it will be one of the following types of routers.

Backbone Routers
Backbone routers have one or more interfaces in Area 0 (the backbone area).
Area Border Router (ABR)
A router that connects more than one area is called an area border router or ABR. Usually an ABR is used to connect non-backbone areas to the backbone. If OSPF virtual links are used an ABR will also be used to connect the area using the virtual link to another non-backbone area.
Autonomous System Boundary Router (ASBR)
If the router connects the OSPF Autonomous System to another Autonomous System, it is called an Autonomous System Boundary Router (ASBR).

OSPF elects two or more routers to manage the Link State Advertisments:

Designated Router (DR)
Every OSPF area will have a designated router and a backup designated router. The Designated Router (DR) is the router to which all other routers within an area send their Link State Advertisements. The Designated Router will keep track of all link state updates and make sure the LSAs are flooded to the rest of the network using Reliable Multicast transport.
Backup Designated Router (BDR)
The election process which determines the Designated Router will also elect a Backup Designated Router (BDR). The BDR takes over from the DR when the DR fails.

OSPF Areas

OSPF areas are used to impose a hierarchial structure to the flow of data over the network. A network using OSPF will always have at least one area and if there is more than one area, one of the two areas must be the backbone area. OSPF has only 2 levels to its hierarchy, the backbone, and all other areas attached to it. Areas are used to group routers into manageable groups that exchange routing information locally, but summarize that routing information when advertising the routes externally. A standard OSPF network looks something like a big bubble (the backbone area) with a lot of smaller bubbles (stub areas) attached directly to it. Area Border Routers (ABR) are used to connect the areas. Each area will elect a designated router (DR) and a backup designated router (BDR) to assist in flooding Link State Advertisements (LSAs)throughout the area.

Backbone (Area 0)

The backbone is the first area you should always build in any network using OSPF and the backbone is always Area 0 (zero). All areas are connected directly to the OSPF backbone area. When designing an OSPF backbone area, you should make sure there is little or no possibility of the backbone area being split into two or more parts by a router or link failure. If the OSPF backbone is split due to hardware failures or access lists, sizeable areas of the network will become unreachable.

Totally Stub Area

A totally stubby area is only connected to the backbone area. A totally stubby / totally stub area does not advertise the routes it knows. It does not send any Link State Advertisements. The only route a totally stub area receives is the default route from an external area, which must be the backbone area. This default route allows the totally stub area to communicate with the rest of the network.

Stub Area

Stub areas are connected only to the backbone area. Stub areas do not receive routes from outside the autonomous system, but do receive the routes from within the autonomous system, even if the route comes from another area.

Not-So-Stubby (NSSA)

Frequently, it is advisable to use a separate network to connect the internal enterprise network to the Internet. OSPF makes provisions for placing an Autonomous System Boundary Router (ASBR) within a non-backbone area. In this case, the stub area must learn routes from outside the OSPF autonomous system. Thus, a new type of LSA was required--the Type 7 LSA. Type 7 LSA's are created by the Autonomous System Boundary Router and forwarded via the stub area's border router (ABR) to the backbone. This allows the other areas to learn routes that are external to the OSPF routing domain.

Virtual Links

Virtual links are used when you have a network that must be connected to an existing OSPF system, but cannot be physically connected directly to the routers in the OSPF backbone area. You can configure an OSPF virtual link from the area to a backbone router, creating a virtual direct connection to the backbone area. This virtual link acts as a tunnel which forwards LSAs to the backbone via a second intermediate area.

OSPF Operation

  • OSPF Router ID
  • Designated Router Election
  • OSPF Link States
  • OSPF Timers
  • Neighbor Discovery
  • Forming Neighbor Adjacencies
  • Link State Advertisements
  • Route Summarization
  • Shortest Path Algorithm

OSPF Router ID

The OSPF Router ID identifies a specific router in the OSPF topology. The Router ID is either a) the IP address assigned to the loopback interface, or b) the IP address of the interface with the highest IP address number.  Using the loopback interface makes a more stable OSPF environment as the loopback interface is always up, unlike physical interfaces, which can fail. If a physical interface fails, the OSPF router ID may change, triggering router election and link state advertisement flooding.

Designated Router Election

Once the designated router has been chosen, it remains the designated router until it fails.

OSPF Link States

OSPF Timers

There are several OSPF timers in operation:
  • HELLO timer - 10 seconds by default
  • DEAD timer - Usually 4x the HELLO timer (40 seconds by default)
  • Link State Database Updates - Whenever the OSPF route table changes, or 30 minutes from the last change, whichever occurs first.

Neighbor Discovery

An OSPF neighbor is any other adjacent router that is connected to the router (physically, or logically over a tunnel) and which runs OSPF and which the router is intended to exchange routing information. When OSPF is enabled, HELLO messages (type 89 in the IP header) are addressed to the IP address, the IANA-assigned OSPF multicast address, and flooded out all interfaces participating in OSPF every 10 seconds. Any neighboring router that hears these HELLO messages will learn:
  • The neighbor's Router ID (RID)
  • The Area ID the neighbor participates in
  • The HELLO interval (default is 10 seconds)
  • The DEAD interval (usually 5 failed HELLOs)
  • The Router ID (RID) of the Designated Router (if known)
  • The Router ID (RID) of the Backup Designated Router (if known)
  • The Router ID of all known routers

Forming Neighbor Adjacencies

Once a router sees its own ID in a neighbor's HELLO, it assumes two-way communication has been accomplished and the router begins sending link state advertisements (LSAs).  This will only occur if the following items are configured identically on the two routers:
  • The HELLO interval
  • The DEAD interval
  • Authentication checks
  • The OSPF area ID
  • The stub area flag value

OSPF Route Types

  • Intra-area (O)
  • Interarea (IA)
  • External Type 1 (E1)
  • External Type 2 (E2)

Link State Advertisement Types

  • LSA Type 1 - Router LSA
  • LSA Type 2 - Network LSA
  • LSA Type 3 - Network summary LSA
  • LSA Type 4 - ASBR Summary LSA
  • LSA Type 5 - AS External LSA
  • LSA Type 6 - Group Membership LSA
  • LSA Type 7 - NSSA External LSA
  • LSA Type 8 - External Attributes LSA
  • LSA Type 9 - Opaque LSA (link-local scope)
  • LSA Type 10 - Opaque LSA (area-local scope)
  • LSA Type 11 - Opaque LSA (AS scope)

LSA Flooding

Reliable Multicast Transport

Route Summarization

Shortest Path First Algorithm

Open Shortest Path First - OSPF Configuration

Configure OSPF on Cisco

Enter Configuration mode:
host-a# conf t
Configure the loopback addresses on all routers. The loopback address will become the OSPF Router ID:
host-a(config)# int loopback 0
host-a(config-if)# ip address <ip-address> <subnet-mask>
Configure OSPF backbone area first on the routers in the core of the network:
host-a(config)# router ospf <pid>
host-a(config-router)# network <network> <wildcard mask> area 0
Configure other routers in the remaining OSPF areas:
host-a(config)# router ospf <pid>
host-a(config-router)# network <network> <wildcard mask> area 0

Configure OSPF on Juniper

Open Shortest Path First - OSPF Troubleshooting

Failure to Become Neighbors

If two routers won't become neighbors, check the following:
  • Check the physical layer connectivity
  • Check any logical connectivity if it is used (such as tunnels)
  • The two routers share a common network subnet
  • The two routers have the same subnetwork address
  • The IP address mask is the same
  • The neighbor's Router ID (RID)
  • The Area ID the neighbor participates in
  • The HELLO interval (default is 10 seconds)
  • The DEAD interval (usually 5 failed HELLOs)
  • The Router ID (RID) of the Designated Router (if known)
  • The Router ID (RID) of the Backup Designated Router (if known)
  • The Router ID of all known routers

This tutorial is still under development. Please excuse any typographic or other errors.



Bookmark this page and SHARE:  


Support InetDaemon.Com

Get Tutorials in your INBOX!

Free Training