STP Puzzle #2 – Answer
If you didn’t see the puzzle problem statement, then the answers won’t make as much sense. Especially for this one, the new post this week that gives some suggestions on how to attack these STP puzzles can help. The realization that on a switch-to-switch link, the two ends are either a designated port/root port combi, or a designated port/blocking port combo, really streamlines thinking through the STP topology. Answers below the fold. Enjoy!
Step 1: Rule Out Switches from Being Root Switch
In the post where I suggest how to attack these problems, I suggest starting by finding the root switch. Everything in the STP topology revolves around the root, so that makes sense. In this puzzle, you can directly rule out S3 and S4, as follows:
- The problem statement says that S4’s BID is worse (higher) than S3’s BID, so rule out S4 as root.
- S3 has a root port (RP), and only non-root switches have an RP. Rule out S3.
However, the problem does not tell us anything about S1 and S2’s BIDs, which is what STP actually uses to choose the root switch. The problem does allow us to infer which is root, but it requires a long look at the root ports (RPs) and designated ports (DPs).
Skipping Step 2 for Now: Finding All Root Ports
For you process folks out there… I tell you in the “how to attack” post that the next step should be to find each switch’s RP. However, until you know the root switch, finding each non-root switch’s RP will be almost impossible. So I’m skipping this step. FYI.
Step 3: Find All Designated Ports (DPs)
I actually picked the details of this particular puzzle to emphasize a couple of facts that most people don’t think about with STP. With the assumptions in these puzzles, STP works normally. That is, the links all work, they all trunk correctly, the trunking config does not prevent STP from working correctly, and so on. So STP will stabilize to a normal STP topology. When that happens, on every switch-to-switch link, one of two scenarios occur:
- One end is the DP, and the other is the RP
- One end is the DP, and the other is “neither”, ie neither RP nor DP
If you just take those two facts and apply them to the known topology at this point, and do not even try to be tricky or infer anything, you’d find a few more facts. Figure 2 shows the new facts in red, with the known facts (from the problem statement) in black:
Figure 2 – Directly Derived Info from the “Link Ends, Stabilized” Rules
The new information (red) was found based on:
- S2’s F0/4 is a DP, because S4’s F0/2 is blocking, and is therefore neither RP nor DP.
- S2’s F0/3 is a DP, for the same reasons.
- S1’s F0/3 is a DP, because S3’s F0/1 is an RP.
With this more complete list of facts, now you can infer a lot more truth about the STP topology.
S2 is Root; It has Only DPs, and No RPs
First, from Figure 2, you can see that S2 has three DPs, but no RPs. Every non-root switch must have an RP, but the root does not have an RP at all. Therefore, S2 is the root switch.
S1’s F0/2 is its RP
Even if you did were not yet convinced that S2 was root, just based on Figure 2, S1’s F0/2 can be one of two things: an RP, which forwards, or neither an RP nor a DP, so it blocks. A link cannot have two DPs, and S2 is already a DP on the S1-S2 link.
Following this reasoning, if S1 were blocking, then there would be no STP path to/from S2, because of the combined blocking interfaces. The only choice left: S1’s F0/1 is it’s RP, making S1 not the root, and leaving on S2 to be the root.
S4’s F0/1 i its RP; S1 is the DP on the Other End
This is probably the most obvious case, but next consider S4 as shown in Figure 2. It has two ports that could be its RP: F0/1 and F0/2. However, we already know that F0/2 is blocking. So, S4’s RP must be its F0/1 port. And then S1 must be the DP on the other end of the link (S1’s F0/4).
Figure 3 shows a revised Figure 2, with the newly-inferred details in green.
Figure 3 – Final Results for DP, RP, Blocked Ports
All that logic identifies the root, all the RPs, DPs, and blocking ports. However, it does not list enough information to determine the root cost, except for S1 (RC=19). The problem also does not tell us anything about the actual Bridge ID (BID) values; in the end, S2’s BID must simply be better (numerically-smaller) than any of the other switches.