Technical Documentation

OSPF Overview

OSPF is an IGP that routes packets within a single AS. OSPF uses link-state information to make routing decisions, making route calculations using the shortest path first (SPF) algorithm (also referred to as the Dijkstra algorithm). Each router running OSPF floods link-state advertisements throughout the AS that contain information about that router’s attached interfaces and routing metrics. Each router takes the information in these link-state advertisements and creates a complete routing table for the network.

The Junos OS supports OSPF version 2, including virtual links, stub areas, and authentication. The Junos OS does not support type-of-service (ToS) routing.

OSPF was designed for the Transmission Control Protocol/IP (TCP/IP) environment and as a result explicitly supports IP subnetting and the tagging of externally derived routing information. OSPF also provides for the authentication of routing updates.

OSPF routes IP packets based solely on the destination IP address contained in the IP packet header. OSPF quickly detects topological changes, such as when router interfaces become unavailable, and calculates new loop-free routes quickly and with a minimum of routing overhead traffic.

All OSPF interfaces have a cost, which is described by a single dimensionless metric that is determined using the following formula:

cost = reference-bandwidth / interface bandwidth

You can modify the reference-bandwidth value. You can also override the default behavior of using the reference bandwidth to calculate the metric cost of a route by configuring a specific metric value for any OSPF interface. For more information, see Configuring the Metric Value for OSPF Interfaces and Dynamically Adjusting OSPF Interface Metrics Based on Bandwidth.

Routes with lower total path metrics are preferred over those with higher path metrics. When several equal-cost routes to a destination exist, traffic is distributed equally among them.

Each router maintains a database that describes the topology of the AS. Each OSPF router has an identical topological database so that all routers in the area have a consistent view of the network. All routers maintain summarized topologies of other areas within an AS. Each router distributes information about its local state by flooding link-state advertisements throughout the AS. When the AS topology changes, OSPF ensures that the contents of all routers’ topological databases converge quickly.

All OSPF protocol exchanges can be authenticated. This means that only trusted routers can participate in the AS’s routing. A variety of authentication schemes can be used; a single authentication scheme is configured for each area, which enables some areas to use stricter authentication than others.

Externally derived routing data (for example, routes learned from BGP) is passed transparently throughout the AS. This externally derived data is kept separate from the OSPF link-state data. Each external route can be tagged by the advertising router, enabling the passing of additional information between routers on the boundaries of the AS.

Note: By default, the Junos OS is compatible with RFC 1583, OSPF Version 2. In Junos OS Release 8.5 and later, you can disable compatibility with RFC 1583 by including the no-rfc-1583 statement. For more information, see Disabling OSPFv2 Compatibility with RFC 1583.

This section discusses the following topics:

OSPF Routing Algorithm

OSPF uses the shortest path first (SPF) algorithm, also referred to as the Dijkstra algorithm, to determine the route to reach each destination. All routers in an area run this algorithm in parallel, storing the results in their individual topological databases. Routers with interfaces to multiple areas run multiple copies of the algorithm. This section provides a brief summary of how the SPF algorithm works.

When a router starts, it initializes OSPF and waits for indications from lower-level protocols that the router interfaces are functional. The router then uses the OSPF hello protocol to acquire neighbors, doing this by sending hello packets to its neighbors and receiving their hello packets.

On broadcast or nonbroadcast multiaccess networks (physical networks that support the attachment of more than two routers), the OSPF hello protocol elects a designated router for the network. This router is responsible for sending link-state advertisements that describe the network, which reduces the amount of network traffic and the size of the routers’ topological databases.

The router then attempts to form adjacencies with some of its newly acquired neighbors. (On multiaccess networks, only the designated router and backup designated router form adjacencies with other routers.) Adjacencies determine the distribution of routing protocol packets: routing protocol packets are sent and received only on adjacencies, and topological database updates are sent only along adjacencies. When adjacencies have been established, pairs of adjacent routers synchronize their topological databases.

A router sends LSA packets to advertise its state periodically and when the router’s state changes. These packets include information about the router’s adjacencies, which allows detection of nonoperational routers.

Using a reliable algorithm, the router floods LSAs throughout the area, which ensures that all routers in an area have exactly the same topological database. Each router uses the information in its topological database to calculate a shortest-path tree, with itself as the root. The router then uses this tree to route network traffic.

The description of the SPF algorithm up to this point has explained how the algorithm works within a single area (intra-area routing). For internal routers to be able to route to destinations outside the area (interarea routing), the area border routers must inject additional routing information into the area. Because the area border routers are connected to the backbone, they have access to complete topological data about the backbone. They use this information to calculate paths to all destinations outside its area and then advertise these paths to the area’s internal routers.

AS boundary routers flood information about external ASs throughout the AS, except to stub areas. Area border routers are responsible for advertising the paths to all AS boundary routers.

OSPF Version 3

OSPFv3 is a modified version of OSPF that supports IP version 6 (IPv6) addressing. OSPFv3 differs from OSPFv2 in the following ways:

  • All neighbor ID information is based on a 32-bit router ID.
  • The protocol runs per link rather than per subnet.
  • Router and network link-state advertisements (LSAs) do not carry prefix information.
  • Two new LSA types are included: link-LSA and intra-area-prefix-LSA.
  • Flooding scopes are as follows:
    • Link-local
    • Area
    • AS
  • Link-local addresses are used for all neighbor exchanges except virtual links.
  • Authentication is removed; the IPv6 authentication header relies on the IP layer.
  • The packet format has changed as follows:
    • Version number 2 is now version number 3.
    • The db option field has been expanded to 24 bits.
    • Authentication information has been removed.
    • Hello messages do not have address information.
    • Two new option bits are included: R and V6.
  • Type 3 summary LSAs have been renamed inter-area-prefix-LSAs.
  • Type 4 summary LSAs have been renamed inter-area-router-LSAs.

Published: 2010-07-02

Help
|
My Account
|
Log Out