RFC 1765

OSPF Database Overflow

๐Ÿ“… published March 1995, from ietf

OSPF Database Overflow ๐Ÿ’–

Okay bestie, this is RFC 1765, written by J. Moy at Cascade ๐ŸŽ€ It's in the Experimental category and dates from March 1995 ๐Ÿ“… Its title block doesn't list anything it obsoletes or updates, so it's a standalone doc ๐Ÿฆ‹ It belongs to the OSPF Working Group, and the team wants feedback at ospf@gated.cornell.edu ๐Ÿ’Œ


Status of this Memo โœจ

This memo defines an Experimental Protocol for the Internet community ๐Ÿงช It does not specify an Internet standard of any kind, so don't treat it like one ๐Ÿ™ˆ The authors are asking for discussion and suggestions for improvement, and the memo can be distributed without any limits ๐ŸŒธ

Abstract ๐Ÿ”ฎ

Okay so OSPF only works if every OSPF router keeps an identical copy of the OSPF link-state database ๐Ÿง  But when that database gets really big, some routers might not have the resources to hold the whole thing ๐Ÿ˜ฉ The memo calls this "database overflow" ๐Ÿ’€ When overflow is expected, you can keep those resource-strapped routers happy by setting up OSPF stub areas and NSSAs ๐Ÿซถ This memo is all about handling unexpected overflows gracefully ๐Ÿ’…

This memo is a product of the OSPF Working Group. Comments go to ospf@gated.cornell.edu ๐Ÿ’–

Table of Contents ๐Ÿ“š

   1.       Overview ............................................... 2
   2.       Implementation details ................................. 3
   2.1      Configuration .......................................... 3
   2.2      Entering OverflowState ................................. 4
   2.3      Operation while in OverflowState ....................... 5
   2.3.1    Modifications to Flooding .............................. 5
   2.3.2    Originating AS-external-LSAs ........................... 6
   2.3.3    Receiving self-originated LSAs ......................... 6
   2.4      Leaving OverflowState .................................. 6
   3.       An example ............................................. 6
   4.       Administrative response to database overflow ........... 7
   5.       Operational experience ................................. 8
   6.       Possible enhancements .................................. 8
   A.       Related MIB parameters ................................  8
            References ............................................  9
            Security Considerations ...............................  9
            Author's Address ......................................  9

1. Overview ๐Ÿฆ‹

Okay so OSPF requires that every OSPF router inside a single area keeps an identical copy of the link-state database ๐Ÿง  The catch is that when the database becomes super large, some routers might run out of resources and not be able to store all of it, which is what we call "database overflow" ๐Ÿ˜ญ For example, a regional network might have a massive OSPF database because it's importing a ton of external routes into OSPF ๐ŸŒ If overflow isn't handled correctly, routers end up with inconsistent views of the network, and that can lead to incorrect routing ๐Ÿ’€

One way to handle database overflow is to tuck resource-limited routers into OSPF stub areas (see Section 3.6 of [1]) or NSSAs ([2]) ๐Ÿซถ AS-external-LSAs get left out of the link-state databases in those areas, so the database size stays under control โœจ

The problem is that unexpected overflows can't be dealt with that way ๐Ÿ˜ฉ So this memo describes how to dynamically limit database size when overflow happens. The basic mechanism works like this ๐Ÿ‘‘

  1. A parameter, ospfExtLsdbLimit, is configured on each router. It's the maximum number of AS-external-LSAs (not counting the ones describing the default route) that are allowed in the link-state database. This parameter must be the same on all routers in the routing domain (see Section 2.1), and network management is how the routers stay in sync on it ๐Ÿ”ง
  2. In any router's database, the number of AS-external-LSAs (excluding default) is never allowed to go past ospfExtLsdbLimit. If a router gets a non-default AS-external-LSA that would push the count past ospfExtLsdbLimit, it drops the LSA and does NOT acknowledge it ๐Ÿ™…โ€โ™€๏ธ
  3. If the number of non-default AS-external-LSAs in a router's database hits ospfExtLsdbLimit, the router a) flushes all the non-default AS-external-LSAs it has originated itself (see Section 2.2) and b) goes into "OverflowState" ๐Ÿšจ
  4. While in OverflowState, the router refuses to originate any non-default AS-external-LSAs (see Section 2.3.2) ๐Ÿ™ˆ
  5. Optionally, the router can try to leave OverflowState once the configurable parameter ospfExitOverflowInterval has passed since it entered OverflowState (see Section 2.4). Only then can the router start originating non-default AS-external-LSAs again ๐ŸŒˆ

