Implementing OSPF on Cisco IOS XR Software
Information About Implementing OSPF on Cisco IOS XR Software
RC-171
Cisco IOS XR Routing Configuration Guide
Route Authentication Methods for OSPF Version 2, pageRC-177
Neighbors and Adjacency for OSPF, pageRC-178
Designated Router (DR) for OSPF, page RC-178
Default Route for OSPF,, pageRC-179
Link-State Advertisement Types for OSPF Version 2, page RC-179
Link-State Advertisement Types for OSPFv3, pageRC-179
Virtual Link and Transit Area for OSPF, page RC-180
Route Redistribution for OSPF, pageRC-181
OSPF Shortest Path First Throttling, page RC-181
Nonstop Forwarding for OSPF Version 2, pageRC-182
Load Balancing in OSPF Version 2 and OSPFv3, pageRC-183
OSPF Functional Overview
OSPF is a routing protocol for IP. It is a link-state protocol, as opposed to a distance-vector protocol. A
link-state protocol makes its routing decisions based on the states of the links that connect source and
destination machines. The state of the link is a description of that interface and its relationship to its
neighboring networking devices. The interface information includes the IP address of the interface,
network mask, type of network to which it is connected, routers connected to that network, and so on.
This information is propagated in various types of link-state advertisements (LSAs).
A router stores the collection of received LSA data in a link-state database. This database includes LSA
data for the links of the router. The contents of the database, when subjected to the Dijkstra algorithm,
extract data to create an OSPF routing table. The difference between the database and the routing table
is that the database contains a complete collection of raw data; the routing table contains a list of shortest
paths to known destinations through specific router interface ports.
OSPF is the IGP of choice because it scales to large networks. It uses areas to partition the network into
more manageable sizes and to introduce hierarchy in the network. A router is attached to one or more
areas in a network. All of the networking devices in an area maintain the same complete database
information about the link states in their area only. They do not know about all link states in the network.
The agreement of the database information among the routers in the area is called convergence.
At the intradomain level, OSPF can import routes learned using Intermediate System-to-Intermediate
System (IS-IS). OSPF routes can also be exported into IS-IS. At the interdomain level, OSPF can import
routes learned using Border Gateway Protocol (BGP). OSPF routes can be exported into BGP.
Unlike Routing Information Protocol (RIP), OSPF does not provide periodic routing updates. On
becoming neighbors, OSPF routers establish an adjacency by exchanging and synchronizing their
databases. After that, only changed routing information is propagated. Every router in an area advertises
the costs and states of its links, sending this information in an LSA. This state information is sent to all
OSPF neighbors one hop away. All the OSPF neighbors, in turn, send the state information unchanged.
This flooding process continues until all devices in the area have the same link-state database.
To determine the best route to a destination, the software sums all of the costs of the links in a route to
a destination. After each router has received routing information from the other networking devices, it
runs the shortest path first (SPF) algorithm to calculate the best path to each destination network in the
database.