STP Lab Part II – Recalling All the Ways to Tweak the STP Topology

Analysis
Mar 8, 20106 mins

Dozens of config variations to meet the requirements, with only 2 switches

CCNA requites that you understand various ways to tweak the Spanning Tree Protocol (STP) topology. CCNP SWITCH requires that you master those features, plus other more advanced STP tools. And the new TSHOOT exam requires that you be able to quickly and easily analyze a VLAN to determine the STP topology with surety and with speed. The trick here isn’t to understand any one feature, but to know the configuration and show commands well enough to be sure of that topology, and the commands that could change it. Today I’ll focus on these options using the lab we started here last week.

(This post will make no sense without reading last week’s blog post, by the way.)

The lab started by giving you a physical topology, some configuration requirements, and a request for all default STP settings. Then, the challenge is to consider how to make data flowing from R1 (in VLAN 2) to PC1 (in VLAN 3), such that it flows through VLAN 2 over a portchannel, and over VLAN  3 over a different VLAN trunk (port F0/10). And the goal was not just to figure out the STP topologies to support this in both VLAN 2 and 3 – a relatively easy task. The goal wasn’t to find some configurations that met these requirements. The goal was to find ALL configs that meet this requirements. Why? Practice for those who care, and its a way to better understand how much you can practice for STP with just 2 switches.

For those of you who want to see the configurations of the devices – essentially the answers to the CCNA-level lab posed last week – go here. This is the initial configuration where we pick up the story this week, with two working trunks – one a Portchannel, and one a single link (F0/10).

Let’s break down the flow from R1 to R2, through VLAN 2. To get the requested flows, the VLAN 2 STP topology must:

1)    have SW1’s Portchannel interface in a Forwarding state,

2)    Have SW2’s Portchannel interface in a forwarding state,

3)    have either end of the F0/10 trunk be in a blocking state.

For STP newbies, the 3rd point might have a surprise. Many people see the need that in VLAN 2, SW1 must forward the frames from R1 to R2 over the Etherchannel. The trick is that SW1’s other trunk – F0/10 in this case – does not have to be in a blocking state. One end or the other will block, but not both. With only one end blocking, neither switch will learn MAC  addresses associated with those interfaces, effectively stopping the switches from using that trunk (at least in VLAN 2).

To get this basic STP topology, there’s two main options conceptually, but many configuration to reach each option. In VLAN 2:

1)    Make SW1 root, make SW2’s cost to reach root better over the portchannel, so SW2’s Po1 interface its root port and therefore forwards.

2)    Make SW2 root, make SW1’s cost to reach root better over the portchannel, so SW1’s Po1 interface its root port and therefore forwards.

If you follow the suggestion to make SW1 be the switch with the superior (lower value) base MAC address, the the first of these two options occurs with all default settings. However, we’re not after getting a particular topology, but finding all the config options that get us there. So, let’s take a closer look at option 1, with SW1 as root, and SW2’s Po1 as its root port.

First, consider the options to make SW1 root in VLAN 2. All of the items in the list assume you start with the default configuration, and add just the command(s) listed (in other words, this list is not cumulative):

a) All defaults

b) on SW1, configure: spanning-tree vlan 2 priority 24576   – this artificially makes SW1 the root. Just use any legal value less than SW2’s default (32,768 base)

c) on SW1, configure: spanning-tree vlan 2 root primary     – this tells SW1 to figure out the current root, and lower SW1’s priority so SW1 becomes root. In this case, SW1 has a base priority of 24,576, and a VLAN 2 priority of 24,578.

d) On SW2, configure spanning-tree vlan 2 priority 36864  – this makes SW2 not be root because it has a higher priority than SW1’s default

e) On SW2, confgure spanning-tree vlan 2 root secondary, but only after making SW1’s VLAN 2 STP base priority 24,576 or lower. This makes SW2 look at the current root, and have a base priority of 4096 more than SW1.

The second requirement in the first option is that SW2 choose Po1 rather than F0/10 as its root port, causing Po1 to forward, and F0/10 to block. By default, SW2 already does this as well, for a couple of reasons – but some aren’t do obvious. So, as something to kick around this week in the blog, ask yourself what different configurations results in SW2 choosing Po1 as its root port? The following questions work towards some of the potential answers.

1)    Do the number of links in the portchannel change the logic? (eg, if 1 link fails, do the costs tie)?

2)    If you set the STP costs for both trunks to be the same (in VLAN 2), which does SW2 choose as root, and why?

3)    Is there something configurable on SW1, when SW1 is root, that changes SW2’s calculation of its root cost, and as a result impacts SW2’s choice of root port?

4)    What effect would a change in link speed on any/all of the trunk links have on SW2’s choice of root port?

5)    Does enabling 802.1s enable any other possibilities that impacts SW2’s choice of root port?

Now, something to ponder about taking tests rather than about the configuration. Anyone who has studied for CCNA has thought about the above at least a little, and anyont who’s gotten to the STP topics for CCNP has spent plenty of time on these. The question to ponder is whether you can easily and confidently think of all the options to tweak STP. It’s a little different path to the same concept. Some questions ask you to analyze a given config or show command output, but other may require you to think of all the items that impact one core concept. The latter (in my opinion) is harder for which to prepare.

For example, I asked 5 leading questions above. However, there are more configuration options that result in SW1 as root switch and SW2’s Po1 as its root port. Feel free to toss any others out that you think of this week.

Whew! What else? Well, how about the case in VLAN 2 with SW2 as root, and SW1 with its Po1 as root port? Or in VLAN 3, with SW2 as root, and SW1’s F0/10 as its root port? Or in VLAN 3, with SW1 as root, and SW2’s F0/10 as its root port? All these fit into the design goals of the lab, all have more than 10 different configs each to achieve the goals. Just a little food for throught on the 2-switch CCNA lab.