Introduction to Open Shortest Path First (OSPF)


Open Shortest Path First (OSPF) is a routing protocol which was first defined as version 2 in RFC 2328. 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

In this 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. 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.

Operation

STILL UNDER DEVELOPMENT

OSPF Startup and Operation

STILL UNDER DEVELOPMENT

Neighbor Discovery

STILL UNDER DEVELOPMENT

• Forming Adjacencies

• Link State Advertisements (LSAs)

o LSA 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


• Flooding

• Reliable Transport

• Shortest Path First Calculations

• Configuration

• Troubleshooting



OSPF Components

• Areas

• Routers

• Link State Advertisements

• Processes

OSPF Areas

OSPF organizes a network into areas. An area is a set of routers that will share routing information about one or more networks. Routers are used by OSPF to maintain routing informatioin within an area and to send Link State Advertisements to other areas.

Backbone Area (Area 0)

The first area that will always exist in any network using OSPF for routing is Area 0 (zero). Area 0 is always the backbone area. All other areas are connected to the backbone either directly, or using virtual links that 'tunnel' through other areas. Because areas must be directly connected to the backbone, you cannot chain areas together. All routing information beetween areas is sent through the backbone area (Area 0).

Each area is designated by an area number. All other areas are described as having 'stubbiness':

• Not So Stubby Area

• Stubby Area

• Totally Stubby Area (Cisco proprietary)