
Open Shortest Path First (OSPF) is a link-state routing protocol. It maintains a routing table by exchanging link-state information with neighboring routers. The advantages of link-state routing protocols are:
- Their ability to converge quickly
- The reduced traffic from routing updates over traditional distance-vector routing protocols
The Internet comprises a group of autonomous systems (ASs). An AS is a collection of routers under the control of a single administrative group sharing the same set of policies. An AS could be the routers owned and operated by a single Internet Service Provider (ISP), a subset of the routers owned by an ISP that are managed by a single group of network administrators in an area of the country, or all the routers in a single company, organization, or university.
Figure 2-1. OSPF Hierarchy
![]()
OSPF is an Internal Gateway Protocol (IGP) running internally to each AS. Each AS can further be broken into areas. Each router maintains a topology database known as the link-state database. This database is the basis for a shortest path tree calculation which is used in the construction of a routing table. Each router uses flooding to distribute its local state throughout the AS.
A router with all interfaces in the same area is an internal router. A router with interfaces in two or more areas is an area border router. Within the area, each router maintains an identical topology database. Between areas, area border routers summarize routing information to reduce the number of entries in the topology database. This is especially important for information flooded into the backbone area. Because all areas in OSPF must be either logically or physically connected to the backbone area, the routing tables for a router in the backbone would be unwieldy if not for summarization.
Between each AS, the autonomous system border router uses an Exterior Gateway Protocol (EGP) such as BGP-4.
This version of OSPF is compliant with RFC 1583 OSPF, Version 2.
Related Information
Administrators should be very familiar with OSPF operation and theory before configuring their system to run OSPF. The following texts are recommended as further reading.
- OSPF Anatomy of an Internet Routing Protocol, Moy, John T. 1998, Addison Wesley Longman, Inc. ISBN 0-201-63472-4
- Internetworking with TCP/IP, Comer, Douglas E. 1995, Prentice-Hall, Inc. ISBN0-13-216987-8
Configuring OSPF Router ID
Router ID is the tie-breaker for OSPF path selection. The path selection process uses a variety of metrics to select a route.
PROCEDURE: If all other metrics are equal, OSPF determines the router ID using the following priority:
Step 1 Use the Loopback0 interface address
Step 2 Use the highest IP address of any interface
Step 3 If no interface exists, set the router-id to 0.0.0.0
Step 4 Use the ospf router-id command in router configuration mode to set the router-id for an OSPF system.
CAUTION The ospf router-id command causes the OSPF process to restart using the new router-id (if the process is enabled and router-id has changed).
Step 5 Use the no ospf router-id to use the default OSPF router-id for this router.
OSPF recomputes the router-id based on the steps1, 2, and 3 above and restarts OSPF (if enabled and the router-id has changed).
Adjacent Routers
Adjacent routers are neighbor routers who have fully synchronized their databases.
When you start the OSPF process on the router using the router ospf command, OSPF automatically discovers any neighbors present on defined point-to-point interfaces. (Refer to "Configuring OSPF Interface Operations.") Once you define which area each interface is in with the network area command, OSPF begins its handshaking process to form an adjacency.
Overview of OSPF Configuration
PROCEDURE: Use the following steps to configure OSPF:
Step 1 Start the OSPF routing process
Step 2 Define interfaces and areas
Step 3 Optionally, reduce the size of routing tables using summarization
Step 4 Optionally, enable authentication in each area
Step 5 Optionally, define default cost for each stub area
Step 6 Optionally, interconnect areas using virtual links
Step 7 Optionally, define the operational parameters on each router interface
Start the OSPF Routing Process
The router ospf command defines a process number for the routing process and enters router configuration mode.
At this time, IPriori supports one routing process. In the event that multiple instances of OSPF processes are supported in a future release, this number will distinguish the instances. This one process handles the routing for all areas in which a router participates in OSPF routing. Once a process number is defined with the router ospf command, the same number must be used any time you reenter router configuration mode to configure that OSPF process. In the examples in this chapter, we will use the process number 13. The number 13 has no special significance. However, whenever we reenter router configuration mode, we must specify the number 13 until we take down that routing process with the no router ospf command and define a new OSPF process with a new number.
Defining Interfaces and Areas
OSPF supports hierarchical routing. Autonomous systems are further broken down into areas to provide a reduction in the amount of routing protocol traffic.
The first task in OSPF configuration is to define what areas each interface connects to. The network area command performs this task by defining the network address and its associated area identifier. The area identifier can be in either decimal or 32-bit dotted decimal notation. For the examples in this chapter we will use the simple decimal form.
The network area command uses a combination of network address and wild-card bits to further define a range of interface addresses. Wild-cards define how much of the network address is significant in defining the group of interfaces to include in an area. Using this technique of assigning a range of interfaces to an area further simplifies creation of the configuration file.
Single Area Networks
Many OSPF autonomous systems are formed of a single area. However, when the area gets large or contains many subnets, it can be broken up into more areas. When an autonomous system contains one area, the area identifier can be any number. However, when an autonomous system is broken into multiple areas, at least one of these must be the backbone area and must be identified as area 0. Because topological growth cannot be fully predicted, identify single-area autonomous systems as area 0. This eases migration to a multi-area topology in the future if the need arises
.
Figure 2-2. A Single-Area OSPF Topology![]()
Example 1: The following commands show the network area configurations on router A for the topology in Figure 2-2.
router ospf 13
network 10.3.7.0 0.0.0.255 area 0
network 10.1.1.0 0.0.0.255 area 0
network 10.129.0.0 0.0.225.255 area 0
Example 2: These four lines of configuration information can also be summarized in the following two statements:
router ospf 13
network 0.0.0.0 255.255.255.255 area 0
These statements mean that all interfaces on this router are in area 0. This statement can be used on any internal router. An internal router is one on which all interfaces are in the same area.
Multi-Area Networks
In a multi-area autonomous system, all areas must connect directly to area 0 (the backbone) either by direct connection through an area border router or through a virtual link. Refer to "Extending Areas Using Virtual Links." In Figure 2-3, Area 0, the backbone area, contains router A, router B, and router C. There are 3 additional areas to this autonomous system. Area 1 is directly connected to area 0 through router A, area 2 is directly connected to area 0, through router C, and area 4 is indirectly connected to area 0 through a virtual link to router C.
Figure 2-3. A Multiple-Area OSPF Topology
![]()
To configure the topology in Figure 2-3 on router A, use the following commands:
router ospf 13
network 10.3.7.0 0.0.0.255 area 0
network 10.3.1.0 0.0.0.255 area 0
network 10.129.0.0 0.0.255.255 area 1
- Because router A has interfaces in two areas, it is considered an area border router.
This example could be simplified even further by using the power of the network address, wildcard pair.
router ospf 13
network 10.3.0.0 0.0.255.255 area 0
network 10.129.0.0 0.0.255.255 area 1
- When OSPF is enabled on a SONET interface, it becomes ready to dynamically discover the identity of its neighbors. To actually discover the neighbor, the network area command must also be entered on the neighbor's side of the interface as well.
In our example, if we were to enter the network commands above on router A only, and then look at our IP routing table, we would see only the directly connected routes.
router#show ip route
Codes: C - connected O - OSPF i - IS-IS
S - static IA - inter area L1 - level-1
B - BGP E1 - external type 1 L2 - level-2
E2 - external type 2
* - candidate default
m - route's metric
w - route's weight
S 0.0.0.0/0 directly connected to null 0
C 5.1.1.64/28 directly connected to ethernet 1
C 5.1.1.80/28 directly connected to ethernet 2
C 5.1.1.96/28 directly connected to ethernet 3
C 5.1.1.112/28 directly connected to ethernet 4
S 10.1.0.0/16 via 10.5.0.1 [w:0 m:0]
C 10.5.0.0/16 directly connected to ethernet 0
S 127.0.0.0/8 directly connected to null 0
C 127.0.0.1/32 directly connected to null 0
B 192.1.1.0/24 via 5.1.1.71 [w:0 m:0]
C 192.8.1.1/32 directly connected to loopback 0
S 192.8.1.2/32 via 5.1.1.69 [w:0 m:0]
router#
Once OSPF discovers its neighbor, it can then exchange its network topology with that neighbor. OSPF shares information about its directly connected networks only. It receives information about the links its neighbor knows about and adds them to its database thus increasing its knowledge of the network. When OSPF senses a change to one of its links, it propagates a link-state advertisement to its neighbors.
When a neighbor receives a link-state advertisement from a router, it
- Checks to see if the advertisement is new
- Propagates that advertisement over each of its links
- Enters the advertisement into its database
- Runs the SPF algorithm to modify its routing tables
When a new instance of an LSA is created, the next higher sequence number is assigned and the age is set to zero. A new instance is generated every 30 minutes or whenever the contents would be different than the previous LSA. As each router holds an LSA in its database, the age is incremental. When the age reaches maxage (3600 seconds), the LSA can no longer be used. At this point the router initiates the purging process for the LSA.
Routers recognize LSAs with higher sequence numbers, or age differences greater than 900 seconds, as separate instances.
Each router calculates and maintains a routing database. It calculates the routing database with the shortest path first (SPF) algorithm. The SPF algorithm (Dijkstra) calculates the shortest paths to all destinations. It calculates a tree of shortest paths beginning with the router on which it is running and adds each neighbor to a candidate list. Each candidate includes the next hop and the cost of the links to that neighbor. The entry on the candidate list with the smallest cost is added to the shortest-path tree and that router's neighbors are examined for inclusion in the candidate list. Refer to OSPF (Anatomy of an Internet Routing Protocol), Moy, John T. for more information on the Dijkstra SPF algorithm.
Once the routers on both ends of the interface are configured, the information shown in the show ip route command changes.
router#show ip route
Codes: C - connected O - OSPF i - IS-IS
S - static IA - inter area L1 - level-1
B - BGP E1 - external type 1 L2 - level-2
E2 - external type 2
* - candidate default
m - route's metric
w - route's weight
C 10.3.7.0/16 directly connected to Serial 0 via 10.3.7.1
O 10.3.9.0/16
C 10.3.1.0/24 directly connected to serial 1 via 10.2.2.1
IA 10.9.0.0/16
C 10.129.0.0/24 directly connected to serial 2 via 10.129.0.2
Network 10.3.9.0 is an OSPF intra-area route and network 10.9.0.0 is an OSPF inter-area route.
Special Areas
Stub areas do not originate or propagate external OSPF routes. Instead, a default route is used by an area border router to a stub area. In other words, a stub area is not a transit area. When an area is configured as a stub area this record defines additional information that has do with controlling metric and method of advertising a default route.
The following command defines the network 192.10.1.0 as a stub area:
router ospf 13
network 192.10.1.0 0.0.0.255 area 4
area 4 stub
Configuring a Stub Router for Startup Maximum Metric Advertisement
During router startup or after reload, IGP convergence often times takes place well before the BGP routing tables converge. If neighbor routers forward traffic through a router while that router is building BGP routing tables, packets received for other destinations may be dropped. The advertising of a maximum metric during startup allows routing tables to converge before traffic destined for other networks is sent through the router. This functionality is implemented in the OSPF stub router maximum metric advertisement feature defined in RFC 3137.
OSPF stub router maximum metric advertisement provides for the bringing up of a new router into a network without immediately routing traffic through the new router, as well as, gracefully shutting down and reloading a router without dropping packets that are destined for other networks. The OSPF stub router maximum metric advertisement feature introduces a BGP configuration option, that allows a router running the OSPF protocol to advertise a maximum or infinite metric of link state infinity (0xFFFF) to all neighbors, making this router the least preferred router in the network for forwarding traffic to another network. There are two mechanisms used to determine the end of the maximum metric advertisement. The BGP best routes learned threshold limit is used to identify the completion of BGP convergence. When this configurable threshold is reached, the maximum metric advertisement is replaced with the normal OSPF metric value. The expiration of a configurable timer that defaults to 600 seconds will also replace the maximum metric with the normal OSPF metric value should BGP convergence completion fail to take place within the timer period. The OSPF stub router maximum metric advertisement configuration is ignored during NSR® failover, where the continued forwarding of OSPF packets is inherent to the NSR® functionality.
Use the max-metric router-lsa command, in router configuration mode, to enable maximum metric advertisement for this router that persists after BGP convergence completion.
Use the max-metric router-lsa on-startup wait-for-bgp route-threshold command to specify a BGP routing table convergence threshold that when met will terminate the maximum metric advertisement state.
Use the max-metric router-lsa on-startup timer command to configure a time out value other than the 600 second default.
Example 1: In the following example:
- The maximum metric advertisement is enabled for router 12
- The BGP route threshold is set to 240K routes:
router(config)#router ospf 12
router(config-router)#max-metric router-lsa on-startup wait-for-bgp route-threshold 240000
router(config-router)end
router#
Example 2: In the following example: the maximum metric advertisement is disabled for router 12
router(config)#router ospf 12
router(config-router)#no max-metric router-lsa
router(config-router)end
router#
Opaque Link-State Advertisements
IPriori provides support for a special type of Link State Advertisement (LSA) known as Opaque Link-State Advertisement. Opaque LSAs provide for:
- Encapsulation of application-specific information
- Sending and receiving of application-specific information
- Informing the application of the change in validity of previously received information when topological changes are detected
The information contained in Opaque LSAs can be used directly by OSPF or indirectly by some application wishing to distribute information throughout the OSPF domain (e.g., the OSPF LSA may be used by routers to distribute IP to link-layer address resolution information).
There are three types of opaque LSAs based upon flooding scope:
- Type 9 is link local
- Type 10 is throughout an area
- Type 11 is throughout the autonomous system
Summarizing Address Information
The area range command defines address ranges or network address ranges within the area and specifies whether or not the range is to be summarized outside of the area.
An area address range entry provides two basic functions. It reduces the number of actual advertisements summarized to other areas by an area border router and it increases the overall stability of the network by masking the details of the network topology in the area being summarized.
Typically, address ranges are used for advertisements flooded into the backbone, but not for advertisements flooded from the backbone.
When a range's status indicates advertise (the default), a summary-LSA is generated with Link State ID equal to the range's address. When the range's status indicates do-not-advertise, the summary-LSA is suppressed and the component networks remain hidden from other areas. However, the summary-LSA is not created and flooded unless there is at least one network within the source area whose address falls into this range.
Figure 2-4. Summarizing Network Addresses into the Backbone
![]()
In Figure 2-4, area 4 is exporting information it knows about the network into the backbone area through area border router C. Without network address summarization, router C would need to propagate LSAs for each of the networks represented by address 10.129.0.0, 10.9.8.0, 10.9.9.0, and 10.9.7.0. Instead, Router C could propagate two LSAs. One for the network 10.129.0.0, and one for the networks represented by 10.9.8.0, 10.9.7.0, and 10.9.9.0, by creating a summary address for the latter.
Example: Router C would be configured with the following commands (Figure 2-4):
router ospf 13
network 10.1.1.0 0.0.0.255 area 0
network 10.3.9.0 0.0.0.255 area 0
network 10.129.0.0 0.0.0.255 area 4
network 10.9.0.0 0.0.255.255 area 4
area 4 range 10.9.0.0 255.255.0.0
The example shown above shows two important points relevant to addressing in an area.
- Summarization cannot be fully implemented unless the addresses in an area are contiguous assignments. Had area 4 in Figure 2-4 used more similar addressing, a single network area command could have been used. However, because one address is not similar, we must define 4 networks for area 4.
- The simpler the addressing/subnetting scheme of an area, the simpler the calculation of summary LSAs.
Authentication
OSPF supports two types of authentication: simple and MD5.
Simple authentication inserts a password in each packet that is compared with the password at the receiving end. If the passwords agree, the packet is accepted. If the passwords do not agree, the packet is rejected. The weakness of this form of authentication is that the password is present in the OSPF header of each packet and susceptible to recovery by anyone with a network sniffer.
MD5 authentication uses the password to generate a message-digest, which is a 128-bit checksum of the packet and password. The message-digest is sent with the packet along with a key ID associated with the password. The receiving router initially accepts a packet that contains a key ID that corresponds to one of its key IDs. The receiving router password associated with the key ID replaces the message-digest in the packet and a new message-digest is generated. If the generated message-digest is identical to the message-digest that came with the packet, the packet is accepted; it is otherwise rejected. Because the message-digest is a checksum of both the message contents and the password, any change to the message that did not include a regenerated message-digest would cause it to get rejected by the receiving router. The security of MD5 authentication relies on the inability of a third party to compute the message-digest without access to the password that generated it.
Simple Authentication
To provide a level of protection, OSPF can be configured to authenticate routing protocol exchanges. The Avici router supports simple authentication. The authentication key for simple authentication is a clear 64-bit password.
Simple authentication passwords are exchanged in Hello packets. An adjacency with a router will not occur unless this is configured the same on both ends of the interface.
PROCEDURE: Use the following steps to configure OSPF area authentication:
Step 1 Enable simple authentication for the area. By default authentication is disabled.
Step 2 Enable authentication keys for each interface. Both ends of a point-to-point interface must use the same password for authentication to work.
Example: In the following example, simple password authentication is set for the area defined as 0 and the password for authentication on each interface is set to parab0la.
router ospf 13
network 10.1.1.0 0.0.0.255 area 0
area 0 authentication
interface pos 1/1/1
ip ospf authentication-key parab0la
interface pos 1/1/2
ip ospf authentication-key parab0la
interface pos 1/2/1
ip ospf authentication-key parab0la
interface pos 1/8/1
ip ospf authentication-key parab0la
interface pos 1/9/1
ip ospf authentication-key parab0la
MD5 Authentication
There are two parts to MD5 authentication: setting MD5 authentication for the area and setting the key ID and password associated with area interfaces.
MD5 authentication allows you to specify up to 255 passwords for each interface. A key ID is associated with each password for the purpose of identifying the password used to generate the message-digest at the receiving end. Key IDs must be unique to each password and can have a value between 1 and 255. An interface accepts any packet that contains a key ID and password combination configured for that interface. An interface will only send a message with the latest key ID and password combination configured for the sending interface.
For a description of how MD5 authentication works, see "Authentication"
Setting Area MD5 Authentication
OSPF authentication is set by area. To set area authentication to MD5 you add the message-digest keyword to the area authentication command.
Setting an MD5 Authentication Password
Setting an initial password for an interface requires a single step. Use the ip ospf command with the message-digest-key and md5 keywords in interface configuration mode.
For example, to set an interface's initial key ID to 1 and the password to initialpassword, enter the following command at the interface configuration prompt:
(config-if)# ip ospf message-digest-key 1 md5 initialpassword
Because an interface uses the latest configured key ID and password combination to generate the message-digest for any packet it sends, changing or adding a password for an interface requires multiple steps. The interface uses this new password for all packets it sends until another password is created. If the area interface receiving packets from this interface is already configured with the new password, there is not a problem.
PROCEDURE: If the receiving interface is not configured for this new password, use the following steps within the dead-interval period of this interface when adding or changing a password:
Step 1 Add the new key ID and password combination using the ip ospf command.
Step 2 Delete the key ID and password combination that you wish to use for this interface using the no ip ospf command.
Step 3 Restore the key ID and password combination you deleted in Step 2 using the ip ospf command.
- If you only wanted to add the new password, the procedure is complete. If you want the new password created in Step 1 to be the password used for all packets sent on this interface, perform the following steps after the new password has been configured for the receiving interface:
Step 4 Delete the new key ID and password combination entered in Step 1, using the no ip ospf command.
Step 5 Restore the key ID and password combination deleted in Step 4.
Example: For example, if you wanted to replace the key ID 1 and password initialpassword with key ID 2 and newpassword, input the following at the interface configuration prompt:
router
router(config-if)# ip ospf message-digest-key 2 md5 newpassword
router(config-if)# no ip ospf message-digest-key 1
router(config-if)# ip ospf message-digest-key 1 md5 initialpassword
The effect of these three command lines is to: create the new password, delete the old password, and restore the old password, so that messages sent by this interface will be accepted during the period of time the new password is not configured for the receiving interface.
Once the new password is configured on the receiving interface, enter the following command lines on the sending interface:
router(config-if)# no ip ospf message-digest-key 2
router(config-if)# ip ospf message-digest-key 2 md5 newpassword
The effect of these two command lines is to: delete the new password and then restore the new password, so that it is the latest configured password and will be used by all packets sent on this interface
The procedure for entering a new MD5 authentication password is complete.
Extending Areas Using Virtual Links
Virtual interfaces create connectivity of the OSPF backbone area for areas that are otherwise not directly connected. All area border routers in the AS must be connected to the backbone and virtual links allow the backbone routers to form an adjacency through non-backbone areas.
The area virtual-link command is issued on both ends of the virtual link. Both end points of a virtual link are area border routers. The area virtual-link command must also specify the transit area through which the non-backbone area border router connects and the router identifier of the router on the other end of the virtual link.
Virtual links are not a recommended method for interconnecting areas to the network backbone because the stability of a virtual link is determined by the stability of the transit area. In other words, not only is connectivity to area 4 dependent on the stability of the link between router C and router E, but also on the stability of the link between router E and router Z.
Figure 2-5. Virtual Links
![]()
Example: For example, in Figure 2-5 router Z is connected into the backbone area through area 2 by means of a virtual link to area border router C. To configure this virtual link, you must configure both router C and router Z. The following code shows the configuration on router C.
router ospf 13
network 10.3.9.0 0.0.0.255 area 0
network 10.1.1.0 0.0.0.255 area 0
network 10.9.8.0 0.0.0.255 area 2
area 2 virtual-link 10.9.9.2
The following commands on router Z would configure the same virtual link:
router ospf 13
network 10.9.9.0 0.0.0.255 area 2
area 2 virtual-link 10.3.9.1
Additionally, all standard interface parameters may be specified on a virtual link:
- hello-interval
- retransmit-interval
- transmit-delay
- dead-interval
- authentication-key
- MD5 authentication
Configuring OSPF Interface Operations
OSPF uses reasonable default values for each of the interface options available. Most networks can operate well given these default values.
- Cost=10
- Dead-interval=4 times the hello-interval.
- Hello-interval=10 seconds on a point-to-point link.
- Network: default type is inferred from the type of the underlying interface
- Retransmit-interval=5 seconds
- Transmit-delay=1 second
In many cases, changing the value of these parameters requires that you change them on all interfaces in the area or in a network (hello-interval and dead-interval). In others, the change need only be made on both sides of the interface.
Example: The following example sets each of the interface values for a single interface:
router ospf 1
network 10.1.1.0 0.0.0.255 area 1
interface pos 1/1/1
ip ospf cost 10
ip ospf dead-interval 60
ip ospf hello-interval 15
ip ospf retransmit-interval 10
ip ospf transmit-delay 10
Configuring Multiple Parallel Routes
You can set multiple parallel routes installed in the IP routing table using the maximum-paths command. During packet switching, load balancing is performed among the multiple paths. A maximum of four paths is supported. By default, only one path is installed to the IP routing table. Use the no option to reset the number of parallel paths to 1.
You must be in router configuration mode to use this command.
Example: The following example allows a maximum of three paths to a destination:
router(config-router)#maximum-paths 3
Configuring SPF Delay and Holddown Timers
There are two timers associated with controlling the triggering of an OSPF SPF calculation. The delay timer sets the amount of time to wait before running an SPF after receiving a database change. The holddown timer sets the minimum amount of time to wait between consecutive SPF runs. These timers support floating point values between 0.00 and 65535.00 or whole number values between 0 - 65535.
Use the timers spf delayValue holddownValue command in router configuration mode to set the value for these two timers.
Use the no timers spf command to reset SPF timer defaults.
Use the show ip ospf command to display currently configured SPF timer values.
Example: In the following example the delayValue stays at the default value of 0 seconds, while the holddownValue is changed to 7 seconds:
router(config)#router ospf 12
router(config-router)#timers spf 0 7
router(config-router)end
router#show ip ospf
OSPF is running, process id: 1, router id: 198.0.8.2
Number of areas: 2, normal: 1, stub: 1
Maximum paths per route: 4
SPF schedule delay 0.0 secs, Hold time between two SPFs 7.0 secs
Area: 0.0.0.0
Number of interfaces in this area is 5
Type of authentication none
SPF algorithm has run 5 times
Area: 0.0.0.1
Stub area
Number of interfaces in this area is 0
Type of authentication none
SPF algorithm has run 2 times
Example: In the following example: SPF timer values are reset to defaults:
router(config)#router ospf 12
router(config-router)#no timers spf
router(config-router)end
router#show ip ospf
OSPF is running, process id: 1, router id: 198.0.8.2
Number of areas: 2, normal: 1, stub: 1
Maximum paths per route: 4
SPF schedule delay 0.0 secs, Hold time between two SPFs 5.0 secs
Area: 0.0.0.0
Number of interfaces in this area is 5
Type of authentication none
SPF algorithm has run 5 times
Area: 0.0.0.1
Stub area
Number of interfaces in this area is 0
Type of authentication none
SPF algorithm has run 2 times
Configuring an OSPF SPF Exponential Backoff
The OSPF SPF exponential backoff functionality limits the number of SPF computations during times of network instability by doubling the delay associated with the SPF run, up to a maximum delay, for the period of instability. When the period of instability ends, the delay is reset to the original value. Three timers are associated SPF exponential backoff: Start Time, Initial Hold Time, and Max Hold Time.
When a topology change is received for the first time, the SPF computation is delayed for the value set by Start Time. IPriori runs an SPF when the Start Time timer expires. When the SPF computation completes, a timer starts with the value of the Initial Hold Time. If there is a topology change during this Initial Hold Time timer run, IPriori runs another SPF computation at the expiration of the Initial Hold Time. At the completion of the SPF computation the Initial Hold Time timer is first doubled and then run again. This process will continue until the Max Hold Time is reached at which time SPF computations will continue to run with a delay of Max Hold Time until an hold timer expires with no topology change taking place during the length of the timer. When that happens, the hold timer value returns to the value set by the Start Time.
Use the timers throttle spf startTime initHoldTime maxHoldTime command to configure OSPF SPF exponential backoff.
Use the no timers throttle spf command to reset
The timers throttle spf and timers-spf command can not be configured at the same time. The latter of the two configurations will always override the former configuration. If an SPF computation is pending for received changes and a configuration change takes place from one of these commands to another, an SPF computation will be run immediately with the timer values of the latter command configuration taking affect at the end of the SPF computation.
Example: In the following example the OSPF SPF exponential backoff timer startTime is set to 1ms, the initHoldTime is set to 5000 ms, and the maxHoldTime is set to 40000 ms using the timers throttle spf command:
router(config)#router ospf 12
router(config-router)#timers throttle spf 1 5000 40000
router(config-router)end
router#show ip ospf
Configuring OSPF Default Route Origination
OSPF default route origination provides for the generation of a default route if a default route has been manually configured or without a manually configured default route with the always keyword specified. If a router is configured for default route origination, OSPF will originate an advertisement 0.0.0.0 in its external LSA. Enabling default route origination automatically configures the router as an Autonomous System Boundary Router (ASBR). An ASBR does not generate a default route into the OSPF routing domain automatically. It does so only if the configured criterion is met. For instance, a route-map can be used to advertise 0/0 conditionally. A match IP address standard access-list command can specify one or more IP routes that must exist before the router will advertise 0/0.
If a route-map is specified and one or more routes in the routing table qualifies any of the access-list or prefix-list conditions, the default route is originated. If the router receives an LSA with the default route, it will install the default route based upon a metric criterion if multiple default route entries exist. In the event of a default route being redistributed from other routing protocols, default route origination will take the precedence and replace the export entry.
Enabling OSPF default route origination is recommended for scenarios such as the following:
- The router is an ASBR router and running BGP with external peers.
- As a result of network policy this border router is chosen for default traffic.
Use the default-information originate command to enable default route origination on this router.
Use the no default-information originate command to disable default route origination on this router. Specifying any Option with the no command only changes the option to its default value leaving the remainder of the configuration unchanged.
Example 1: The following example forces the generation of a default route into the OSPF domain if the metric and route-map criteria are met and a default route is configured:
router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
router(config)#router ospf 1
router(config-router)#default-information originate metric 50 metric-type 1 route-map r1
router(config-router)#show
!
router ospf 1
default-information originate metric 50 metric-type 1 route-map r1
!
Example 2: The following example removes the route map configured in example 1 from the default route origination configuration:
router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
router(config)#router ospf 1
router(config-router)#no default-information originate route-map r1
router(config-router)#show
!
router ospf 1
default-information originate metric 50 metric-type 1
!
Example 3: The following example removes the default route origination configuration for this router:
router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
router(config)#router ospf 1
router(config-router)#no default-information originate
router(config-router)#show
!
router ospf 1
!
Configuring IGP Redistribution
IPriori supports the redistribution of OSPF routes into IS-IS and the redistribution of IS-IS routes into OSPF. The following is supported:
- OSPF process ID to IS-IS route-tag and IS-IS route-tag to OSPF process ID
- Level based redistribution
- Metric-type based redistribution
- Route-map based redistribution
Use the redistribute ospf command in router isis command mode to redistribute OSPF routes into IS-IS specifying the process ID and route level to be redistributed.
Use the show command in the appropriate router configuration mode to display the current redistribution configuration for this router.
Configuring OSPF Administrative Distance
IPriori provides for the configuration of OSPF administrative distance. Administrative distance is a metric that specifies the reliability of one routing protocol over another when there are multiple routes to the same destination via multiple routing protocols. Routing protocols are configured from most preferred to least preferred based upon the numeric value specified by administrative distance.
Use the administrative-distance command in OSPF router configuration mode to change the OSPF administrative distance.
Use the no administrative-distance command to reset OSPF administrative distance to its default value.
If the administrative distance configuration has changed, use the show running-config command to display the new value. If a route is selected as the best route, the show ip route ospf command displays the administrative distance for OSPF.
Display Information About OSPF
The following commands are available for displaying OSPF behavior and status.
- show ip ospf
- show ip ospf address-range
- show ip ospf border-routers
- show ip ospf database
- show ip ospf interface
- show ip ospf neighbor
- show ip ospf request-list
- show ip ospf retransmission-list
- show ospf virtual-links
Copyright © 2005
Avici Systems Inc.
Avici® and TSR®
is a registered trademark of Avici Systems Inc.
IPriori, Composite Links, SSR, QSR, and NSR® are
trademarks of Avici Systems Inc.
Source
File Name: ospf.fm
HTML File Name: ospf.html
Last Updated: 02/25/05 at 15:33:42