OSPF SPF timers settings

Generally an OSPF/IS-IS router process configuration is not bigger than 3 or 4 lines. Initial OSPF/IS-IS needs following settings to work properly:

  • router-id (mandatory)
  • auto-cost reference bandwidth (mandatory)
  • passive interface-default (optional)
  • authentication command (optional)

Authentication and passive interface-default settings are optional, for a networking lab it would not be needed. Additionally metric-style is needed to be set if using IS-IS, here metric-style wide.

Network engineers sometimes set the OSPF Hello and Dead timers to make the network converge faster. But the SPF (Shortest Path First) timers in the OSPF process often remain untouched, this setting is mostly overlooked. Setting SPF timers is as important as setting the router-id or auto-cost reference bandwidth, it is a mandatory setting if configuring OSPF. Even if using one vendor in the backbone. If SPF timers are left to their default values , it will work mostly fine except the microloops and blackhole-routing. IP packets will bounce between router interfaces for certain periods of time.

The Shortest Path First (SPF) calculation is triggered by following events, or when following OSPF Link State Advertisements (LSA) are sent:

  • Type-1 LSA - new router
  • Type-2 LSA - new subnet

Below the overview of the SPF default timer settings among several network operating systems:

Vendor OS Initial SPF Delay (ms)
Cisco IOS 5000
Cisco IOS-XE 5000
Cisco ASA 5000
Cisco NX-OS 200
Cisco IOS-XR 50
Force10 FTOS 5000
DELL DELLOS 5000
HP Comware 5000
Juniper JunOS 200
vyos Quagga 200
FRR Quagga 0
MikroTik RouterOS (unknown)

The SPF algorithm on Cisco hardware has following timers that can be adjusted:

  • SPF-start: Initial delay between receiving the first topology change to SPF calculation in millisecods
  • SPF-hold: Minimum wait between the first and the second SPF calculation in milliseconds
  • SPF-max-wait: Maximum wait time in milliseconds for SPF calculations

Even if using one vendor equipment SPF timers must have the same value : Change of Default OSPF and IS-IS SPF and Flooding Timers

Cisco is announcing the deprecation of the ISPF in OSPF and IS-IS in newer IOS-XE releases.

OPSF: Overview of the OSPF convergence default values:

OSPF command Parameters Default optimize disabled Default optimize enabled
timers throttle spf
initial (ms) 5000 50
min-delay(ms) 10000 200
max-delay (ms) 10000 5000
timers throttle lsa all
Initial (ms) 0 50
min-delay (ms) 5000 200
max-delay(ms) 5000 5000
timers lsa arrival ms 1000 100

According to the document OSPF configuration for IOS/IOS-XE routers should looks like this example below:

conf t
!
router ospfv3 1
 timers throttle spf 50 200 5000
 timers throttle lsa 50 200 5000
 timers lsa arrival 100
 !
 address-family ipv6 unicast
  router-id 10.255.255.255
  bfd all-interfaces
  log-adjacency-changes
  auto-cost reference-bandwidth 10000
 exit-address-family
!
router ospf 1
 router-id 10.255.255.255
 auto-cost reference-bandwidth 10000
 timers throttle spf 50 200 5000
 timers throttle lsa 50 200 5000
 timers lsa arrival 100
 bfd all-interfaces
!
end
write

IS-IS: Overview of the IS-IS convergence default values:

IS-IS command Parameters Default optimize disabled Default optimize enabled
spf-interval
initial (ms) 5500 50
min-delay(ms) 5500 200
max-delay (ms) 10000 5000
prc-interval
Initial (ms) 2000 50
min-delay (ms) 5000 200
max-delay(ms) 5000 5000
lsp-gen-interval
Initial (ms) 50 50
min-delay (ms) 5000 200
max-delay(ms) 5000 5000

Below the IS-IS configuration with set SPF-timers for IOS routers:

conf t
!
router isis 1
 net 49.0000.1111.1111.1111.00
 metric-style wide
 fast-flood 10
 max-lsp-lifetime 65535
 lsp-refresh-interval 65000
 spf-interval 5 50 200
 prc-interval 5 50 200
 lsp-gen-interval 5 50 200
 log-adjacency-changes
 metric 100
 passive-interface Loopback0
 !
 address-family ipv6
  bfd all-interfaces
  metric 100
  maximum-paths 4
 exit-address-family
end
write

The time a routing protocol is needing to converge might take up to 5 seconds per router, or even longer, if values are left to defaults.

Name Description
SPF Shortest Path First
LSA Link-State Advertisement
PRC Partial Route Computation
LSP Link-State Packet