1 00:00:00,000 --> 00:00:03,840 [AUDIO LOGO] 2 00:00:03,840 --> 00:00:08,170 3 00:00:08,170 --> 00:00:10,870 So the first advanced feature that we want to look at 4 00:00:10,870 --> 00:00:13,630 is BGP route dampening. 5 00:00:13,630 --> 00:00:16,090 Now the idea behind route dampening 6 00:00:16,090 --> 00:00:18,910 is if we have a neighbor or a customer, 7 00:00:18,910 --> 00:00:23,920 maybe another service provider who's constantly advertising 8 00:00:23,920 --> 00:00:26,890 and retracting a route, this is going 9 00:00:26,890 --> 00:00:31,600 to cause a lot of convergence problems in our network, 10 00:00:31,600 --> 00:00:34,420 and possibly not even our network, possibly 11 00:00:34,420 --> 00:00:35,990 the entire internet. 12 00:00:35,990 --> 00:00:38,620 So the idea behind route dampening 13 00:00:38,620 --> 00:00:42,880 is if a route flaps too many times, 14 00:00:42,880 --> 00:00:45,340 and we'll see how the calculations are done 15 00:00:45,340 --> 00:00:49,750 and what we can adjust, but based on that routes history 16 00:00:49,750 --> 00:00:53,230 of flapping, we can then suppress that route, 17 00:00:53,230 --> 00:00:56,020 not advertise it to anybody else, 18 00:00:56,020 --> 00:00:59,380 well, until it becomes more well behaved. 19 00:00:59,380 --> 00:01:02,320 So that's the idea behind route dampening. 20 00:01:02,320 --> 00:01:05,379 Let's jump in and take a look at some of its details. 21 00:01:05,379 --> 00:01:08,140 And then, of course, we'll jump into the command line 22 00:01:08,140 --> 00:01:11,580 and actually take a look at how this works. 23 00:01:11,580 --> 00:01:14,450 So if we're going to talk about BGP route dampening 24 00:01:14,450 --> 00:01:18,170 and suppressing flapping routes, we probably 25 00:01:18,170 --> 00:01:21,480 need to start by defining exactly what that route 26 00:01:21,480 --> 00:01:23,360 flap actually is. 27 00:01:23,360 --> 00:01:27,240 And quite simply, it's a route, of course, 28 00:01:27,240 --> 00:01:33,020 that's being advertised and withdrawn several times 29 00:01:33,020 --> 00:01:35,550 in a short period of time. 30 00:01:35,550 --> 00:01:38,150 So when we talk about a short period of time, 31 00:01:38,150 --> 00:01:40,100 we're generally talking about this 32 00:01:40,100 --> 00:01:45,500 in the time frame of minutes to hours, not weeks or months. 33 00:01:45,500 --> 00:01:50,060 Now the reason I put a star up here on several times, 34 00:01:50,060 --> 00:01:51,505 this is adjustable. 35 00:01:51,505 --> 00:01:52,880 And that's what we're going to be 36 00:01:52,880 --> 00:01:56,550 looking at in this video, the things that we can adjust. 37 00:01:56,550 --> 00:01:58,850 And they will affect how quickly, 38 00:01:58,850 --> 00:02:02,630 how often these routes get suppressed. 39 00:02:02,630 --> 00:02:04,100 Now remember part of the reason we 40 00:02:04,100 --> 00:02:09,650 need this is that BGP was designed specifically to handle 41 00:02:09,650 --> 00:02:12,480 a large number of prefixes. 42 00:02:12,480 --> 00:02:15,200 Now the sort of side effects to that 43 00:02:15,200 --> 00:02:23,550 is this does entail sacrificing convergent speed for stability. 44 00:02:23,550 --> 00:02:25,430 So that means that our convergence isn't 45 00:02:25,430 --> 00:02:28,040 going to be that fast with BGP. 46 00:02:28,040 --> 00:02:30,320 Are there things we can do to speed it up? 47 00:02:30,320 --> 00:02:32,630 Yes, but then we have to start being 48 00:02:32,630 --> 00:02:34,370 concerned about resources. 49 00:02:34,370 --> 00:02:37,160 And we do have a video about that coming up here 50 00:02:37,160 --> 00:02:38,820 in a little bit. 51 00:02:38,820 --> 00:02:43,470 But to help address this issue of scalability and stability, 52 00:02:43,470 --> 00:02:46,100 there are several default timers, 53 00:02:46,100 --> 00:02:48,740 default features in BGP to support 54 00:02:48,740 --> 00:02:51,650 the goal of being stable. 55 00:02:51,650 --> 00:02:54,860 And route flap dampening, which is 56 00:02:54,860 --> 00:02:57,830 sort of the official name for what we're talking about 57 00:02:57,830 --> 00:03:00,150 is one of those features. 58 00:03:00,150 --> 00:03:03,950 So, what was trying to be achieved with BGP route 59 00:03:03,950 --> 00:03:04,910 dampening? 60 00:03:04,910 --> 00:03:07,350 Well the first thing was, of course, 61 00:03:07,350 --> 00:03:11,060 to reduce the router processing load. 62 00:03:11,060 --> 00:03:14,910 If we have huge BGP tables, this of course, 63 00:03:14,910 --> 00:03:18,620 is going to cause more CPU load on the devices. 64 00:03:18,620 --> 00:03:22,130 And every time they get advertised and withdrawn, 65 00:03:22,130 --> 00:03:24,750 we have to do it again. 66 00:03:24,750 --> 00:03:27,350 And while we're trying to protect the local router, 67 00:03:27,350 --> 00:03:30,320 we should also be trying to minimize these eBGP 68 00:03:30,320 --> 00:03:33,260 updates on the entire internet. 69 00:03:33,260 --> 00:03:35,845 As a service provider, we need to make sure 70 00:03:35,845 --> 00:03:37,220 that we don't have customers that 71 00:03:37,220 --> 00:03:40,550 are affecting other service providers, and so on. 72 00:03:40,550 --> 00:03:42,530 And of course, another big thing here 73 00:03:42,530 --> 00:03:47,930 is to not suppress routes that flap occasionally. 74 00:03:47,930 --> 00:03:51,080 Again, we're not talking about a customer that had a maintenance 75 00:03:51,080 --> 00:03:55,220 window and therefore their route got withdrawn and then 76 00:03:55,220 --> 00:03:57,080 re advertised to us. 77 00:03:57,080 --> 00:03:59,570 Maybe they even did it twice. 78 00:03:59,570 --> 00:04:03,620 They reconfigured a router, and that withdrew and re-advertised 79 00:04:03,620 --> 00:04:04,650 the prefix. 80 00:04:04,650 --> 00:04:07,100 And then they realized they had to reload that router, 81 00:04:07,100 --> 00:04:10,190 and that withdrew and re-advertised the prefix. 82 00:04:10,190 --> 00:04:12,390 That's not what we're talking about. 83 00:04:12,390 --> 00:04:16,100 We're talking about routes that have flapped numerous times. 84 00:04:16,100 --> 00:04:18,140 Generally speaking with default numbers 85 00:04:18,140 --> 00:04:21,890 we'll see in just a minute, it's three or more times just 86 00:04:21,890 --> 00:04:23,780 with default numbers. 87 00:04:23,780 --> 00:04:25,670 And of course, our biggest design goal 88 00:04:25,670 --> 00:04:31,400 here was to suppress routes that are likely to flap. 89 00:04:31,400 --> 00:04:32,690 How do we know? 90 00:04:32,690 --> 00:04:34,940 We're going to base this on their history. 91 00:04:34,940 --> 00:04:37,910 Again, it's flapped several times 92 00:04:37,910 --> 00:04:40,740 in a short period of time. 93 00:04:40,740 --> 00:04:43,260 That's what we're looking to suppress. 94 00:04:43,260 --> 00:04:44,990 So just sort of a design statement 95 00:04:44,990 --> 00:04:48,290 here that even with some of those default 96 00:04:48,290 --> 00:04:53,100 timers that we have in BGP, such as, for example, 97 00:04:53,100 --> 00:04:56,690 the advertisement interval, which by default 98 00:04:56,690 --> 00:05:01,370 limits updates, and this is only the eBGP peers by the way, 99 00:05:01,370 --> 00:05:06,570 but it limits them to only be sent every 30 seconds. 100 00:05:06,570 --> 00:05:12,200 So there is, again, some latency built into BGP on purpose 101 00:05:12,200 --> 00:05:15,710 to make sure that a route flapping every 5 seconds 102 00:05:15,710 --> 00:05:19,550 doesn't just go crazy in the BGP tables. 103 00:05:19,550 --> 00:05:23,960 But it's still a good idea to implement route dampening 104 00:05:23,960 --> 00:05:25,790 for more severe conditions. 105 00:05:25,790 --> 00:05:27,830 This 30 second delay is not going 106 00:05:27,830 --> 00:05:31,070 to help if our customer is withdrawing and advertising 107 00:05:31,070 --> 00:05:33,930 their route every five minutes. 108 00:05:33,930 --> 00:05:36,560 So this is just sort of solidifying that statement 109 00:05:36,560 --> 00:05:39,470 that, again, those timers do help, 110 00:05:39,470 --> 00:05:43,910 but it is still best to just remove or suppress 111 00:05:43,910 --> 00:05:47,990 that flapping route until it becomes stable. 112 00:05:47,990 --> 00:05:51,530 That's the whole goal behind route dampening. 113 00:05:51,530 --> 00:05:53,690 So as we jump into discussing this, 114 00:05:53,690 --> 00:05:56,910 we need to start by defining some terms 115 00:05:56,910 --> 00:05:59,150 so we can understand route dampening. 116 00:05:59,150 --> 00:06:01,790 First is penalty. 117 00:06:01,790 --> 00:06:03,770 Penalty is the value that's attached 118 00:06:03,770 --> 00:06:07,080 to the route when it flaps. 119 00:06:07,080 --> 00:06:08,780 This value is 1,000. 120 00:06:08,780 --> 00:06:12,920 And it's the only number in here that we can't either directly 121 00:06:12,920 --> 00:06:14,990 or indirectly change. 122 00:06:14,990 --> 00:06:17,850 Next is the half life. 123 00:06:17,850 --> 00:06:23,390 This is defined as the decay point at which the penalty is 124 00:06:23,390 --> 00:06:26,780 half of its previous value. 125 00:06:26,780 --> 00:06:29,480 This defaults to 15 minutes. 126 00:06:29,480 --> 00:06:31,970 This one we can change. 127 00:06:31,970 --> 00:06:34,400 Next is the suppress limit. 128 00:06:34,400 --> 00:06:37,100 This is simply the value at which we will 129 00:06:37,100 --> 00:06:39,270 start suppressing the route. 130 00:06:39,270 --> 00:06:41,900 So when the route will be suppressed, 131 00:06:41,900 --> 00:06:45,470 and this defaults to 2,000. 132 00:06:45,470 --> 00:06:47,960 Now I said that with the default numbers, 133 00:06:47,960 --> 00:06:50,808 it has to flap at least three times. 134 00:06:50,808 --> 00:06:53,100 And you might be looking at this saying, wait a minute. 135 00:06:53,100 --> 00:06:57,560 It gets suppressed at 2,000, and the penalty is 1,000. 136 00:06:57,560 --> 00:07:01,400 Doesn't that mean that it'll be suppressed after two flaps? 137 00:07:01,400 --> 00:07:02,420 And the answer's no. 138 00:07:02,420 --> 00:07:06,680 You'll see why in just a moment when we put all this together. 139 00:07:06,680 --> 00:07:09,500 Next is the reuse limit. 140 00:07:09,500 --> 00:07:11,090 This is where we're going to start 141 00:07:11,090 --> 00:07:13,890 advertising that route again. 142 00:07:13,890 --> 00:07:18,710 And as you can see, it has to go down to 750. 143 00:07:18,710 --> 00:07:21,000 Again, these are default values. 144 00:07:21,000 --> 00:07:24,470 These can all be adjusted, except for the penalty. 145 00:07:24,470 --> 00:07:26,960 Next is the forget limit. 146 00:07:26,960 --> 00:07:30,170 This defaults to 375. 147 00:07:30,170 --> 00:07:35,610 But what it actually is, it's one half of the reuse limit. 148 00:07:35,610 --> 00:07:37,610 So we don't set this one directly. 149 00:07:37,610 --> 00:07:40,310 This one would get set indirectly. 150 00:07:40,310 --> 00:07:43,340 And this is the point at which the history of the route 151 00:07:43,340 --> 00:07:47,300 flapping is erased, and we're no longer keeping track. 152 00:07:47,300 --> 00:07:51,350 So we basically forgive all the past history. 153 00:07:51,350 --> 00:07:55,150 And it wipes the slate clean, and we start it over. 154 00:07:55,150 --> 00:07:57,880 Then we have the max suppress time. 155 00:07:57,880 --> 00:08:01,810 If a customers route were to flap over and over 156 00:08:01,810 --> 00:08:04,390 and over and over again, and this penalty 157 00:08:04,390 --> 00:08:08,530 keeps going up 1,000, plus 1,000, plus 1,000, 158 00:08:08,530 --> 00:08:13,330 plus 1,000, if this were just to keep going, at some point, 159 00:08:13,330 --> 00:08:18,160 if we think it through, it would take us a long time 160 00:08:18,160 --> 00:08:20,800 to get back down to this 750 where 161 00:08:20,800 --> 00:08:23,330 we're going to actually advertise the route again. 162 00:08:23,330 --> 00:08:29,200 So this is the maximum time regardless of the penalty. 163 00:08:29,200 --> 00:08:31,750 No matter how high that penalty got, 164 00:08:31,750 --> 00:08:35,320 when we get to the maximum time, the router 165 00:08:35,320 --> 00:08:38,299 will simply re-advertise the route again. 166 00:08:38,299 --> 00:08:41,200 So now that we have an idea of what these numbers are 167 00:08:41,200 --> 00:08:46,880 and using the defaults, let's take a look at this on a chart. 168 00:08:46,880 --> 00:08:50,590 So here on our chart, we have penalty mapped up 169 00:08:50,590 --> 00:08:51,770 the left side. 170 00:08:51,770 --> 00:08:54,800 We have time being shown across the bottom. 171 00:08:54,800 --> 00:08:58,120 And we have our various limits shown over here 172 00:08:58,120 --> 00:09:03,470 on the right with their default values over here on the left. 173 00:09:03,470 --> 00:09:05,320 So let's put this together and come up 174 00:09:05,320 --> 00:09:09,160 with an example of what would happen in the case of a route 175 00:09:09,160 --> 00:09:10,340 flapping. 176 00:09:10,340 --> 00:09:13,900 So we'll just say here at time 0, 177 00:09:13,900 --> 00:09:16,510 we have a route actually flap. 178 00:09:16,510 --> 00:09:19,720 And that means it's going to go to a penalty of 1,000, which 179 00:09:19,720 --> 00:09:21,470 is right about there. 180 00:09:21,470 --> 00:09:24,790 Now here's the thing, what's going to happen 181 00:09:24,790 --> 00:09:30,100 is the router is now going to start the half-life timer. 182 00:09:30,100 --> 00:09:36,490 And it's going to look to times 0 plus 15 minutes. 183 00:09:36,490 --> 00:09:39,730 And it's going to start drawing a line to where 184 00:09:39,730 --> 00:09:45,660 we would have to be at one half the current value at that time 185 00:09:45,660 --> 00:09:46,970 frame. 186 00:09:46,970 --> 00:09:50,450 So it's going to start drawing an imaginary line 187 00:09:50,450 --> 00:09:56,130 and start decaying our value towards that half life. 188 00:09:56,130 --> 00:10:02,240 So let's say now the route flaps again. 189 00:10:02,240 --> 00:10:07,810 So we'll say right here at timestamp 1, the route flaps 190 00:10:07,810 --> 00:10:09,050 again. 191 00:10:09,050 --> 00:10:13,450 So now it gets another 1,000 penalty. 192 00:10:13,450 --> 00:10:17,770 And we see right away why it's not going to get dampened 193 00:10:17,770 --> 00:10:20,200 if it only flaps twice. 194 00:10:20,200 --> 00:10:23,260 Because even if this decay is only a 1, 195 00:10:23,260 --> 00:10:27,460 even if it only drops it to 999, the second flap 196 00:10:27,460 --> 00:10:31,053 is still only going to bring it to 1,999. 197 00:10:31,053 --> 00:10:32,470 And by the way, the routes are not 198 00:10:32,470 --> 00:10:34,210 going to flap that quickly anyway 199 00:10:34,210 --> 00:10:37,150 because again we have 30-second delay timers 200 00:10:37,150 --> 00:10:38,660 and things like this. 201 00:10:38,660 --> 00:10:42,820 So it's going to have decayed the penalty at least a little 202 00:10:42,820 --> 00:10:45,920 before it could even flap a second time. 203 00:10:45,920 --> 00:10:48,580 But now that it's flapped a second time, 204 00:10:48,580 --> 00:10:51,100 the first half life timer is going to be removed, 205 00:10:51,100 --> 00:10:53,060 and then we're going to make a new one. 206 00:10:53,060 --> 00:10:55,630 So we're going to go out, again, I'm estimating here. 207 00:10:55,630 --> 00:11:00,940 We'll say that this is going to be now time 1 plus 15. 208 00:11:00,940 --> 00:11:06,170 And now the half time is probably right around there. 209 00:11:06,170 --> 00:11:08,120 So now what we're going to do, once again, 210 00:11:08,120 --> 00:11:12,310 is start decaying towards that half mark. 211 00:11:12,310 --> 00:11:16,660 So you can see because of the way, this is a decay mechanism, 212 00:11:16,660 --> 00:11:19,930 the higher the penalty, the faster it's actually 213 00:11:19,930 --> 00:11:22,510 going to decay the penalty. 214 00:11:22,510 --> 00:11:28,000 So again, though, if it flaps yet again at time 2, 215 00:11:28,000 --> 00:11:31,480 now we're going to add another 1,000 to the penalty. 216 00:11:31,480 --> 00:11:35,320 And at this point, we are now going to go suppressed. 217 00:11:35,320 --> 00:11:37,670 So now, what happens? 218 00:11:37,670 --> 00:11:40,150 We get rid of our half-life timer. 219 00:11:40,150 --> 00:11:43,000 Once again, we'll come out here give or take. 220 00:11:43,000 --> 00:11:47,050 This is going to be time 2 plus 15. 221 00:11:47,050 --> 00:11:50,662 And half is probably going to be right around there. 222 00:11:50,662 --> 00:11:52,120 And what we're going to do is we're 223 00:11:52,120 --> 00:11:56,890 going to start decaying this penalty towards the half-life 224 00:11:56,890 --> 00:11:57,850 timer. 225 00:11:57,850 --> 00:12:00,890 This time, we'll say it doesn't flap again. 226 00:12:00,890 --> 00:12:03,190 So now it's stable. 227 00:12:03,190 --> 00:12:06,710 We're back below the suppressed limit. 228 00:12:06,710 --> 00:12:10,070 However, we're not down to the reuse limit. 229 00:12:10,070 --> 00:12:12,070 So then, what happens? 230 00:12:12,070 --> 00:12:14,380 Since we've reached this half-life timer, 231 00:12:14,380 --> 00:12:16,370 it's going to go away. 232 00:12:16,370 --> 00:12:18,500 We're going to put another one out here, 233 00:12:18,500 --> 00:12:21,700 which is going to be T2, essentially, 234 00:12:21,700 --> 00:12:23,920 it's going to be T2 plus 30. 235 00:12:23,920 --> 00:12:27,130 And now it's going to be half of what remains. 236 00:12:27,130 --> 00:12:29,870 So we'll say somewhere right around there. 237 00:12:29,870 --> 00:12:34,670 And now what happens is we start decaying towards that. 238 00:12:34,670 --> 00:12:37,420 But as soon as we cross that reuse limit, 239 00:12:37,420 --> 00:12:40,340 we start advertising it again. 240 00:12:40,340 --> 00:12:43,840 So at that point right there, this route 241 00:12:43,840 --> 00:12:46,760 will then start getting advertised again. 242 00:12:46,760 --> 00:12:51,680 However, we are still keeping its history, which means-- 243 00:12:51,680 --> 00:12:53,680 and we're not going to follow through with this, 244 00:12:53,680 --> 00:12:57,850 but it means that if this were to flap again, 245 00:12:57,850 --> 00:13:00,910 it would add the 1,000 penalty from here. 246 00:13:00,910 --> 00:13:03,730 It wouldn't start from the bottom 247 00:13:03,730 --> 00:13:06,040 like we did the first time. 248 00:13:06,040 --> 00:13:08,530 It would pick up right where it left off. 249 00:13:08,530 --> 00:13:10,780 It may not go right back to suppressed, 250 00:13:10,780 --> 00:13:14,020 but it still has its existing history. 251 00:13:14,020 --> 00:13:17,470 But this half-life timer continues. 252 00:13:17,470 --> 00:13:25,030 Somewhere out here is going to be a timer time 2 plus 45 253 00:13:25,030 --> 00:13:28,150 because it's been three half-life timers. 254 00:13:28,150 --> 00:13:30,490 So now what happens is we choose half of that. 255 00:13:30,490 --> 00:13:32,000 And just for the sake of simplicity, 256 00:13:32,000 --> 00:13:34,300 I'm going to actually draw it just below that line. 257 00:13:34,300 --> 00:13:36,640 That may or may not be completely accurate. 258 00:13:36,640 --> 00:13:39,130 This is all just drawn freehand. 259 00:13:39,130 --> 00:13:43,060 But now we start decaying towards that mark 260 00:13:43,060 --> 00:13:45,830 until we get to right there. 261 00:13:45,830 --> 00:13:48,590 And as soon as we get right here, 262 00:13:48,590 --> 00:13:52,720 now everything's forgiven, and this whole process 263 00:13:52,720 --> 00:13:53,830 would start over. 264 00:13:53,830 --> 00:13:57,490 So the slates wiped clean, there's no more history, 265 00:13:57,490 --> 00:14:01,090 and the route would start back here again 266 00:14:01,090 --> 00:14:03,530 if it were to flap later. 267 00:14:03,530 --> 00:14:05,860 So hopefully this gives us a good idea 268 00:14:05,860 --> 00:14:09,950 of how BGP route dampening actually works. 269 00:14:09,950 --> 00:14:13,690 So in our next video, let's jump into the command line 270 00:14:13,690 --> 00:14:18,460 and take a look at how this actually gets built. 271 00:14:18,460 --> 00:14:22,290 So in this video, we got an introduction to BGP route 272 00:14:22,290 --> 00:14:25,950 dampening, why we would use it, what it's for, 273 00:14:25,950 --> 00:14:28,560 and how the numbers work together 274 00:14:28,560 --> 00:14:32,790 to create this chart that explains when the routes get 275 00:14:32,790 --> 00:14:36,790 suppressed, when they get unsuppressed, and then finally, 276 00:14:36,790 --> 00:14:39,960 when the history is removed so that they start over 277 00:14:39,960 --> 00:14:43,950 with a zero penalty instead of picking up where they were. 278 00:14:43,950 --> 00:14:46,230 Again, in the next video, we're going 279 00:14:46,230 --> 00:14:50,160 to jump into the command line and actually see this working. 280 00:14:50,160 --> 00:14:52,350 I hope this has been informative for you. 281 00:14:52,350 --> 00:14:55,490 And I'd like to thank you for viewing. 282 00:14:55,490 --> 00:14:59,000