STP Puzzle #1, Answer Part 1
This post starts to answer STP Puzzle #1. As usual, check out the original post to make sense of this one. These puzzles give you some info about Spanning Tree Protocol (STP) in a particular network. Your job: figure out all STP settings you can, like the root switch, root ports, designated ports, and so on. This is not a good way to learn STP from scratch – check out my ICND2 book for that. Check out the beginning of the answer below the fold!
Strategy: Find the Root Switch First
Everything to do with STP revolves around the Root Switch, or simply the Root. The root has the lowest value for its Bridge ID (BID). The BID, a per-VLAN value in the default PVST+ mode assumed in CCNA, is just a number. But the BID does have structure: it begins with the bridge priority, followed by a MAC address.
If the problem tells you all the BIDs, finding the root is simple: just pick the lowest BID. If not, try out these steps:
- Rule out switches with a worse (higher) Bridge ID (BID) as compared with all known switch BIDs.
- Rule out switches that have a Root Port (RP). (Only non-root switches have a root port.)
- From the remaining candidates, pick one, and try to rule it out based on other known information, like known RPs.
Rule Out S1 and S3
This puzzle told you two key facts that let you immediately rule out S1 and S3. As a reminder, Figure 2 shows the same topology, with the pertinent known information in blue. Those blue facts were just text in the original problem statement. The red items show the conclusions.
Figure 2: Ruling Out S1 and S3 from Being Root
Simply put, S1’s BID is higher than S4’s, ruling out S1. S3 has a Root Port (RP), so it cannot be the root by definition. That leaves S2 and S4 as possibles.
Strategy: Assume a Switch is Root, and Find Impossible Cases to Rule it Out
Next, just pick either S2 or S4 as root, and try to find reasons to rule it out. I picked S2 to start.
The key to the puzzle at this point is to think about RPs. In this problem, we know out RP fact for sure, and can make a second easy leap of logic:
- (Known) S3’s RP is its F0/1 port
- (Derived) S1’s F0/3 cannot be S1’s RP
Frankly, you would not learn STP this way. However, you can start with any information about RPs, and try to find reasons why a particular switch could not possibly be the root switch. Knowing the facts in the above list, is it possible that S2 is root? If you find a reason to rule out S2, great. If not, repeat this same process assuming S4 is root.
Think about S2 as Root: Can You Rule it Out?
A switch chooses its RP based on the shortest path to the root switch. S3, with known RP F0/1, must have a better (lower) cost path to the root out S3’s F0/1 port – otherwise, S3 would not have chosen its F0/1 as RP. With me so far?
To make this next part easier to discuss, I will assign a letter as the STP cost for each interface in the topology. Figure 3 shows those letters, A-J. Also, the problem statement mentioned that some switches used default costs, and in the problem statement, I forgot to mention that all links run at their maximum speed based on the interface type (FastEthernet). Note that the STP cost defaults based on the actual speed of the interface. (I’ll do better in the problem statement next time.) In this case, the links that use STP default costs will have a cost of 19.
Figure 3: Generic Cost Variables and Known Cost Values
In this topology, S3 has three possible paths between itself and the presumed root S2. The least-cost path would have to start with S3’s F0/1 port, otherwise S3 would not have chosen its F0/1 port as RP. Those paths are:
- S3 F0/1 – S1 F0/2 – S2
- S3 F0/1 – S1 F0/4 – S4 F0/2 – S2
- S3 F0/2 – S2
The cost to reach the root is the sum of all the outgoing port costs in those paths. Adding those up, you see the following:
- G + C = 19 + 8 = 27
- G + B + J = 19 + 8 + J = 27 + J
- H = 19
Of these three paths, clearly the 3rd path has the lowest cost. But… that path is the one that exits S3’s F0/2 interface. So S2 could not possibly be the root switch in this case, because the problem has told us that S3’s F0/1 is its RP.
Conclusion: S4 Must be Root
For the answer to the problem, we have now ruled out three of the four switches as not being root. S4 is the only one left, so S4 must be the root switch.
Big Disclaimer: Good for Learning, Way Past the Exam (Probably)
Before anyone panics… the above kind of thinking may be a good way to exercise your understanding of STP. But it does require you to think way outside the box. I would expect the actual exam to ask you more traditional STP questions. You tell me if you think that working through these kinds of ideas helps solidify your understanding of STP?!?
Next post, I’ll work through most or all of the rest of the logic.