idnits 2.17.1 draft-ietf-idr-route-damp-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-26) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. ** The document is more than 15 pages and seems to lack a Table of Contents. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 39 instances of too long lines in the document, the longest one being 5 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 697 has weird spacing: '...in path exc...' -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (February 15, 1998) is 9567 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: '2' is defined on line 1421, but no explicit reference was found in the text == Unused Reference: '3' is defined on line 1428, but no explicit reference was found in the text == Unused Reference: '4' is defined on line 1433, but no explicit reference was found in the text == Unused Reference: '6' is defined on line 1442, but no explicit reference was found in the text == Unused Reference: '7' is defined on line 1446, but no explicit reference was found in the text == Unused Reference: '8' is defined on line 1450, but no explicit reference was found in the text ** Obsolete normative reference: RFC 1268 (ref. '1') (Obsoleted by RFC 1655) -- Possible downref: Non-RFC (?) normative reference: ref. '2' ** Downref: Normative reference to an Historic RFC: RFC 1267 (ref. '3') ** Obsolete normative reference: RFC 1771 (ref. '5') (Obsoleted by RFC 4271) ** Downref: Normative reference to an Historic RFC: RFC 1520 (ref. '6') ** Downref: Normative reference to an Informational RFC: RFC 1774 (ref. '7') ** Downref: Normative reference to an Informational RFC: RFC 1773 (ref. '8') Summary: 16 errors (**), 0 flaws (~~), 8 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Internet Engineering Task Force Curtis Villamizar 3 INTERNET-DRAFT ANS 4 draft-ietf-idr-route-damp-02 Ravi Chandra 5 Cisco 6 Ramesh Govindan 7 ISI 8 February 15, 1998 10 BGP Route Flap Damping 12 Status of this Memo 14 This document is an Internet-Draft. Internet-Drafts are working 15 documents of the Internet Engineering Task Force (IETF), its areas, 16 and its working groups. Note that other groups may also distribute 17 working documents as Internet-Drafts. 19 Internet-Drafts are draft documents valid for a maximum of six months 20 and may be updated, replaced, or obsoleted by other documents at any 21 time. It is inappropriate to use Internet- Drafts as reference 22 material or to cite them other than as ``work in progress.'' 24 To view the entire list of current Internet-Drafts, please check the 25 ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow 26 Directories on ftp.is.co.za (Africa), ftp.nordu.net (Europe), 27 munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or 28 ftp.isi.edu (US West Coast). 30 Abstract 32 A usage of the BGP routing protocol is described which is capable of 33 reducing the routing traffic passed on to routing peers and therefore 34 the load on these peers without adversely affecting route convergence 35 time for relatively stable routes. This technique has been 36 implemented in commercial products supporting BGP. The technique is 37 also applicable to IDRP. 39 The overall goals are: 41 o to provide a mechanism capable of reducing router processing load 42 caused by instability 44 o in doing so prevent sustained routing oscillations 46 o to do so without sacrificing route convergence time for generally 47 well behaved routes. 49 This must be accomplished keeping other goals of BGP in mind: 51 o pack changes into a small number of updates 53 o preserve consistent routing 55 o minimal addition space and computational overhead 57 An excessive rate of update to the advertised reachability of a subset 58 of Internet prefixes has been widespread in the Internet. This 59 observation was made in the early 1990s by many people involved in 60 Internet operations and remains the case. These excessive updates are 61 not necessarily periodic so route oscillation would be a misleading 62 term. The informal term used to describe this effect is ``route 63 flap''. The techniques described here are now widely deployed and are 64 commonly referred to as ``route flap damping''. 66 1 Overview 68 To maintain scalability of a routed internet, it is necessary to 69 reduce the amount of change in routing state propagated by BGP in 70 order to limit processing requirements. The primary contributors of 71 processing load resulting from BGP updates are the BGP decision 72 process and adding and removing forwarding entries. 74 Consider the following example. A widely deployed BGP implementation 75 may tend to fail due to high routing update volume. For example, it 76 may be unable to maintain it's BGP or IGP sessions if sufficiently 77 loaded. The failure of one router can further contribute to the load 78 on other routers. This additional load may cause failures in other 79 instances of the same implementation or other implementations with a 80 similar weakness. In the worst case, a stable oscillation could 81 result. Such worse cases have already been observed in practice. 83 A BGP implementation must be prepared for a large volume of routing 84 traffic. A BGP implementation cannot rely upon the sender to 85 sufficiently shield it from route instabilities. The guidelines here 86 are designed to prevent sustained oscillations, but do not eliminate 87 the need for robust and efficient implementations. The mechanisms 88 described here allow routing instability to be contained at an AS 89 border router bordering the instability. 91 Even where BGP implementations are highly robust, the performance of 92 the routing process is limited. Limiting the propagation of 93 unnecessary change then becomes an issue of maintaining reasonable 94 route change convergence time as a routing topology grows. 96 2 Methods of Limiting Route Advertisement 98 Two methods of controlling the frequency of route advertisement are 99 described here. The first involves fixed timers. The fixed timer 100 technique has no space overhead per route but has the disadvantage of 101 slowing route convergence for the normal case where a route does not 102 have a history of instability. The second method overcomes this 103 limitation at the expense of maintaining some additional space 104 overhead. The additional overhead includes a small amount of state 105 per route and a very small processing overhead. 107 It is possible and desirable to combine both techniques. In practice, 108 fixed timers have been set to very short time intervals and have 109 proven useful to pack routes (NLRI) into a smaller number of updates 110 when routes arrive in separate updates. 112 Seldom are fixed timers set to the tens of minutes to hours that would 113 be necessary to actually damp route flap. To do so would produce the 114 undesirable effect of severely limiting routing convergence. 116 2.1 Existing Fixed Timer Recommendations 118 BGP-3 does not make specific recommendations in this area [1]. The 119 short section entitled ``Frequency of Route Selection'' simply 120 recommends that something be done and makes broad statements regarding 121 certain properties that are desirable or undesirable. 123 BGP4 retains the ``Frequency of Route Advertisement'' section and adds 124 a ``Frequency of Route Origination'' section. BGP-4 describes a 125 method of limiting route advertisement involving a fixed 126 (configurable) MinRouteAdvertisementInterval timer and fixed 127 MinASOriginationInterval timer [5]. The recommended timer values of 128 MinRouteAdvertisementInterval is 30 seconds and 129 MinASOriginationInterval is 15 seconds. 131 2.2 Desirable Properties of Damping Algorithms 133 Before describing damping algorithms the objectives need to be clearly 134 defined. Some key properties are examined to clarify the design 135 rationale. 137 The overall objective is to reduce the route update load without 138 limiting convergence time for well behaved routes. To accomplish 139 this, criteria must be defined for well behaved and poorly behaved 140 routes. An algorithm must be defined which allows poorly behaved 141 routes to be identified. Ideally, this measure would be a prediction 142 of the future stability of a route. 144 Any delay in propagation of well behaved routes should be minimal. 145 Some delay is tolerable to support better packing of updates. Delay 146 of poorly behave routes should, if possible, be proportional to a 147 measure of the expected future instability of the route. Delay in 148 propagating an unstable route should cause the unstable route to be 149 suppressed until there is some degree of confidence that the route has 150 stabilized. 152 If a large number of route changes are received in separate updates 153 over some very short period of time and these updates have the 154 potential to be combined into a single update then these should be 155 packed as efficiently as possible before propagating further. Some 156 small delay in propagating well behaved routes is tolerable and is 157 necessary to allow better packing of updates. 159 Where routes are unstable, use and announcement of the routes should 160 be suppressed rather than suppressing their removal. Where one route 161 to a destination is stable, and another route to the same destination 162 is somewhat unstable, if possible, the unstable route should be 163 suppressed more aggressively than if there were no alternate path. 165 Routing consistency within an AS is very important. Only very minimal 166 delay of internal BGP (IBGP) should be done. Routing consistency 167 across AS boundaries is also very important. It is highly undesirable 168 to advertise a route that is different from the route that is being 169 used, except for a very minimal time. It is more desirable to 170 suppress the acceptance of a route (and therefore the use of that 171 route in the IGP) rather than suppress only the redistribution. 173 It is clearly not possible to accurately predict the future stability 174 of a route. The recent history of stability is generally regarded as 175 a good basis for estimating the likelihood of future stability. The 176 criteria that is used to distinguish well behaved from poorly behaved 177 routes is therefore based on the recent history of stability of the 178 route. There is no simple quantitative expression of recent stability 179 so a figure of merit must be defined. Some desirable characteristics 180 of this figure of merit would be that the farther in the past that 181 instability occurred, the less it's affect on the figure of merit and 182 that the instability measure would be cumulative rather than 183 reflecting only the most recent event. 185 The algorithms should behave such that for routes which have a history 186 of stability but make a few transitions, those transitions should be 187 made quickly. If transitions continue, advertisement of the route 188 should be suppressed. There should be some memory of prior instabil- 189 ity. The degree to which prior instability is considered should be 190 gradually reduced as long as the route remains announced and stable. 192 2.3 Design Choices 194 After routes have been accepted their readvertisement will be briefly 195 suppressed to improve packing of updates. There may be a lengthy 196 suppression of the acceptance of an external route. How long a route 197 will be suppressed is based on a figure of merit that is expected to 198 be correlated to the probability of future instability of a route. 199 Routes with high figure of merit values will be suppressed. An 200 exponential decay algorithm was chosen as the basis for reducing the 201 figure of merit over time. These choices should be viewed as 202 suggestions for implementation. 204 An exponential decay function has the property that previous 205 instability can be remembered for a fairly long time. The rate at 206 which the instability figure of merit decays slows as time goes on. 207 Exponential decay has the following property. 209 f(f(figure-of-merit, t1), t2) = f(figure-of-merit, t1+t2) 211 This property allows the decay for a long period to be computed in a 212 single operation regardless of the current value (figure-of-merit). 213 As a performance optimization, the decay can be applied in fixed time 214 increments. Given a desired decay half life, the decay for a single 215 time increment can be computed ahead of time. The decay for multiple 216 time increments is expressed below. 218 f(figure-of-merit, n*t0) = f(figure-of-merit, t0)**n = K**n 220 The values of K ** n can be precomputed for a reasonable number of 221 ``n'' and stored in an array. The value of ``K'' is always less than 222 one. The array size can be bounded since the value quickly approaches 223 zero. This makes the decay easy to compute using an array bound 224 check, an array lookup and a single multiply regardless as to how much 225 time has elapsed. 227 3 Limiting Route Advertisements using Fixed Timers 229 This method of limiting route advertisements involves the use of fixed 230 timers applied to the process of sending routes. It's primary purpose 231 is to improve the packing of routes in BGP update messages. The delay 232 in advertising a stable route should be bounded and minimal. The 233 delay in advertising an unreachable need not be zero, but should also 234 be bounded and should probably have a separate bound set less than or 235 equal to the bound for a reachable advertisement. 237 Routes that need to be readvertised can be marked in the RIB or an 238 external set of structures maintained, which references the RIB. 239 Periodically, a subset of the marked routes can be flushed. This is 240 fairly straightforward and accomplishes the objectives. Computation 241 for too simple an implementation may be order N squared. To avoid N 242 squared performance, some form of data structure is needed to group 243 routes with common attributes. 245 An implementation should pack updates efficiently, provide a minimum 246 readvertisement delay, provide a bounds on the maximum readvertisement 247 delay that would be experienced solely as a result of the algorithm 248 used to provide a minimum delay, and must be computationally efficient 249 in the presence of a very large number of candidates for 250 readvertisement. 252 4 Stability Sensitive Suppression of Route Advertisement 254 This method of limiting route advertisements uses a measure of route 255 stability applied on a per route basis. This technique is applied 256 when receiving updates from external peers only (EBGP). Applying this 257 technique to IBGP learned routes or to advertisement to IBGP or EBGP 258 peers after making a route selection can result in routing loops. 260 A figure of merit based on a measure of instability is maintained on a 261 per route basis. This figure of merit is used in the decision to 262 suppress the use of the route. Routes with high figure of merit are 263 suppressed. Each time a route is withdrawn, the figure of merit is 264 incremented. While the route is not changing the figure of merit 265 value is decayed exponentially with separate decay rates depending on 266 whether the route is stable and reachable or has been stable and 267 unreachable. The decay rate may be slower when the route is unreach- 268 able, or the stability figure of merit could remain fixed (not decay 269 at all) while the route remains unreachable. Whether to decay un- 270 reachable routes at the same rate, a slower rate, or not at all is an im- 271 plementation choice. Decaying at a slower rate is recommended. 273 A very efficient implementation is suggested in the following 274 sections. The implementation only requires computation for the routes 275 contained in an update, when an update is received or withdrawn (as 276 opposed to the simplistic approach of periodically decaying each 277 route). The suggested implementation involves only a small number of 278 simple operations, and can be implemented using scaled integers. 280 The behavior of unstable routes is fairly predictable. Severely 281 flapping routes will often be advertised and withdrawn at regular time 282 intervals corresponding to the timers of a particular protocol (the 283 IGP or exterior protocol in use where the problem exists). Marginal 284 circuits or mild congestion can result in a long term pattern of 285 occasional brief route withdrawal or occasional brief connectivity. 287 4.1 Single vs. Multiple Configuration Parameter Sets 289 The behavior of the algorithm is modified by a number of configurable 290 parameters. It is possible to configure separate sets of parameters 291 designed to handle short term severe route flap and chronic milder 292 route flap (a pattern of occasional drops over a long time period). 293 The former would require a fast decay and low threshold (allowing a 294 small number of consecutive flaps to cause a route to be suppressed, 295 but allowing it to be reused after a relatively short period of 296 stability). The latter would require a very slow decay and a higher 297 threshold and might be appropriate for routes for which there was an 298 alternate path of similar bandwidth. 300 It may also be desirable to configure different thresholds for routes 301 with roughly equivalent alternate paths than for routes where the 302 alternate paths have a lower bandwidth or tend to be congested. This 303 can be solved by associating a different set of parameters with 304 different ranges of preference values. Parameter selection could be 305 based on BGP LOCAL_PREF. 307 Parameter selection could also be based on whether an alternate route 308 was known. A route would be considered if, for any applicable 309 parameter set, an alternate route with the specified preference value 310 existed and the figure of merit associated with the parameter set did 311 not indicate a need to suppress the route. A less aggressive 312 suppression would be applied to the case where no alternate route at 313 all existed. In the simplest case, a more aggressive suppression 314 would be applied if any alternate route existed. Only the highest 315 preference (most preferred) value needs to be specified, since the 316 ranges may overlap. 318 It might also be desirable to configure a different set of thresholds 319 for routes which rely on switched services and may disconnect at times 320 to reduce connect charges. Such routes might be expected to change 321 state somewhat more often, but should be suppressed if continuous 322 state changes indicate instability. 324 While not essential, it might be desirable to be able to configure 325 multiple sets of configuration parameters per route. It may also be 326 desirable to be able to configure sets of parameters that only 327 correspond to a set of routes (identified by AS path, peer router, 328 specific destinations or other means). Experience may dictate how 329 much flexibility is needed and how to best to set the parameters. 330 Whether to allow different damping parameter sets for different 331 routes, and whether to allow multiple figures of merit per route is an 332 implementation choice. 334 Parameter selection can also be based on prefix length. The rationale 335 is that longer prefixes tend to reach less end systems and are less 336 important and these less important prefixes can be damped more 337 aggressively. This technique is in fairly widespread use. Small 338 sites or those with dense address allocation who are multihomed are 339 often reachable by long prefixes which are not easily aggregated. 340 These sites tend to dispute the choice of prefix length for parameter 341 selection. Advocates of the technique point out that it encourages 342 better aggregation. 344 4.2 Configuration Parameters 346 At configuration time, a number of parameters may be specified by the 347 user. The configuration parameters are expressed in units meaningful 348 to the user. These differ from the parameters used at run time which 349 are in unit convenient for computation. The run time parameters are 350 derived from the configuration parameters. Suggested configuration 351 parameters are listed below. 353 cutoff threshold (cut) 355 This value is expressed as a number of route withdrawals. It is 356 the value above which a route advertisement will be suppressed. 358 reuse threshold (reuse) 360 This value is expressed as a number of route withdrawals. It is 361 the value below which a suppressed route will now be used again. 363 maximum hold down time (T-hold) 365 This value is the maximum time a route can be suppressed no matter 366 how unstable it has been prior to this period of stability. 368 decay half life while reachable (decay-ok) 370 This value is the time duration in minutes or seconds during which 371 the accumulated stability figure of merit will be reduced by half 372 if the route if considered reachable (whether suppressed or not). 374 decay half life while unreachable (decay-ng) 376 This value is the time duration in minutes or seconds during which 377 the accumulated stability figure of merit will be reduced by half 378 if the route if considered unreachable. If not specified or set to 379 zero, no decay will occur while a route remains unreachable. 381 decay memory limit (Tmax-ok or Tmax-ng) 383 This is the maximum time that any memory of previous instability 384 will be retained given that the route's state remains unchanged, 385 whether reachable or unreachable. This parameter is generally used 386 to determine array sizes. 388 There may be multiple sets of the parameters above as described in 389 Section 4.1. The configuration parameters listed below would be 390 applied system wide. These include the time granularity of all 391 computations, and the parameters used to control reevaluation of 392 routes that have previously been suppressed. 394 time granularity (delta-t) 396 This is the time granularity in seconds used to perform all decay 397 computations. 399 reuse list time granularity (delta-reuse) 401 This is the time interval between evaluations of the reuse lists. 402 Each reuse lists corresponds to an additional time increment. 404 reuse list memory reuse-list-max 406 This is the time value corresponding to the last reuse list. This 407 may be the maximum value of T-hold for all parameter sets of may be 408 configured. 410 number of reuse lists (reuse-list-size) 412 This is the number of reuse lists. It may be determined from 413 reuse-list-max or set explicitly. 415 A necessary optimization is described in Section 4.8.6 that involves 416 an array referred to as the ``reuse index array''. A reuse index 417 array is needed for each decay rate in use. The reuse index array is 418 used to estimate which reuse list to place a route when it is 419 suppressed. Proper placement avoids the need to periodically evaluate 420 decay to determine if a route can be reused. Using the reuse index 421 array avoids the need to compute a logarithm to determine placement. 422 One additional system wide parameter can be introduced. 424 reuse index array size (reuse-index-array-size) 426 This is the size of reuse index arrays. This size determines the 427 accuracy with which suppressed routes can be placed within the set 428 of reuse lists when suppressed for a long time. 430 4.3 Guidelines for Setting Parameters 432 The decay half life should be set to a time considerably longer than 433 the period of the route flap it is intended to address. For example, 434 if the decay is set to ten minutes and a route is withdrawn and 435 readvertised exactly every ten minutes, the route would continue to 436 flap if the cutoff was set to a value of 2 or above. 438 The stability figure of merit itself is an accumulated time decayed 439 total. This must be kept in mind in setting the decay time, cutoff 440 values and reuse values. For example, if a route flaps at four times 441 the decay rate, it will reach 3 in 4 cycles, 4 in 6 cycles, 5 in 10 442 cycles, and will converge at about 6.3. At twice the decay time, it 443 will reach 3 in 7 cycles, and converge at a value of less than 3.5. 445 Figure 1 shows the stability figure of merit for route flap at a 446 constant rate. The time axis is labeled in multiples of the decay 447 half life. The plots represent route flap with a period of 1/2, 1/3, 448 1/4, and 1/8 times the decay half life. A ceiling of 4.5 was set, 449 which can be seen to affect three of the plots, effectively limiting 450 the time it takes to readvertise the route regardless of the prior 451 history. With the cutoff and reuse thresholds suggested by the dotted 452 lines, routes would be suppressed after being declared unreachable 2-3 453 times and be used again after approximately 2 decay half life periods 454 of stability. 456 From either maximum hold time value (Tmax-ok or Tmax-ng), a ratio of 457 the cutoff to a ceiling can be determined. An integer value for the 458 ceiling can then be chosen such that overflow will not be a problem 459 and all other values can be scaled accordingly. If both cutoffs are 460 specified or if multiple parameter sets are used the highest ceiling 461 will be used. 463 time figure-of-merit as a function of time 465 0.00 0.000 . 0.000 . 0.000 . 0.000 . 466 0.08 0.000 . 0.000 . 0.000 . 0.000 . 467 0.16 0.000 . 0.000 . 0.000 . 0.973 . 468 0.24 0.000 . 0.000 . 0.000 . 0.920 . 469 0.32 0.000 . 0.000 . 0.946 . 1.817 . 470 0.40 0.000 . 0.953 . 0.895 . 2.698 . 471 0.48 0.000 . 0.901 . 0.847 . 2.552 . 472 0.56 0.953 . 0.853 . 1.754 . 3.367 . 473 0.64 0.901 . 0.807 . 1.659 . 4.172 . 474 0.72 0.853 . 1.722 . 1.570 . 3.947 . 475 0.80 0.807 . 1.629 . 2.444 . 4.317 . 476 0.88 0.763 . 1.542 . 2.312 . 4.469 . 477 0.96 0.722 . 1.458 . 2.188 . 4.228 . 478 1.04 1.649 . 2.346 . 3.036 . 4.347 . 479 1.12 1.560 . 2.219 . 2.872 . 4.112 . 480 1.20 1.476 . 2.099 . 2.717 . 4.257 . 481 1.28 1.396 . 1.986 . 3.543 . 4.377 . 482 1.36 1.321 . 2.858 . 3.352 . 4.141 . 483 1.44 1.250 . 2.704 . 3.171 . 4.287 . 484 1.52 2.162 . 2.558 . 3.979 . 4.407 . 485 1.60 2.045 . 2.420 . 3.765 . 4.170 . 486 1.68 1.935 . 3.276 . 3.562 . 4.317 . 487 1.76 1.830 . 3.099 . 4.356 . 4.438 . 488 1.84 1.732 . 2.932 . 4.121 . 4.199 . 489 1.92 1.638 . 2.774 . 3.899 . 3.972 . 490 2.00 1.550 . 2.624 . 3.688 . 3.758 . 491 2.08 1.466 . 2.483 . 3.489 . 3.555 . 492 2.16 1.387 . 2.349 . 3.301 . 3.363 . 493 2.24 1.312 . 2.222 . 3.123 . 3.182 . 494 2.32 1.242 . 2.102 . 2.955 . 3.010 . 495 2.40 1.175 . 1.989 . 2.795 . 2.848 . 496 2.48 1.111 . 1.882 . 2.644 . 2.694 . 497 2.56 1.051 . 1.780 . 2.502 . 2.549 . 498 2.64 0.995 . 1.684 . 2.367 . 2.411 . 499 2.72 0.941 . 1.593 . 2.239 . 2.281 . 500 2.80 0.890 . 1.507 . 2.118 . 2.158 . 501 2.88 0.842 . 1.426 . 2.004 . 2.042 . 502 2.96 0.797 . 1.349 . 1.896 . 1.932 . 503 3.04 0.754 . 1.276 . 1.794 . 1.828 . 504 3.12 0.713 . 1.207 . 1.697 . 1.729 . 505 3.20 0.675 . 1.142 . 1.605 . 1.636 . 506 3.28 0.638 . 1.081 . 1.519 . 1.547 . 507 3.36 0.604 . 1.022 . 1.437 . 1.464 . 508 3.44 0.571 . 0.967 . 1.359 . 1.385 . 510 Figure 1: Instability figure of merit for flap at a constant rate 511 time figure-of-merit as a function of time 513 0.00 0.000 . 0.000 . 0.000 . 514 0.20 0.000 . 0.000 . 0.000 . 515 0.40 0.000 . 0.000 . 0.000 . 516 0.60 0.000 . 0.000 . 0.000 . 517 0.80 0.000 . 0.000 . 0.000 . 518 1.00 0.999 . 0.999 . 0.999 . 519 1.20 0.971 . 0.971 . 0.929 . 520 1.40 0.945 . 0.945 . 0.809 . 521 1.60 0.919 . 0.865 . 0.704 . 522 1.80 0.894 . 0.753 . 0.613 . 523 2.00 1.812 . 1.657 . 1.535 . 524 2.20 1.762 . 1.612 . 1.428 . 525 2.40 1.714 . 1.568 . 1.244 . 526 2.60 1.667 . 1.443 . 1.083 . 527 2.80 1.622 . 1.256 . 0.942 . 528 3.00 1.468 . 1.094 . 0.820 . 529 3.20 2.400 . 2.036 . 1.694 . 530 3.40 2.335 . 1.981 . 1.475 . 531 3.60 2.271 . 1.823 . 1.284 . 532 3.80 2.209 . 1.587 . 1.118 . 533 4.00 1.999 . 1.381 . 0.973 . 534 4.20 2.625 . 2.084 . 1.727 . 535 4.40 2.285 . 1.815 . 1.503 . 536 4.60 1.990 . 1.580 . 1.309 . 537 4.80 1.732 . 1.375 . 1.139 . 538 5.00 1.508 . 1.197 . 0.992 . 539 5.20 1.313 . 1.042 . 0.864 . 540 5.40 1.143 . 0.907 . 0.752 . 541 5.60 0.995 . 0.790 . 0.654 . 542 5.80 0.866 . 0.688 . 0.570 . 543 6.00 0.754 . 0.599 . 0.496 . 544 6.20 0.656 . 0.521 . 0.432 . 545 6.40 0.571 . 0.454 . 0.376 . 546 6.60 0.497 . 0.395 . 0.327 . 547 6.80 0.433 . 0.344 . 0.285 . 548 7.00 0.377 . 0.299 . 0.248 . 549 7.20 0.328 . 0.261 . 0.216 . 550 7.40 0.286 . 0.227 . 0.188 . 551 7.60 0.249 . 0.197 . 0.164 . 552 7.80 0.216 . 0.172 . 0.142 . 553 8.00 0.188 . 0.150 . 0.124 . 555 Figure 2: Separate decay constants when unreachable 557 Figure 2 show the effect of configuring separate decay rates to be 558 used when the route is reachable or unreachable. The decay rate is 559 5 times slower when the route is unreachable. In the three case 560 shown, the period of the route flap is equal to the decay half life 561 but the route is reachable 1/8 of the time in one, reachable 1/2 the 562 time in one, and reachable 7/8 of the time in the other. In the last 563 case the route is not suppressed until after the third unreachable 564 (when it is above the top threshold after becoming reachable again). 566 In both Figure 1 and Figure 2, routes would be suppressed. Routes 567 flapping at the decay half life or less would be withdrawn two or 568 three times and then remain withdrawn until they had remained stably 569 announced and stable for on the order of 1 1/2 to 2 1/2 times the 570 decay half life (given the ceiling in the example). 572 A larger time granularity will keep table storage down. The time 573 granularity should be less than a minimal reasonable time between 574 expected worse case route flaps. It might be reasonable to fix this 575 parameter at compile time or set a default and strongly recommend that 576 the user leave it alone. With an exponential decay, array size can be 577 greatly reduced by setting a period of complete stability after which 578 the decayed total will be considered zero rather than retaining a tiny 579 quantity. Alternately, very long decays can be implemented by 580 multiplying more than once if array bounds are exceeded. 582 The reuse lists hold suppressed routes grouped according to how long 583 it will be before the routes are eligible for reuse. Periodically 584 each list will be advanced by one position and one list removed as de- 585 scribed in Section 4.8.7. All of the suppressed routes in the removed 586 list will be reevaluated and either used or placed in another list 587 according to how much additional time must elapse before the route can 588 be reused. The last list will always contain all the routes which 589 will not be advertised for more time than is appropriate for the re- 590 maining list heads. When the last list advances to the front, some of 591 the routes will not be ready to be used and will have to be requeued. 592 The time interval for reconsidering suppressed routes and number of list 593 heads should be configurable. Reasonable defaults might be 30 seconds and 594 64 list heads. A route suppressed for a long time would need to be reeval- 595 uated every 32 minutes. 597 4.4 Run Time Data Structures 599 A fixed small amount of per system storage will be required. Where 600 sets of multiple configuration parameters are used, storage will be 601 required per set of parameters. A small amount of per route storage 602 is required. A set of list heads is needed. These list heads are 603 used to arrange suppressed routes according to the time remaining 604 until they can be reused. 606 If multiple sets of configuration parameters are allowed per route, 607 there is a need for some means of associating more than one figure of 608 merit and set of parameters with each route. Building a linked list 609 of these objects seems like one of a number of reasonable 610 implementations. Similarly, a means of associating a route to a reuse 611 list is required. A small overhead will be required for the pointers 612 needed to implement whatever data structure is chosen for the reuse 613 lists. The suggested implementation uses a double linked lists and so 614 requires two pointers per figure of merit. 616 Each set of configuration parameters can reference decay arrays and 617 reuse arrays. These arrays should be shared among multiple sets of 618 parameters since their storage requirement is not negligible. There 619 will be only one set of reuse list heads for the entire router. 621 4.4.1 Data Structures for Configuration Parameter Sets 623 Based on the configuration parameters described in the previous 624 section, the following values can be computed as scaled integers 625 directly from the corresponding configuration parameters. 627 o decay array scale factor (decay-array-scale-factor) 629 o cutoff value (cut) 631 o reuse value (reuse) 633 o figure of merit ceiling (ceiling) 635 Each configuration parameter set will reference one or two decay 636 arrays and one or two reuse arrays. Only one array will be needed if 637 the decay rate is the same while a route is unreachable as while it is 638 reachable, or if the stability figure of merit does not decay while a 639 route is unreachable. 641 4.4.2 Data Structures per Decay Array and Reuse Index Array 643 The following are also computed from the configuration parameters 644 though not as directly. 646 o decay rate per tick (decay-delta-t) 648 o decay array size (decay-array-size) 649 o decay array (decay) 651 o reuse index array size (reuse-index-array-size) 653 o reuse index array (reuse-index-array) 655 For each decay rate specified, an array will be used to store the 656 value of a computed parameter raised to the power of the index of each 657 array element. This is to speed computations. The decay rate per 658 tick is an intermediate value expressed as a real number and used to 659 compute the values stored in the decay arrays. The array size is 660 computed from the decay memory limit configuration parameter expressed 661 as an array size or as a maximum hold time. 663 The decay array size must be of sufficient size to accommodate the 664 specified decay memory given the time granularity, or sufficient to 665 hold the number of array elements until integer rounding produces a 666 zero result if that value is smaller, or a implementation imposed 667 reasonable size to prevent configurations which use excessive memory. 668 Implementations may chose to make the array size shorter and multiply 669 more than once when decaying a long time interval to reduce storage. 671 The reuse index arrays serve a similar purpose to the decay arrays. 672 The amount of time until a route can be reused can be determined using 673 a array lookup. The array can be built given the decay rate. The 674 array is indexed using a scaled integer proportional to the ratio 675 between a current stability figure of merit value and the value needed 676 for the route to be reused. 678 4.4.3 Per Route State 680 Information must be maintained per some tuple representing a route. 681 At the very minimum, the NLRI (BGP prefix and length) must be 682 contained in the tuple. Different BGP attributes may be included or 683 excluded depending on the specific situation. The AS path should also 684 be contained in the tuple be default. The tuple may also optionally 685 contain other BGP attributes such as MULTI_EXIT_DISCRIMINATOR (MED). 687 The tuple representing a route for the purpose of route flap damping 688 is: 690 tuple entry default options 691 ------------------------------------------- 692 NLRI 693 prefix required 694 length required 696 AS path included option to exclude 697 last AS set in path excluded option to include 698 next hop excluded option to include 699 MED excluded option to include 700 in comparisons only 702 The AS path is generally included in order to identify downstream 703 instability which is not being damped or not being sufficiently damped 704 and is alternating between a stable and an unstable path. Under rare 705 circumstances it may be desirable to exclude AS path for all or a 706 subset of prefixes. If an AS path ends in an AS set, in practice the 707 path is always for an aggregate. Changes to the trailing AS set 708 should be ignored. Ideally the AS path comparison should insure that 709 at least one AS has remained constant in the old and new AS set, but 710 completely ignoring the contents of a trailing AS set is also 711 acceptable. 713 Including next hop and MED changes can help suppress the use of an AS 714 which is internally unstable or avoid a next hop which is closer to an 715 unstable IGP path in the adjacent AS. If a large number of MED values 716 are used, the increase in the amount of state may become a problem. 717 For this reason MED is disabled by default and enabled only as part of 718 the tuple comparison, using a single state entry regardless of MED 719 value. Including MED will suppress the use of the adjacent AS even 720 though the change need not be propagated further. Using MED is only a 721 safe practice if a path is known to exist through another AS or where 722 there are enough peering sites with the adjacent AS such that routes 723 heard at only a subset of the peering sites will be suppressed. 725 4.4.4 Data Structures per Route 727 The following information must be maintained per route. A route here 728 is considered to be a tuple usually containing NLRI, next hop, and AS 729 path as defined in Section 4.4.3. 731 stability figure of merit (figure-of-merit) 733 Each route must have a stability figure of merit per applicable 734 parameter set. 736 last time updated (time-update) 738 The exact last time updated must be maintained to allow exponential 739 decay of the accumulated figure of merit to be deferred until the 740 route might reasonable be considered eligible for a change in 741 status (having gone from unreachable to reachable or advancing 742 within the reuse lists). 744 config block pointer 746 Any implementation that supports multiple parameter sets must 747 provide a means of quickly identifying which set of parameters 748 corresponds to the route currently being considered. For 749 implementations supporting only parameter sets where all routes 750 must be treated the same, this pointer is not required. 752 reuse list traversal pointers 754 If doubly linked lists are used to implement reuse lists, then two 755 pointers will be needed, previous and next. Generally there is a 756 double linked list which is unused when a route is suppressed from 757 use that can be used for reuse list traversal eliminating the need 758 for additional pointer storage. 760 4.5 Processing Configuration Parameters 762 From the configuration parameters, it is possible to precompute a 763 number of values that will be used repeatedly and retain these to 764 speed later computations that will be required frequently. 766 The methods of scaled integer arithmetic are not described in detail 767 here. The methods of determining the real values are given. 768 Translation into scaled integer values and the details of scaled 769 integer arithmetic are left up to the individual implementations. 771 figure of merit scale factor ( scale-figure-of-merit ) 773 The ceiling value can be set to be the largest integer that can fit 774 in half the bits available for an unsigned integer. This will 775 allow the scaled integers to be multiplied by the scaled decay 776 value and then shifted down. Implementations may prefer to use 777 real numbers or may use any integer scaling deemed appropriate for 778 their architecture. 780 penalty value and thresholds (as proportional scaled integers) 782 The figure of merit penalty for one route withdrawal and the cutoff 783 values must be scaled according to the above scaling factor. 785 decay rate per tick (decay[1]) 787 The decay value per increment of time as defined by the time 788 granularity must be determined (at least initially as a floating 789 point number). The per tick decay is a number slightly less than 790 one. It is the Nth root of the one half where N is the half life 791 divided by the time granularity. 793 decay[1] = exp ((1 / (decay-rate/delta-t)) * log (1/2)) 795 decay array size (decay-array-size) 797 The decay array size is the decay memory divided by the time 798 granularity. If integer truncation brings the value of an array 799 element to zero, the array can be made smaller. An implementation 800 should also impose a maximum reasonable array size or allow more 801 than one multiplication. 803 decay-array-size = (Tmax/delta-t) 805 decay array (decay[]) 807 Each i-th element of the decay array is the per tick delay raised 808 to the i-th power. This might be best done by successive floating 809 point multiplies followed by scaling and integer rounding or 810 truncation. The array itself need only be computed at startup. 812 decay[i] = decay[1] ** i 814 4.6 Building the Reuse Index Arrays 816 The reuse lists may be accessed quite frequently if a lot of routes 817 are flapping sufficiently to be suppressed. A method of speeding the 818 determination of which reuse list to use for a given route is 819 suggested. This method is introduced in Section 4.2, its 820 configuration described in Section 4.4.2 and the algorithms described 821 in Section 4.8.6 and Section 4.8.7. This section describes building 822 the reuse list index arrays. 824 A ratio of the figure of merit of the route under consideration to the 825 cutoff value is used as the basis for an array lookup. The ratio is 826 scaled and truncated to an integer and used to index the array. The 827 array entry is an integer used to determine which reuse list to use. 829 reuse array maximum ratio (max-ratio) 831 This is the maximum ratio between the current value of the 832 stability figure of merit and the target reuse value that can be 833 indexed by the reuse array. It may be limited by the ceiling 834 imposed by the maximum hold time or by the amount of time that the 835 reuse lists cover. 837 max-ratio = min(ceiling/reuse, exp((1 / 838 (half-life/reuse-array-time)) * log(1/2))) 840 reuse array scale factor ( scale-factor ) 842 Since the reuse array is an estimator, the reuse array scale factor 843 has to be computed such that the full size of the reuse array is 844 used. 846 scale-factor = (max-ratio - 1) / reuse-array-size 848 reuse index array (reuse) 850 Each reuse index array entry should contain an index into the reuse 851 list array pointing to one of the list heads. This index should 852 corresponding to the reuse list that will be evaluated just after a 853 route would be eligible for reuse given the ratio of current value 854 of the stability figure of merit to target reuse value 855 corresponding the the reuse array entry. 857 reuse-array[j] = integer(log(1 / (1 + ((j+1) * 858 (max-ratio-1)))) / reuse-time-granularity) 860 To determine which reuse queue to place a route which is being 861 suppressed, the following procedure is used. Divide the current 862 figure of merit by the cutoff. Subtract one. Multiply by the scale 863 factor. This is the array index. If it is off the end of the array 864 use the last queue otherwise look in the array and pick the number of 865 the queue from the array at that index. This is quite fast and well 866 worth the setup and storage required. 868 4.7 A Sample Configuration 870 A simple example is presented here in which the space overhead is 871 estimated for a set of configuration parameters. The design here 872 assumes: 874 1. there is a single parameter set used for all routes, 876 2. decay time for unreachable routes is slower than for reachable 877 routes 879 3. the arrays must be full size, rather than allow more than one 880 multiply per decay operation to reduce the array size. 882 This example is used in later sections. The use of multiple parameter 883 sets complicates the examples somewhat. Where multiple parameter sets 884 are allowed for a single route, the decay portion of the algorithm is 885 repeated for each parameter set. If different routes are allowed to 886 have different parameter sets, the routes must have pointers to the 887 parameter sets to keep the time to locate to a minimum, but the 888 algorithms are otherwise unchanged. 890 A sample set of configuration parameters and a sample set of 891 implementation parameters are provided in in the two following lists. 893 1. Configuration Parameters 895 o cut = 1.25 897 o reuse = 0.5 899 o T-hold = 15 mins 901 o decay-ok = 5 min 903 o decay-ng = 15 min 905 o Tmax-ok, Tmax-ng = 15, 30 mins 907 2. Implementation Parameters 909 o delta-t = 1 sec 911 o delta-reuse 913 o reuse-list-size = 256 915 o reuse-index-array-size = 1,024 917 Using these configuration and implementation parameters and the 918 equations in Section 4.5, the space overhead can be computed. There 919 is a fixed space overhead that is independent of the number of routes. 920 There is a space requirement associated with a stable route. There is 921 a larger space requirement associated with an unstable route. The 922 space requirements for the parameters above are provide in the lists 923 below. 925 1. fixed overhead (using parameters from previous example) 927 o 900 * integer - decay array 929 o 1,800 * integer - decay array 931 o 120 * pointer - reuse list-heads 933 o 2,048 * integer - reuse index arrays 935 2. overhead per stable route 937 o pointer - containing null entry 939 3. overhead per unstable route 941 o pointer - to a damping structure containing the following 943 o integer - figure of merit + bit for state 945 o integer - last time updated 947 o pointer (optional) to configuration parameter block 949 o 2 * pointer - reuse list pointers (prev, next) 951 Figure 3 shows the behavior of the algorithm with the parameters given 952 above. Four cases are given in this example. In all four, there is a 953 twelve minute period of route oscillations. Two periods of oscilla- 954 tion are used, 2 minutes and 4 minutes. Two duty cycles are used, one 955 in which the route is reachable during 20% of the cycle and the other 956 where the route is reachable during 80% of the cycle. In all four 957 cases, the route becomes suppressed after it becomes unreachable the 958 second time. Once suppressed, it remains suppressed until some period 959 after becoming stable. The routes which oscillate over a 4 minute pe- 960 riod are no longer suppressed within 9-11 minutes after becoming sta- 961 ble. The routes with a 2 minute period of oscillation are suppressed for 962 nearly the maximum 15 minute period after becoming stable. 964 time figure-of-merit as a function of time 966 0.00 0.000 . 0.000 . 0.000 . 0.000 . 967 0.62 0.000 . 0.000 . 0.000 . 0.000 . 968 1.25 0.000 . 0.000 . 0.000 . 0.000 . 969 1.88 0.000 . 0.000 . 0.000 . 0.000 . 970 2.50 0.977 . 0.968 . 0.000 . 0.000 . 971 3.12 0.949 . 0.888 . 0.000 . 0.000 . 972 3.75 0.910 . 0.814 . 0.000 . 0.000 . 973 4.37 1.846 . 1.756 . 0.983 . 0.983 . 974 5.00 1.794 . 1.614 . 0.955 . 0.935 . 975 5.63 1.735 . 1.480 . 0.928 . 0.858 . 976 6.25 2.619 . 2.379 . 0.901 . 0.786 . 977 6.88 2.544 . 2.207 . 0.876 . 0.721 . 978 7.50 2.472 . 2.024 . 0.825 . 0.661 . 979 8.13 3.308 . 2.875 . 1.761 . 1.608 . 980 8.75 3.213 . 2.698 . 1.711 . 1.562 . 981 9.38 3.122 . 2.474 . 1.662 . 1.436 . 982 10.00 3.922 . 3.273 . 1.615 . 1.317 . 983 10.63 3.810 . 3.107 . 1.569 . 1.207 . 984 11.25 3.702 . 2.849 . 1.513 . 1.107 . 985 11.88 3.498 . 2.613 . 1.388 . 1.015 . 986 12.50 3.904 . 3.451 . 2.312 . 1.953 . 987 13.13 3.580 . 3.164 . 2.120 . 1.791 . 988 13.75 3.283 . 2.902 . 1.944 . 1.643 . 989 14.38 3.010 . 2.661 . 1.783 . 1.506 . 990 15.00 2.761 . 2.440 . 1.635 . 1.381 . 991 15.63 2.532 . 2.238 . 1.499 . 1.267 . 992 16.25 2.321 . 2.052 . 1.375 . 1.161 . 993 16.88 2.129 . 1.882 . 1.261 . 1.065 . 994 17.50 1.952 . 1.725 . 1.156 . 0.977 . 995 18.12 1.790 . 1.582 . 1.060 . 0.896 . 996 18.75 1.641 . 1.451 . 0.972 . 0.821 . 997 19.38 1.505 . 1.331 . 0.891 . 0.753 . 998 20.00 1.380 . 1.220 . 0.817 . 0.691 . 999 20.62 1.266 . 1.119 . 0.750 . 0.633 . 1000 21.25 1.161 . 1.026 . 0.687 . 0.581 . 1001 21.87 1.064 . 0.941 . 0.630 . 0.533 . 1002 22.50 0.976 . 0.863 . 0.578 . 0.488 . 1003 23.12 0.895 . 0.791 . 0.530 . 0.448 . 1004 23.75 0.821 . 0.725 . 0.486 . 0.411 . 1005 24.37 0.753 . 0.665 . 0.446 . 0.377 . 1006 25.00 0.690 . 0.610 . 0.409 . 0.345 . 1008 Figure 3: Some fairly long route flap cycles, repeated for 12 1009 minutes, followed by a period of stability. 1011 4.8 Processing Routing Protocol Activity 1013 The prior sections concentrate on configuration parameters and their 1014 relationship to the parameters and arrays used at run time and provide 1015 the algorithms for initializing run time storage. This section 1016 provides the steps taken in processing routing events and timer events 1017 when running. 1019 The routing events are: 1021 1. A BGP peer or new route comes up for the first time (or after an 1022 extended down time) (Section 4.8.1) 1024 2. A route becomes unreachable (Section 4.8.2) 1026 3. A route becomes reachable again (Section 4.8.3) 1028 4. A route changes (Section 4.8.4) 1030 5. A peer goes down (Section 4.8.5) 1032 The reuse list is used to provide a means of fast evaluation of route 1033 that had been suppressed, but had been stable long enough to be reused 1034 again or had been suppressed long enough that it can be treated as a 1035 new route. The following two operations are described. 1037 1. Inserting into a reuse list (Section 4.8.6) 1039 2. Reuse list processing every delta-t seconds (Section 4.8.7) 1041 4.8.1 Processing a New Peer or New Routes 1043 When a peer comes up, no action is required if the routes had no 1044 previous history of instability, for example if this is the first time 1045 the peer is coming up and announcing these routes. For each route, 1046 the pointer to the damping structure would be zeroed and route used. 1047 The same action is taken for a new route or a route that has been down 1048 long enough that the figure of merit reached zero and the damping 1049 structure was deleted. 1051 4.8.2 Processing Unreachable Messages 1053 When a route is withdrawn or changed (Section 4.8.4 describes how a 1054 change is handled), the following procedure is used. 1056 If there is no previous stability history (the damping structure 1057 pointer is zero), then: 1059 1. allocate a damping structure 1061 2. set figure-of-merit = 1 1063 3. withdraw the route 1065 Otherwise, if there is an existing damping structure, then: 1067 1. set t-diff = t-now - t-updated 1069 2. if ( t-diff puts you off the end of the array ) { 1071 set figure-of-merit = 1 1073 } else { 1075 set figure-of-merit = figure-of-merit * decay-array-ok [ t-diff ] + 1 1077 if ( figure-of-merit > ceiling ) { 1079 set figure-of-merit = ceiling 1081 } 1083 } 1085 3. remove the route from a reuse list if it is on one 1087 4. withdraw the route unless it is already suppressed 1089 In either case then: 1091 1. set t-updated = t-now 1093 2. insert into a reuse list (see Section 4.8.6) 1094 If there was a stability history, the previous value of the stability 1095 figure of merit is decayed. This is done using the decay array 1096 (decay-array). The index is determined by subtracting the current 1097 time and the last time updated, then dividing by the time granularity. 1098 If the index is zero, the figure of merit is unchanged (no decay). If 1099 it is greater than the array size, it is zeroed. Otherwise use the 1100 index to fetch a decay array element and multiply the figure of merit 1101 by the array element. If using the suggested scaled integer method, 1102 shift down half an integer. Add the scaled penalty for one more un- 1103 reachable (shown above as 1). If the result is above the ceiling re- 1104 place it with the ceiling value. Now update the last time updated field 1105 (preferably taking into account how much time was truncated before doing 1106 the decay calculation). 1108 When a route becomes unreachable, alternate paths must be considered. 1109 This process is complicated slightly if different configuration param- 1110 eters are used in the presence or absence of viable alternate paths. 1111 If all of these alternate paths have been suppressed because there had 1112 previously been an alternate route and the new route withdrawal 1113 changes that condition, the suppressed alternate paths must be reeval- 1114 uated. They should be reevaluated in order of normal route prefer- 1115 ence. When one of these alternate routes is encountered that had been 1116 suppressed but is now usable since there is no alternate route, no 1117 further routes need to be reevaluated. This only applies if routes 1118 are given two different reuse thresholds, one for use when there is an al- 1119 ternate path and a higher threshold to use when suppressing the route would 1120 result in making the destination completely unreachable. 1122 4.8.3 Processing Route Advertisements 1124 When a route is readvertised if there is no damping structure, then 1125 the procedure is the same as in Section 4.8.1. 1127 1. don't create a new damping structure 1129 2. use the route 1131 If an damping structure exists, the figure of merit is decayed and the 1132 figure of merit and last time updated fields are updated. A decision 1133 is now made as to whether the route can be used immediately or needs 1134 to be suppressed for some period of time. 1136 1. set t-diff = t-now - t-updated 1138 2. if ( t-diff puts you off the end of the array ) { 1139 set figure-of-merit = 0 1141 } else { 1143 set figure-of-merit = figure-of-merit * decay-array-ng [ t-diff ] 1145 } 1147 3. if ( not suppressed and figure-of-merit < cut ) { 1149 use the route 1151 } else if ( suppressed and figure-of-merit < reuse ) { 1153 set state to not suppressed 1155 remove the route from a reuse list 1157 use the route 1159 } else { 1161 set state to suppressed 1163 don't use the route 1165 insert into a reuse list (see Section 4.8.6) 1167 } 1169 4. if ( figure-of-merit > 0 ) { 1171 set t-updated= t-now 1173 } else { 1175 recover memory for damping struct 1177 zero pointer to damping struct 1179 } 1181 If the route is deemed usable, a search for the current best route 1182 must be made. The newly reachable route is then evaluated according 1183 to the BGP protocol rules for route selection. 1185 If the new route is usable, the previous best route is examined. 1186 Prior to route comparisons, the current best route may have to be 1187 reevaluated if separate parameter sets are used depending on the 1188 presence or absence of an alternate route. If there had been no 1189 alternate the previous best route may be suppressed. 1191 If the new route is to be suppressed it is placed on a reuse list only 1192 if it would have been preferred to the current best route had the new 1193 route been accepted as stable. There is no reason to queue a route on 1194 a reuse list if after the route becomes usable it would not be used 1195 anyway due to the existence of a more preferred route. Such a route 1196 would not have to be reevaluated unless the preferred route became 1197 unreachable. As specified here, the less preferred route would be 1198 reevaluated and potentially used or potentially added to a reuse list 1199 when processing the withdrawal of a more preferred best route. 1201 4.8.4 Processing Route Changes 1203 If a route is replaced by a peer router by supplying a new path, the 1204 route that is being replaced should be treated as if an unreachable 1205 were received (see Section 4.8.2). This will occur when a peer 1206 somewhere back in the AS path is continuously switching between two AS 1207 paths and that peer is not damping route flap (or applying less 1208 damping). There is no way to determine if one AS path is stable and 1209 the other is flapping, or if they are both flapping. If the cycle is 1210 sufficiently short compared to convergence times neither route through 1211 that peer will deliver packets very reliably. Since there is no way 1212 to affect the peer such that it chooses the stable of the two AS 1213 paths, the only viable option is to penalize both routes by considering 1214 each change as an unreachable followed by a route advertisement. 1216 4.8.5 Processing A Peer Router Loss 1218 When a peer routing session is broken, either all individual routes 1219 advertised by that peer may be marked as unstable, or the peering 1220 session itself may be marked as unstable. Marking the peer will save 1221 considerable memory. Since the individual routes are advertised as 1222 unreachable to routers beyond the immediate problem, per route state 1223 will be incurred beyond the peer immediately adjacent to the BGP 1224 session that went down. If the instability continues, the immediately 1225 adjacent router need only keep track of the peer stability history. 1226 The routers beyond that point will receive no further advertisements 1227 or withdrawal of routes and will dispose of the damping structure over 1228 time. 1230 BGP notification through an optional transitive attribute that damping 1231 will already be applied may be considered in the future to reduce the 1232 number of routers that incur damping structure storage overhead. 1234 4.8.6 Inserting into the Reuse Timer List 1236 The reuse lists are used to provide a means of fast evaluation of 1237 route that had been suppressed, but had been stable long enough to be 1238 reused again. The data structure consists of a series of list heads. 1239 Each list contains a set of routes that are scheduled for reevaluation 1240 at approximately the same time. The set of reuse list heads are 1241 treated as a circular array. 1243 A simple implementation of the circular array of list heads would be 1244 an array containing the list heads with an offset. The offset would 1245 identify the first list. The Nth list would be at the index 1246 corresponding to N plus the offset modulo the number of list heads. 1247 This design will be assumed in the examples that follow. 1249 A key requirement is to be able to insert an entry in the most 1250 appropriate queue with a minimum of computation. The computation is 1251 given only the current value of figure-of-merit. The array, scale, 1252 and bounds are precomputed to map figure-of-merit to the nearest list 1253 head without requiring a logarithm to be computed (see Section 4.5). 1255 1. scale figure-of-merit for the index array lookup producing index 1257 2. check index against the array bound 1259 3. if ( within the array bound ) { 1261 set index = reuse-array [ index ] 1263 } else { 1265 set index = reuse-list-size - 1 1267 } 1269 4. insert into the list 1271 reuse-list [ modulo reuse-list-size ( index + offset ) ] 1273 Choosing the correct reuse list involves only a multiply and shift to 1274 do the scaling, an integer truncation, then an array lookup. The most 1275 common method of implementing a circular array is to use an array and 1276 apply an offset and modulo operation to pick the correct array entry. 1277 The offset is incremented to rotate the the circular array. 1279 4.8.7 Handling Reuse Timer Events 1281 The granularity of the reuse timer should be more course that that of 1282 the decay timer. As a result, when the reuse timer fires, suppressed 1283 routes should be decayed by multiple increments of decay time. Some 1284 computation can be avoided by always inserting into the reuse list 1285 corresponding to one time increment past reuse eligibility. In cases 1286 where the reuse lists have a longer ``memory'' than the ``decay 1287 memory'' (described above), all of the routes in the first queue will 1288 be available for immediate reuse if reachable or the history entry 1289 could be disposed of if unreachable. 1291 When it is time to advance the lists, the first queue on the reuse 1292 list must be processed and the circular queue must be rotated. Using 1293 an array and an offset as a circular array (as described in 1294 Section 4.8.6), the algorithm below is repeated every t-reuse seconds. 1296 1. save a pointer to the current zeroth queue head and zero the list 1297 head entry 1299 2. set offset = modulo reuse-list-size ( offset + 1 ), thereby 1300 rotating the circular queue of list-heads 1302 3. if ( the saved list head pointer is non-empty ) 1304 foreach entry { 1306 set t-diff = t-now - t-updated 1308 set figure-of-merit = figure-of-merit * decay-array-ok [ t-diff ] 1310 set t-updated = t-now 1312 if ( figure-of-merit < reuse ) 1314 reuse the route 1316 else 1318 re-insert into another list (see Section 4.8.6) 1320 } 1322 The value of the zeroth list head would be saved and the array entry 1323 itself zeroed. The list heads would then be advanced by incrementing 1324 the offset. Starting with the saved head of the old zeroth list, each 1325 route would be reevaluated and used, disposed of entirely or requeued 1326 if it were not ready for reuse. If a route is used, it must be 1327 treated as if it were a new route advertisement as described in 1328 Section 4.8.3. 1330 5 Implementation Experience 1332 The first implementations of ``route flap damping'' were the route 1333 server daemon (rsd) coding by Ramesh Govindan (ISI) and the Cisco IOS 1334 implementation by Ravi Chandra. Both implementations first became 1335 available in 1995 and have been used extensively. The rsd 1336 implementation has been in use in route servers at the NSF funded 1337 Network Access Points (NAPs) and at other major Internet 1338 interconnects. The Cisco IOS version has been in use by Internet 1339 Service Providers worldwide. The rsd implementation has been 1340 integrated in releases of gated (see http://www.gated.org) and is 1341 available in commercial routers using gated. 1343 There are now more than 2 years of BGP route damping deployment 1344 experience. Some problems have occurred in deployment. So far these 1345 are solvable by careful implementation of the algorithm and by careful 1346 deployment. In some topologies coordinated deployment can be helpful 1347 and in all cases disclosure of the use of route damping and the param- 1348 eters used is highly beneficial in debugging connectivity problems. 1350 Some of the problems have occurred due to subtle implementation 1351 errors. Route damping should never be applied on IBGP learned routes. 1352 To do so can open the possibility for persistent route loops. 1353 Implementations should disallow this configuration. Penalties for 1354 flapping should only be applied when a route is removed or replaced 1355 and not when a route is added. If damping parameters are applied 1356 consistently, this implementation constraint will result in a stable 1357 secondary path being preferred over an unstable primary path due to 1358 damping of the primary path near the source. 1360 In topologies where multiple AS paths to a given destination exist 1361 flapping of the primary path can result in suppression of the 1362 secondary path. This can occur if no damping is being done near the 1363 cause of the route flap or if damping is being applied more 1364 aggressively by a distant AS. This problem can be solved in one of two 1365 ways. Damping can be done near the source of the route flap and the 1366 damping parameters can be made consistent. Alternately, a distant AS 1367 which insists on more aggressive damping parameters can disable 1368 penalizing routes on AS path change, penalizing routes only if they 1369 are withdrawn completely. In order to do so, the implementation must 1370 support this option (as described in Section 4.4.3). 1372 Route flap should be damped near the source. Single homed 1373 destinations can be covered by static routes. Aggregation provides 1374 another means of damping. Providers should damp their own internal 1375 problems, however damping on IGP link state origination is not yet 1376 implemented by router vendors. Providers which use multiple AS within 1377 their own topology should damp between their own AS. Providers should 1378 damp adjacent providers AS. 1380 Damping provides a means to limit propagation excessive route change 1381 when connectivity is highly intermittent. Once a problem is 1382 corrected, select damping state can be manually cleared. In order to 1383 determine where damping may have occurred after connectivity problems, 1384 providers should publish their damping parameters. Providers should 1385 be willing to manually clear damping on specific prefixes or AS paths 1386 at the request of other providers when the request is accompanied by 1387 assurance that the problem has truly been addressed. 1389 By damping their own routing information, providers can reduce their 1390 own need to make requests of other providers to clear damping state 1391 after correcting a problem. Providers should be pro-active and 1392 monitor what prefixes and paths are suppressed in addition to 1393 monitoring link states and BGP session state. 1395 Acknowledgements 1397 This work and this document may not have been completed without the 1398 advise, comments and encouragement of Yakov Rekhter (Cisco). Dennis 1399 Ferguson (MCI) provided a description of the algorithms in the gated 1400 BGP implementation and many valuable comments and insights. David 1401 Bolen (ANS) and Jordan Becker (ANS) provided valuable comments, 1402 particularly regarding early simulations. Over four years elapsed 1403 between the initial draft presented to the BGP WG (October 1993) and 1404 this iteration. At the time of this writing there is significant 1405 experience with two implementations, each having been deployed since 1406 1995. One was led by Ramesh Govindan (ISI) for the NSF Routing Ar- 1407 biter project. The second was led by Ravi Chandra (Cisco). Sean Doran 1408 (Sprintlink) and Serpil Bayraktar (ANS) were among the early independent 1409 testers of the Cisco pre-beta implementation. Valuable comments and im- 1410 plementation feedback were shared by many individuals on the IETF IDR WG 1411 and the RIPE Routing Work Group and in NANOG and IEPG. 1413 References 1415 [1] P. Gross and Y. Rekhter. Application of the border gateway proto- 1416 col in 1417 the internet. Request for Comments (Draft Standard) RFC 1268, In- 1418 ternet Engineering Task Force, October 1991. (Obsoletes RFC1164); 1419 (Obsoleted by RFC1655). ftp://ds.internic.net/rfc/rfc1268.txt. 1421 [2] ISO/IEC. Iso/iec 10747 - information technology - telecommunica- 1422 tions and information exchange between systems - protocol for 1423 exchange of inter-domain routeing information among intermediate 1424 systems to support forwarding of iso 1425 8473 pdus. Technical report, International Organization for Stan- 1426 dardization, August 1994. ftp://merit.edu/pub/iso/idrp.ps.gz. 1428 [3] K. Lougheed and Y. Rekhter. A border gateway protocol 3 (BGP-3). 1429 Request for Comments (Draft Standard) RFC 1267, In- 1430 ternet Engineering Task Force, October 1991. (Obsoletes RFC1163). 1431 ftp://ds.internic.net/rfc/rfc1267.txt. 1433 [4] Y. Rekhter and P. Gross. Application of the border gateway proto- 1434 col in the internet. Request for Comments (Draft Standard) 1435 RFC 1772, Internet Engineering Task Force, March 1995. (Obsoletes 1436 RFC1655). ftp://ds.internic.net/rfc/rfc1772.txt. 1437 [5] Y. Rekhter and T. Li. A border 1438 gateway protocol 4 (BGP-4). Request for Comments (Draft Standard) 1439 RFC 1771, Internet Engineering Task Force, March 1995. (Obsoletes 1440 RFC1654). ftp://ds.internic.net/rfc/rfc1771.txt. 1442 [6] Y. Rekhter and C. Topolcic. Exchanging routing information across 1443 provider boundaries in the CIDR environment. Request for Comments 1444 (Informational) RFC 1520, Internet Engineering Task Force, 1445 September 1993. ftp://ds.internic.net/rfc/rfc1520.txt. 1446 [7] P. Traina. BGP-4 protocol analysis. Request for Comments (Infor- 1447 mational) RFC 1774, Internet Engineering Task Force, March 1995. 1448 ftp://ds.internic.net/rfc/rfc1774.txt. 1450 [8] P. Traina. Experience with the BGP-4 protocol. Request for Com- 1451 ments (Informational) RFC 1773, 1452 Internet Engineering Task Force, March 1995. (Obsoletes RFC1656). 1453 ftp://ds.internic.net/rfc/rfc1773.txt. 1455 Security Considerations 1457 The practices outlined in this document do not further weaken the 1458 security of the routing protocols. Denial of service is possible in 1459 an already insecure routing environment but these practices only 1460 contribute to the persistence of such attacks and do not impact the 1461 methods of prevention and the methods of determining the source. 1463 Author's Addresses 1465 Curtis Villamizar 1466 ANS Communications 1467 1468 Ravi Chandra 1469 Cisco Systems 1470 1472 Ramesh Govindan 1473 ISI 1474