Why only limit non-default AS-external-LSAs and not the other LSA types? There are two reasons ๐Ÿ’… First, non-default AS-external-LSAs are the most likely to take over the database in networks with huge databases (e.g., regional networks; see [5]) ๐ŸŒ Second, they can be thought of as "optional" in this sense: the router can probably still be monitored and reconfigured without them ๐Ÿซง (That said, other LSA types can be limited with similar strategies too; see Section 5.)

The method for dealing with database overflow described here has these awesome properties โœจ

  • After a short period of convergence, all routers have identical link-state databases. That database contains less than ospfExtLsdbLimit non-default AS-external-LSAs ๐Ÿ’–
  • At all times, routing WITHIN the OSPF Autonomous System stays intact. Among other things, that means the routers keep being manageable ๐ŸŽ€
  • Default routing to external destinations also stays intact. This hopefully means a lot of external connectivity is preserved, although the routes might be less efficient ๐Ÿฆ‹
  • If ospfExitOverflowInterval is configured, the OSPF system recovers fully and automatically (no network management intervention needed) from transient database overflow conditions (see Section 2.4) ๐Ÿ‘‘๐Ÿซถ

2. Implementation details โœจ

okay so this section is where we get into the nitty gritty of how a router handles database overflow ๐Ÿงš. It's built around one big idea, OverflowState ๐Ÿ’…. We'll cover how a router gets into OverflowState, how it acts while it's in there, and how it finally gets out ๐Ÿฆ‹.

2.1. Configuration

Network management sets these configuration parameters. They were added to support the database overflow functionality ๐ŸŽ€.

ospfExtLsdbLimit

Once a router's link-state database has ospfExtLsdbLimit non-default AS-external-LSAs in it, the router flips into OverflowState ๐Ÿšจ. A router never holds more than ospfExtLsdbLimit non-default AS-external-LSAs in its database, so it's like a hard cap ๐Ÿงข.

