Limiting an OSPF Database

I’ve got two routers, R0 and R1, with an OSPF adjacency between them. R0 doesn’t have much memory and he’s getting concerned that R1 is sending him too many LSAs.

R0’s OSPF database looks like this:

R0#sh ip o d       

            OSPF Router with ID (3.3.3.3) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
3.3.3.3         3.3.3.3         5           0x80000001 0x003A88 3
5.5.5.5         5.5.5.5         144         0x80000005 0x00547D 2

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
11.11.11.11     5.5.5.5         75          0x80000001 0x0001FA
22.22.22.22     5.5.5.5         170         0x80000001 0x0005CA
33.33.33.33     5.5.5.5         129         0x80000001 0x00099A
44.44.44.44     5.5.5.5         119         0x80000001 0x000D6A
55.55.55.55     5.5.5.5         119         0x80000001 0x00113A
R0#

R0 has 7 LSAs, 6 of them from R1 (5.5.5.5)! That’s far too many for R0 to handle. We need to limit what R1 can send to R0, and we can do it with the max-lsa command. Cisco describes how it works here, so let’s experiment.

First, we specify the warning-only option:

R0(config)#router ospf 1
R0(config-router)#max-l
R0(config-router)#max-lsa ?
  <1-4294967294>  Maximum number of non self-generated LSAs this process can
                  receive

R0(config-router)#max-lsa 6 ?
  <1-100>       Threshold value (%) at which to generate a warning msg
  ignore-count  maximum number of times adjacencies can be suppressed
  ignore-time   time during which all adjacencies are suppressed
  reset-time    time after which ignore-count is reset to zero
  warning-only  Only give warning message when limit is exceeded

R0(config-router)#max-lsa 6 war
R0(config-router)#max-lsa 6 warning-only ?
  <1-100>  Threshold value (%) at which to generate a warning msg

R0(config-router)#max-lsa 6 warning-only 100
R0(config-router)#
*Mar  1 00:43:25.267: %OSPF-4-OSPF_MAX_LSA_THR: Threshold for maximum number of non self-generated LSA has been reached "ospf 1" - 6 LSAs

Uh oh. We better put in some more stringent limits to make sure R0 doesn’t get overrun:

R0(config-router)#max-lsa 6 100
R0(config-router)#
*Mar  1 00:46:05.759: %OSPF-4-OSPF_MAX_LSA_THR: Threshold for maximum number of non self-generated LSA has been reached "ospf 1" - 6 LSAs
R0(config-router)#

Without the warning-only option (and all other default values), R0 will drop its adjacencies for one minute should it maintain a 7th LSA in its database for over a minute. Let’s try it:

