Viewing OSPF SPF statistics

Displays the log used to record SPF calculations on an OSPF-enabled routing switch. The SPF algorithm recalculates the routes in an OSPF domain when a change in the area topology is received.

Syntax:

show ip ospf spf-log

This command output displays:
  • The number of times that the SPF algorithm was executed for each OSPF area to which the routing switch is assigned.

  • The event that resulted in the last ten executions of the SPF algorithm on the routing switch. Possible events (reasons) are as follows:
    Re-init

    OSPF was enabled or disabled on the routing switch.

    Router LS update

    A router (type 1) link-state advertisement was received.

    Network LS update

    A network (type 2) link-state advertisement was received.

    Generated RTR LSA

    A router (type 1) link-state advertisement was generated on the routing switch.

    Generated NTW LSA

    A network (type 2) link-state advertisement was generated on the routing switch.

Displaying OSPF SPF statistics

switch(ospf)# show ip ospf spf-log

 OSPF SPF (SHORTEST PATH FIRST) LOG

  Area : 0.0.0.100      - Number of times SPF executed : 12

  SPF Instance    Reason                      Time
  --------------- --------------------------- ----------------
  1               Router LS Update            0h:35m:44
  2               Router LS Update            0h:36m:03
  3               Generated RTR LSA           1h:04m:21
  4               Generated NTW LSA           1h:28m:12
  5               Network LS Update           2h:11m:05
  6               Network LS Update           2h:54m:55
  7               Generated RTR LSA           3h:01m:11
  8               Router LS Update            3h:22m:39
  9               Generated RTR LSA           4h:36m:22
  10              Re-Init                     4h:48m:54

CLI display of OSPF SPF statistics

area [area id | ip-address]

ID number or IP address of an area to which the switch is assigned, including the number of times the SPF algorithm was executed to recalculate OSPF routes in the area.

SPF instances

Last ten instances in which the SPF algorithm was executed to recalculate an OSPF route in the area.

Reason

The event or reason why the SPF algorithm was executed.

Time

Time when the SPF computation began.