ospfExtLsdbLimit MUST be set identically in all routers attached to the OSPF backbone and/or any "regular" OSPF area. (Heads up: this memo doesn't apply to routers inside OSPF stub areas or NSSAs, since those routers never get AS-external-LSAs ๐Ÿ™ˆ.) If ospfExtLsdbLimit isn't set the same everywhere, then when the database overflows, things go sideways ๐Ÿ’€. The routers will not converge on a common link-state database, incorrect routing (possibly including routing loops) shows up, and AS-external-LSAs keep getting retransmitted over and over ๐Ÿ˜ญ. Making sure every router has the identical setting is network management's job ๐Ÿซถ.

When ospfExtLsdbLimit is set in a router, that router must have some way to guarantee it can actually hold that many non-default AS-external-LSAs in its link-state database. One way to do this is to preallocate resources, like memory, for the configured number of LSAs ๐Ÿง โœจ.

ospfExitOverflowInterval

This is the number of seconds that a router waits, after entering OverflowState, before it tries to leave. Once it leaves, it's allowed to originate non-default AS-external-LSAs again ๐ŸŒธ. If it's set to 0, the router won't leave OverflowState until it gets restarted. The default setting is 0 ๐Ÿ“.

Here's the tea: ospfExitOverflowInterval doesn't have to match across routers โ˜•. You can give a smaller value to the routers that originate the "more important" AS-external-LSAs ๐Ÿ‘‘. Honestly, setting it the same everywhere can cause chaos, because a bunch of routers would try to leave OverflowState at the exact same moment ๐Ÿ˜ตโ€๐Ÿ’ซ. So the value must be "jittered" by randomly varying it within plus or minus 10 percent before it's used ๐ŸŽฒ.

2.2. Entering OverflowState

The router enters OverflowState as soon as the number of non-default AS-external-LSAs in its database hits ospfExtLsdbLimit ๐Ÿšช. There are two ways this can happen. The first is when the router receives an LSA during flooding. In that case, an LSA that doesn't already have a database instance gets added in Step 5 of Section 13 of [1]. The second is when the router originates a non-default AS-external-LSA itself ๐Ÿ™‹โ€โ™€๏ธ.

Whenever a router enters OverflowState, it flushes all the non-default AS-external-LSAs that it originated itself ๐Ÿงน. Flushing happens through the premature aging scheme in Section 14.1 of [1]. Only self-originated LSAs get flushed. LSAs from other routers stay right where they are in the link-state database ๐Ÿ’….

2.3. Operation while in OverflowState

While a router is in OverflowState, flooding and origination of non-default AS-external-LSAs change up a bit ๐Ÿ”„. Here's how.

2.3.1. Modifications to Flooding

Here's the flooding glow-up ๐Ÿ’–. When Step 5 of Section 13 of [1] runs and a non-default AS-external-LSA shows up that a) has no current database instance and b) would push the count of non-default AS-external-LSAs past ospfExtLsdbLimit, that LSA gets tossed ๐Ÿ—‘๏ธ. It isn't installed in the link-state database, and it isn't acknowledged either ๐Ÿ™ˆ.

When every router has identical values for ospfExtLsdbLimit (like it's required to), this flooding change only kicks in during a short convergence period โณ. Yes, there will be retransmissions of LSAs during that window ๐Ÿ˜ค. But once things converge, the retransmissions stop, because the routers settle on a database with fewer than ospfExtLsdbLimit non-default AS-external-LSAs ๐ŸŽ‰.

Even in OverflowState, non-default AS-external-LSAs ARE still accepted in these situations:

  1. If the LSA updates an LSA that already exists in the router's link-state database ๐Ÿ”.
  2. LSAs with an LS age of MaxAge are always accepted ๐Ÿ’ฏ. Handling these follows the procedures in Sections 13 and 14 of [1].
  3. If adding the LSA would keep the number of non-default AS-external-LSAs less than or equal to ospfExtLsdbLimit, the LSA is accepted ๐Ÿฅฐ.

2.3.2. Originating AS-external-LSAs

Originating AS-external-LSAs is covered in Section 12.4.5 of [1] ๐Ÿ“–. A router in OverflowState doesn't originate non-default AS-external-LSAs at all ๐Ÿ™…โ€โ™€๏ธ. So the only AS-external-LSAs a router in OverflowState originates are the ones with Link State ID 0.0.0.0 ๐Ÿงš.

2.3.3. Receiving self-originated LSAs

Receiving self-originated LSAs is described in Section 13.4 of [1] ๐Ÿ‘€. If a router in OverflowState gets a self-originated non-default AS-external-LSA, it responds by flushing it from the routing domain with the premature aging scheme from Section 14.1 of [1] ๐Ÿงนโœจ.

2.4. Leaving OverflowState

If ospfExitOverflowInterval is non-zero, then the moment a router enters OverflowState, it starts a timer set to ospfExitOverflowInterval (give or take a random 10 percent) โฐ. When that timer fires, the router leaves OverflowState and starts originating non-default AS-external-LSAs again ๐Ÿฆ‹.

This is the self-healing part ๐Ÿฉน. Picture an AS boundary router that imports a ton of AS-external-LSAs and then crashes ๐Ÿ’ฅ. Other routers start importing those routes instead, so until the crashed router gets restarted or its AS-external-LSAs age out, the database is way bigger than usual ๐Ÿ˜ฌ. An overflow like this is guaranteed to clear within MaxAge seconds (1 hour). So automatic recovery can be a good (and fast enough) fix if the overflow happens off-hours ๐ŸŒ™.

Once the router leaves OverflowState, it's eligible to enter OverflowState again, following the rules in Section 2.2 ๐Ÿ”„๐Ÿ’œ.

3. An example

Let's walk through a demo ๐ŸŽฌ. Say a router runs the database overflow logic, with ospfExtLsdbLimit set to 10,000 and ospfExitOverflowInterval set to 600 seconds. Now say the router is originating 400 non-default AS-external-LSAs itself, and the current number of non-default AS-external-LSAs in its database is 9,997 ๐Ÿ“Š.

Then the router gets a Link State Update packet from a neighbor. It contains 6 non-default AS-external-LSAs, and none of them have a current database copy ๐Ÿ“ฆ. The first two LSAs get installed in the database just fine โœ…. The third one also gets installed, but it pushes the router into OverflowState ๐Ÿ˜ฑ. Going into OverflowState makes the router flush its 400 self-originated non-default LSAs with premature aging ๐Ÿงน. Those 400 LSAs still count as part of the link-state database until their re-flooding (with age set to MaxAge) gets acknowledged (see Section 14 of [1]). That's why the last three LSAs in the update get discarded without being acknowledged ๐Ÿ™ˆ.

After a little while, all the routers converge on a common database with fewer than 10,000 non-default AS-external-LSAs ๐Ÿค. During that convergence period, some link-state retransmissions might happen. For instance, the neighbor who sent that Link State Update packet might resend the three LSAs that got discarded ๐Ÿ”. If that resend shows up after the flushing of the 400 self-originated LSAs has been acknowledged, then those 3 LSAs get accepted ๐Ÿฅณ.

Going into OverflowState also starts a timer that fires sometime between 540 and 660 seconds later โฒ๏ธ. When it fires, the router leaves OverflowState and re-originates its 400 non-default AS-external-LSAs, but only if the current database has less than 9600 (10,000 - 400) non-default AS-external-LSAs ๐Ÿงฎ. If there are more than 9600, the timer just restarts ๐Ÿ”„.

4. Administrative response to database overflow

Once the link-state database has overflowed, network management might need to step in before all routing is back to normal ๐Ÿง‘โ€๐Ÿ’ป. (If the overflow is transient, routing might come back on its own. See Section 2.4 for details ๐Ÿ’ซ.) An overflow condition shows up as SNMP traps (see Appendix B ๐Ÿšจ). Here are some moves a network manager might make:

  • Raise the value of ospfExtLsdbLimit ๐Ÿ“ˆ. Maybe it was set too conservatively, and the routers can actually handle bigger databases than they're configured for ๐Ÿ’ช.
  • Isolate routers that have limited resources by putting them in OSPF stub areas or NSSAs ๐Ÿ๏ธ. That way, ospfExtLsdbLimit can go up on the remaining routers ๐Ÿš€.
  • Rethink whether certain external routes need to be imported at all ๐Ÿค”. If ospfExtLsdbLimit can't go up, the network manager will want to make sure the more important routes keep getting imported. The way to do that is to turn off importing the less important ones ๐Ÿ—‚๏ธ.

5. Operational experience

This database overflow scheme has been running in the Proteon router for years ๐Ÿ†, with a couple of differences ๐Ÿ‘€. First, that router didn't leave OverflowState until it got restarted (so ospfExitOverflowInterval was always 0). Second, default AS-external-LSAs weren't separated from non-default AS-external-LSAs. Still, it worked as expected ๐ŸŽ‰. During overflow, the routers converged on a common database with fewer than a configured number of AS-external-LSAs ๐Ÿ’–.

6. Possible enhancements

There are some enhancements you could make to the overflow scheme ๐ŸŒˆ:

  • Other LSA types could get a limit too, with one exception: the transit LSAs (router-LSAs and network-LSAs) are off the table ๐Ÿ™…. For example, you could cap the number of summary-LSAs or group-membership-LSAs (see [6]) ๐Ÿ’œ.
  • Instead of flushing all of its non-default AS-external-LSAs when it enters OverflowState, a router could flush a fixed number every time the database size hits ospfExtLsdbLimit โœ‚๏ธ. That way it can prioritize, and flush the least important AS-external-LSAs first ๐Ÿง โœจ.

okay so this appendix is all about the OSPF MIB variables that got defined to support the database overflow procedure from this memo. if you want the full scoop, see [4] ๐Ÿ’…

  • ospfExtLsdbLimit: the maximum number of non-default AS-external-LSAs that can be stored in the database (same as Section 2.1 of this memo ๐ŸŽ€). if it's set to -1, there's no limit at all. no cap, no cry ๐Ÿ’–
  • ospfExitOverflowInterval: the number of seconds a router waits after entering OverflowState before it tries to leave. once it leaves, it can originate non-default AS-external-LSAs again ๐Ÿงš. if it's set to 0, the router stays in OverflowState until it gets restarted ๐Ÿ’€
  • ospfLsdbOverflow: a trap that fires when the number of non-default AS-external-LSAs has exceeded or equaled ospfExtLsdbLimit. translation: the router is entering OverflowState ๐Ÿšจ
  • ospfLsdbApproachingOverflow: a trap for when the number of non-default AS-external-LSAs has gone over ninety percent of ospfExtLsdbLimit ๐Ÿ‘€ an early warning, bestie ๐Ÿซถ

References ๐Ÿ“š

  • [1] Moy, J., "OSPF Version 2", RFC 1583, Proteon, Inc., March 1994.
  • [2] Coltun, R., and V. Fuller, "The OSPF NSSA Option", RFC 1587, RainbowBridge Communications, Stanford University, March 1994.
  • [3] Moy, J., Editor, "OSPF Protocol Analysis", RFC 1245, Proteon, Inc., July 1991.
  • [4] Baker F., and R. Coltun, "OSPF Version 2 Management Information Base", Work in Progress.
  • [5] Moy, J., Editor, "Experience with the OSPF Protocol", RFC 1246, Proteon, Inc., July 1991.
  • [6] Moy, J., "Multicast Extensions to OSPF", RFC 1584, Proteon, Inc., March 1994.

Security Considerations ๐Ÿ”

ngl this is the shortest section ever ๐Ÿ™ˆ Security issues are not discussed in this memo.

Author's Address ๐Ÿ–‹๏ธ

John Moy
Cascade Communications Corp.
5 Carlisle Road
Westford, MA 01886

Phone: 508-692-2600 Ext. 394
Fax:   508-692-9214
EMail: jmoy@casc.com
๐Ÿ“ฆ where this page comes from