R0(config-router)#do debug ip ospf ev
OSPF events debugging is on
R0(config-router)#
*Mar  1 00:48:06.887: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 1.1.1.0
*Mar  1 00:48:11.603: OSPF: Rcv LS UPD from 5.5.5.5 on FastEthernet0/0 length 56 LSA count 1
*Mar  1 00:48:11.603: %OSPF-4-OSPF_MAX_LSA: Maximum number of non self-generated LSA has been exceeded "ospf 1" - 7 LSAs
*Mar  1 00:48:13.667: OSPF: Rcv hello from 5.5.5.5 area 0 from FastEthernet0/0 1.1.1.1
*Mar  1 00:48:13.667: OSPF: End of hello processing
*Mar  1 00:48:16.887: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 1.1.1.0
*Mar  1 00:48:23.659: OSPF: Rcv hello from 5.5.5.5 area 0 from FastEthernet0/0 1.1.1.1
*Mar  1 00:48:23.659: OSPF: End of hello processing
*Mar  1 00:48:26.887: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 1.1.1.0
*Mar  1 00:48:33.667: OSPF: Rcv hello from 5.5.5.5 area 0 from FastEthernet0/0 1.1.1.1
*Mar  1 00:48:33.667: OSPF: End of hello processing
*Mar  1 00:48:36.887: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 1.1.1.0
*Mar  1 00:48:43.659: OSPF: Rcv hello from 5.5.5.5 area 0 from FastEthernet0/0 1.1.1.1
*Mar  1 00:48:43.659: OSPF: End of hello processing
*Mar  1 00:48:46.887: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 1.1.1.0
*Mar  1 00:48:53.659: OSPF: Rcv hello from 5.5.5.5 area 0 from FastEthernet0/0 1.1.1.1
*Mar  1 00:48:53.659: OSPF: End of hello processing
*Mar  1 00:48:56.887: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 1.1.1.0
*Mar  1 00:49:03.659: OSPF: Rcv hello from 5.5.5.5 area 0 from FastEthernet0/0 1.1.1.1
*Mar  1 00:49:03.659: OSPF: End of hello processing
*Mar  1 00:49:06.887: OSPF: Send hello to 224.0.0.5 area 0 on FastEthernet0/0 from 1.1.1.0
*Mar  1 00:49:11.603: OSPF: Flushing External Links
*Mar  1 00:49:11.603: OSPF: Flushing Opaque AS Links
*Mar  1 00:49:11.639: OSPF: Flushing Link states in area 0
*Mar  1 00:49:11.675: OSPF: Interface Loopback0 going Down
*Mar  1 00:49:11.675: OSPF: Interface FastEthernet0/0 going Down
*Mar  1 00:49:11.675: %OSPF-5-ADJCHG: Process 1, Nbr 5.5.5.5 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Mar  1 00:49:11.683: OSPF: Interface Loopback0 going Up
*Mar  1 00:49:11.683: OSPF: Interface FastEthernet0/0 going Up
*Mar  1 00:49:11.683: OSPF: Do not send Hello over FastEthernet0/0, ignoring all neighbors due to max-lsa limit
*Mar  1 00:49:13.659: OSPF: Nbr 5.5.5.5 1.1.1.1 FastEthernet0/0 is currently ignored due to max-lsa limit
*Mar  1 00:49:14.159: OSPF: OSPF: Rcv pkt from FastEthernet0/0 src 1.1.1.1 dst 224.0.0.5 id 5.5.5.5 type 5 if_state 4 : ignored due to unknown neighbor
*Mar  1 00:49:21.683: OSPF: Do not send Hello over FastEthernet0/0, ignoring all neighbors due to max-lsa limit
*Mar  1 00:49:23.659: OSPF: Nbr 5.5.5.5 1.1.1.1 FastEthernet0/0 is currently ignored due to max-lsa limit
*Mar  1 00:49:31.683: OSPF: Do not send Hello over FastEthernet0/0, ignoring all neighbors due to max-lsa limit
*Mar  1 00:49:33.659: OSPF: Nbr 5.5.5.5 1.1.1.1 FastEthernet0/0 is currently ignored due to max-lsa limit
*Mar  1 00:49:41.683: OSPF: Do not send Hello over FastEthernet0/0, ignoring all neighbors due to max-lsa limit
*Mar  1 00:49:43.667: OSPF: Nbr 5.5.5.5 1.1.1.1 FastEthernet0/0 is currently ignored due to max-lsa limit
*Mar  1 00:49:51.683: OSPF: Do not send Hello over FastEthernet0/0, ignoring all neighbors due to max-lsa limit
*Mar  1 00:49:53.683: OSPF: Nbr 5.5.5.5 1.1.1.1 FastEthernet0/0 is currently ignored due to max-lsa limit
*Mar  1 00:50:01.683: OSPF: Do not send Hello over FastEthernet0/0, ignoring all neighbors due to max-lsa limit
*Mar  1 00:50:03.663: OSPF: Nbr 5.5.5.5 1.1.1.1 FastEthernet0/0 is currently ignored due to max-lsa limit
*Mar  1 00:50:11.683: OSPF: Do not send Hello over FastEthernet0/0, ignoring all neighbors due to max-lsa limit
*Mar  1 00:50:13.667: OSPF: Nbr 5.5.5.5 1.1.1.1 FastEthernet0/0 is currently ignored due to max-lsa limit
*Mar  1 00:50:21.683: OSPF: Do not send Hello over FastEthernet0/0, ignoring all neighbors due to max-lsa limit
*Mar  1 00:50:23.679: OSPF: Nbr 5.5.5.5 1.1.1.1 FastEthernet0/0 is currently ignored due to max-lsa limit

There’s a lot here, so let’s pick through it. At 48:11, R0 received a 7th LSA from R1. It generated a log message. One minute later (to the millisecond), R0 bounced all its interfaces and stopped sending or receiving any LSAs to/from its neighbors. Using default settings, R0 will stay down for 5 minutes before bringing its OSPF adjacencies back up. Once bringing them back up, if more than 6 LSAs exist in the database, a max-lsa log message will be generated and one minute later this interface-bouncing process will repeat. After going down five times (29 minutes later) the OSPF process will stay down until an administrator intervenes.

Tagged with:

Leave a Reply

Your email address will not be published. Required fields are marked *