So at some point we might ask, "Hey, all of these timers are great, but where
did they
come from?"
We've got the "Hello Timer" set at 2 seconds, "Ford Delay" set at 15 seconds, "
Max Age"
set at 20 seconds.
And the reason I need to ask this question is because if I'm going to tune any
of these
parameters, I need to make sure that we're not causing loops in the network.
One of the reality is that these two timers specifically were developed or were
decided WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
decided
upon mathematically based on two parameters.
First of all, based on the "Hello Timer" set, and second of all, something that
we call
the "NetworkDiameter".
What is the network diameter?
Well, we should probably answer that before we get too much further into this
conversation.
The network diameter is going to lay out for us how many switches in a row we
can have
in our network space, including the switch that we start with. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
in our network space, including the switch that we start with.
So if I'm going to go hop-by-hop through this network, I'm going to find that
my network
diameter is 4.
Again, we include that first one.
So 1, 2, 3, and 4.
Meanwhile, if I have a square topology like this, then we might say, "Oh, well,
my
topology or my network diameter is maybe less than that except if I start at
any one of
these switches, 1, 2, well, starting with this one, 1, 2, 3, and then 4." WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
these switches, 1, 2, well, starting with this one, 1, 2, 3, and then 4."
So even this topology is still 4.
And the best way to envision this is why it happens if one of these redundant
links goes
down, at that point I can tell that I'm going to have to go the same span, the
same diameter.
Now what about a situation like this, where now I've got a link in the middle?
Well, we could say, "Oh, well, this is good because now I can maybe have a WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Well, we could say, "Oh, well, this is good because now I can maybe have a
lower diameter
in some capacity, but the problem is that we have to assume a worst-case
scenario.
Worst-case scenario is we lose our redundant links and we're right back to 1, 2
, 3, 4."
So kind of an interesting situation here.
We more or less have to remove all the loops that could possibly happen in the
network,
remove all of the redundant links, and at that point figure out what the worst-
case scenario
is what this true diameter ends up being. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
is what this true diameter ends up being.
Now notice what else I didn't say in all of this.
I did not say that we're starting from the root.
In fact, very rarely do we start from the root because the root's actually kind
of right
in the middle of everything in theory.
And so if I've got a topology that's like this, with the root up there in the
middle,
we might say, "Hey, you know, I've removed the redundant links here, then maybe
my diameter
is only 3, 1, 2, 3."
And it's 3 this way as well, except again, we're not measuring from the root. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And it's 3 this way as well, except again, we're not measuring from the root.
We're measuring the maximum length of switches from anyone switch to any other
switch, and
usually that's an edge switch to another edge switch.
In this case, the diameter would be 5.
So that is the definition of the network diameter.
Back to our conversation about timers.
We said this is based on the hello timer as well as the network diameter.
So specifically, these values, 15 and 20 seconds, are going to be based on a 2
second hello timer WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
second hello timer
and based on a diameter, believe it or not, of 7 switches.
This is a very large diameter, and that creates relatively large timers.
So that's kind of interesting.
If I look at my network topology down here and say, "Hey, wait a second.
I've got a diameter of 5, then maybe I could tune my timers down a little bit."
Furthermore, if I change the hello timer, that's also going to change my max WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Furthermore, if I change the hello timer, that's also going to change my max
age and
my forwarding delay timers as well.
Now we might look at that and say, "Okay, that's great."
And I'll accept there was a lot of math involved with taking these two
parameters, or really
these two parameters here, and working our way back.
How am I as a network engineer supposed to run all of that math if it's not a
simple
formula?
Regardless of whether it is or is not a simple formula, fortunately for us,
Cisco has yet
another macro.
In fact, it's the same macro. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
In fact, it's the same macro.
Remember that root or primary command?
And for that matter, secondary, either way.
As part of this macro, I can now specify the two different parameters.
I can specify a diameter and I can specify a hello timer.
Now what if my diameter is 5 and I want to change my hello time to 1 second?
Well this will drastically improve or reduce, I should say, the timer.
It's going to lower the timer. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
It's going to lower the timer.
So I can enter this end using this macro.
Again, this is a macro and the result is it will change for me the hello time,
which
is nice based on this parameter.
It will also calculate.
It will do the math for me to figure out the forward delay as well as the max
age.
Generally speaking, if we are changing the timers, if we want to know what we
should change
our timers to, we should never or very rarely just change the timers to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
our timers to, we should never or very rarely just change the timers to
something that we
think might work better.
Instead, we should really use this macro to figure out what these values should
be.
Now I might be in an environment where I've got my root switch set and it's set
at 4K
and I don't want to run these macros.
I don't want to change my backup root configuration whenever the situation is.
Well that's fine.
I could actually go to a non-root switch, run the macros and see what the WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I could actually go to a non-root switch, run the macros and see what the
timers are going
to be.
I can then take those timers and manually configure those on the root, which
will then
push the timers to the rest of the network.
So I don't have to run this macro on the root switch.
Instead, I can run it on any switch, get the values and then use those values
on my actual
root.
So let's take a look in the lab as far as what exactly this looks like. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So let's take a look in the lab as far as what exactly this looks like.
So I'm logged in here.
I'm on switch one.
We see switch one is the root for VLAN one.
It's running my hello time of four seconds in my max age of 20 and for delay of
15.
So if I'm looking at this saying I want to make this as efficient as possible,
which
timer should I use?
Well, we can go to any other switch in the environment like switch two here and
run one
of those macros.
So I can say spanning tree VLAN one doesn't even have to be VLAN one really.
And then I can run a question mark and then we see that I've got that root WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And then I can run a question mark and then we see that I've got that root
macro.
So then I run question mark.
Let's just say I'm going to run the secondary command because I don't want to
be disruptive.
I don't want to actually take over as the root.
And now we see that diameter command.
So I can say diameter and this network is let's say diameter five question mark
again.
We can see that could specify the hello time.
And let's just go ahead and say it's two seconds.
So now what I've done is I have changed my local timer values.
So if I do show spanning tree VLAN one, we'll see that my local value is two WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So if I do show spanning tree VLAN one, we'll see that my local value is two
seconds for
hello and notice the max age has shrunk and the four delay has shrunk.
Now the network is still using whatever the root says, but I now have my values
that I
can configure on the root if I want to tune this environment.
So two, 16 and 12.
So I come back to switch one config T spanning tree VLAN one.
I see that I've got my options here.
So I'm going to set a hello time of two seconds. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So I'm going to set a hello time of two seconds.
I'm going to set a max age of 16 seconds.
And then I will set my forward time to it was 12 seconds, I believe, right?
Right.
Okay.
So here we go.
I have configured and tuned my network using the macro, even though I didn't
use the macro
on the root switch.
So I come back here to switch to I do a show spanning tree VLAN one.
And now we do see that the root is propagating the very values that I
calculated here by
using the macro. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
using the macro.
So the macro is very useful for us for tuning timers.
And if we don't want to use it for setting the root priority, it can absolutely
give
us what we need when it comes to figuring out the most efficient way to deploy
spanning
tree timers into our environment.