[AUDIO LOGO]
So the first advanced feature that we want to look at
is BGP route dampening.
Now the idea behind route dampening
is if we have a neighbor or a customer,
maybe another service provider who's constantly advertising
and retracting a route, this is going
to cause a lot of convergence problems in our network,
and possibly not even our network, possibly
the entire internet.
So the idea behind route dampening
is if a route flaps too many times,
and we'll see how the calculations are done
and what we can adjust, but based on that routes history
of flapping, we can then suppress that route,
not advertise it to anybody else,
well, until it becomes more well behaved.
So that's the idea behind route dampening.
Let's jump in and take a look at some of its details.
And then, of course, we'll jump into the command line
and actually take a look at how this works.
So if we're going to talk about BGP route dampening
and suppressing flapping routes, we probably
need to start by defining exactly what that route
flap actually is.
And quite simply, it's a route, of course,
that's being advertised and withdrawn several times
in a short period of time.
So when we talk about a short period of time,
we're generally talking about this
in the time frame of minutes to hours, not weeks or months.
Now the reason I put a star up here on several times,
this is adjustable.
And that's what we're going to be
looking at in this video, the things that we can adjust.
And they will affect how quickly,
how often these routes get suppressed.
Now remember part of the reason we
need this is that BGP was designed specifically to handle
a large number of prefixes.
Now the sort of side effects to that
is this does entail sacrificing convergent speed for stability.
So that means that our convergence isn't
going to be that fast with BGP.
Are there things we can do to speed it up?
Yes, but then we have to start being
concerned about resources.
And we do have a video about that coming up here
in a little bit.
But to help address this issue of scalability and stability,
there are several default timers,
default features in BGP to support
the goal of being stable.
And route flap dampening, which is
sort of the official name for what we're talking about
is one of those features.
So, what was trying to be achieved with BGP route
dampening?
Well the first thing was, of course,
to reduce the router processing load.
If we have huge BGP tables, this of course,
is going to cause more CPU load on the devices.
And every time they get advertised and withdrawn,
we have to do it again.
And while we're trying to protect the local router,
we should also be trying to minimize these eBGP
updates on the entire internet.
As a service provider, we need to make sure
that we don't have customers that
are affecting other service providers, and so on.
And of course, another big thing here
is to not suppress routes that flap occasionally.
Again, we're not talking about a customer that had a maintenance
window and therefore their route got withdrawn and then
re advertised to us.
Maybe they even did it twice.
They reconfigured a router, and that withdrew and re-advertised
the prefix.
And then they realized they had to reload that router,
and that withdrew and re-advertised the prefix.
That's not what we're talking about.
We're talking about routes that have flapped numerous times.
Generally speaking with default numbers
we'll see in just a minute, it's three or more times just
with default numbers.
And of course, our biggest design goal
here was to suppress routes that are likely to flap.
How do we know?
We're going to base this on their history.
Again, it's flapped several times
in a short period of time.
That's what we're looking to suppress.
So just sort of a design statement
here that even with some of those default
timers that we have in BGP, such as, for example,
the advertisement interval, which by default
limits updates, and this is only the eBGP peers by the way,
but it limits them to only be sent every 30 seconds.
So there is, again, some latency built into BGP on purpose
to make sure that a route flapping every 5 seconds
doesn't just go crazy in the BGP tables.
But it's still a good idea to implement route dampening
for more severe conditions.
This 30 second delay is not going
to help if our customer is withdrawing and advertising
their route every five minutes.
So this is just sort of solidifying that statement
that, again, those timers do help,
but it is still best to just remove or suppress
that flapping route until it becomes stable.
That's the whole goal behind route dampening.
So as we jump into discussing this,
we need to start by defining some terms
so we can understand route dampening.
First is penalty.
Penalty is the value that's attached
to the route when it flaps.
This value is 1,000.
And it's the only number in here that we can't either directly
or indirectly change.
Next is the half life.
This is defined as the decay point at which the penalty is
half of its previous value.
This defaults to 15 minutes.
This one we can change.
Next is the suppress limit.
This is simply the value at which we will
start suppressing the route.
So when the route will be suppressed,
and this defaults to 2,000.
Now I said that with the default numbers,
it has to flap at least three times.
And you might be looking at this saying, wait a minute.
It gets suppressed at 2,000, and the penalty is 1,000.
Doesn't that mean that it'll be suppressed after two flaps?
And the answer's no.
You'll see why in just a moment when we put all this together.
Next is the reuse limit.
This is where we're going to start
advertising that route again.
And as you can see, it has to go down to 750.
Again, these are default values.
These can all be adjusted, except for the penalty.
Next is the forget limit.
This defaults to 375.
But what it actually is, it's one half of the reuse limit.
So we don't set this one directly.
This one would get set indirectly.
And this is the point at which the history of the route
flapping is erased, and we're no longer keeping track.
So we basically forgive all the past history.
And it wipes the slate clean, and we start it over.
Then we have the max suppress time.
If a customers route were to flap over and over
and over and over again, and this penalty
keeps going up 1,000, plus 1,000, plus 1,000,
plus 1,000, if this were just to keep going, at some point,
if we think it through, it would take us a long time
to get back down to this 750 where
we're going to actually advertise the route again.
So this is the maximum time regardless of the penalty.
No matter how high that penalty got,
when we get to the maximum time, the router
will simply re-advertise the route again.
So now that we have an idea of what these numbers are
and using the defaults, let's take a look at this on a chart.
So here on our chart, we have penalty mapped up
the left side.
We have time being shown across the bottom.
And we have our various limits shown over here
on the right with their default values over here on the left.
So let's put this together and come up
with an example of what would happen in the case of a route
flapping.
So we'll just say here at time 0,
we have a route actually flap.
And that means it's going to go to a penalty of 1,000, which
is right about there.
Now here's the thing, what's going to happen
is the router is now going to start the half-life timer.
And it's going to look to times 0 plus 15 minutes.
And it's going to start drawing a line to where
we would have to be at one half the current value at that time
frame.
So it's going to start drawing an imaginary line
and start decaying our value towards that half life.
So let's say now the route flaps again.
So we'll say right here at timestamp 1, the route flaps
again.
So now it gets another 1,000 penalty.
And we see right away why it's not going to get dampened
if it only flaps twice.
Because even if this decay is only a 1,
even if it only drops it to 999, the second flap
is still only going to bring it to 1,999.
And by the way, the routes are not
going to flap that quickly anyway
because again we have 30-second delay timers
and things like this.
So it's going to have decayed the penalty at least a little
before it could even flap a second time.
But now that it's flapped a second time,
the first half life timer is going to be removed,
and then we're going to make a new one.
So we're going to go out, again, I'm estimating here.
We'll say that this is going to be now time 1 plus 15.
And now the half time is probably right around there.
So now what we're going to do, once again,
is start decaying towards that half mark.
So you can see because of the way, this is a decay mechanism,
the higher the penalty, the faster it's actually
going to decay the penalty.
So again, though, if it flaps yet again at time 2,
now we're going to add another 1,000 to the penalty.
And at this point, we are now going to go suppressed.
So now, what happens?
We get rid of our half-life timer.
Once again, we'll come out here give or take.
This is going to be time 2 plus 15.
And half is probably going to be right around there.
And what we're going to do is we're
going to start decaying this penalty towards the half-life
timer.
This time, we'll say it doesn't flap again.
So now it's stable.
We're back below the suppressed limit.
However, we're not down to the reuse limit.
So then, what happens?
Since we've reached this half-life timer,
it's going to go away.
We're going to put another one out here,
which is going to be T2, essentially,
it's going to be T2 plus 30.
And now it's going to be half of what remains.
So we'll say somewhere right around there.
And now what happens is we start decaying towards that.
But as soon as we cross that reuse limit,
we start advertising it again.
So at that point right there, this route
will then start getting advertised again.
However, we are still keeping its history, which means--
and we're not going to follow through with this,
but it means that if this were to flap again,
it would add the 1,000 penalty from here.
It wouldn't start from the bottom
like we did the first time.
It would pick up right where it left off.
It may not go right back to suppressed,
but it still has its existing history.
But this half-life timer continues.
Somewhere out here is going to be a timer time 2 plus 45
because it's been three half-life timers.
So now what happens is we choose half of that.
And just for the sake of simplicity,
I'm going to actually draw it just below that line.
That may or may not be completely accurate.
This is all just drawn freehand.
But now we start decaying towards that mark
until we get to right there.
And as soon as we get right here,
now everything's forgiven, and this whole process
would start over.
So the slates wiped clean, there's no more history,
and the route would start back here again
if it were to flap later.
So hopefully this gives us a good idea
of how BGP route dampening actually works.
So in our next video, let's jump into the command line
and take a look at how this actually gets built.
So in this video, we got an introduction to BGP route
dampening, why we would use it, what it's for,
and how the numbers work together
to create this chart that explains when the routes get
suppressed, when they get unsuppressed, and then finally,
when the history is removed so that they start over
with a zero penalty instead of picking up where they were.
Again, in the next video, we're going
to jump into the command line and actually see this working.
I hope this has been informative for you.
And I'd like to thank you for viewing.