STP Puzzle #1, Answer Part 1

By certskills December 2, 2011 14:05

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:

  1. Rule out switches with a worse (higher) Bridge ID (BID) as compared with all known switch BIDs.
  2. Rule out switches that have a Root Port (RP). (Only non-root switches have a root port.)
  3. 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:

  1. S3 F0/1 – S1 F0/2 – S2
  2. S3 F0/1 – S1 F0/4 – S4 F0/2 – S2
  3. 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:

  1. G + C = 19 + 8 = 27
  2. G + B + J = 19 + 8 + J = 27 + J
  3. 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.

STP Puzzle #1
STP Puzzle #1, Answer Part 2
By certskills December 2, 2011 14:05
Write a comment


  1. Joshua May 29, 15:55

    Thank you! Your books and blog have been an immense help 😀

    Reply to this comment
  2. Davide Fort August 29, 07:11

    Thank you! This way of learning really help me to understand STP

    Reply to this comment
  3. Elango Gansamurthy January 4, 02:04

    S3 – Fa0/1 – Root Port. Definitely not a root-switch.
    – Fa0/1 and Fa0/2 have default cost which are equal
    – if S2 is root-switch, Fa0/2 will be the root port given default value for all links port cost
    – Given Fa0/1 is root-port and Not Fa0/2, confirms that S2 is not a root-switch
    – S4 is the root-switch
    – Fa0/2 Alternate Port, blocking

    S1 – Based on bridge ID, definitely cannot be a root switch
    – Fa0/4 Root-port
    – Fa0/2 Designated-Port
    – Fa0/3 Designated-Port

    S2 – Definitely not a root-switch
    – Fa0/4 Alternate Port,Blocking, Cost=19
    – Fa0/1 root-port port, Cost=12
    – Fa0/3 Designated port, Cost=19 less than S3 Cost=27

    S4 – Root switch
    – Root priority – 28763
    – Fa0/1 and Fa0/2 – Designated Ports(by virtue of being root-switch)

    Reply to this comment
  4. Trent Bontly January 12, 18:36

    How do you know S3 F0/1 is an RP?

    Reply to this comment
    • certskills Author January 14, 14:05

      Hi Trent,
      Well, the simple answer is that in the post that details the problem it states overtly that S3’s F0/1 is its root port. But I’m guessing you might have been leading to some other point – feel free to follow up.

      Reply to this comment
  5. Pedro February 25, 12:40

    Hi, thank you for the exercise. Although questions of this type may not appear in the actual CCNA examination, with exercises like these, I am confident that I’ll have an easier challenge when answering exam questions. These questions create a profound knowledge and solidifies the understanding of STP.

    Reply to this comment
  6. SRTP November 6, 09:53

    There is a problem with S4’s Bridge ID: 28763:0020:4444:4444.That’s means priority = 28672 and VLAN = 91. But I think it’s just mis-typed : 28763 rather than 28673.

    Reply to this comment
  7. Wendell Odom November 11, 17:49

    Note to all: In the problem statement post, I fixed/changed the S4 Bridge ID to a legal value in VLAN 1 – 28673. It was formerly typoed as 28763.

    Reply to this comment
View comments

Write a comment

Comment; Identify w/ Social Media or Email


Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.