STP Puzzle #1

By certskills November 29, 2011 11:29

This blog post is the first of what may be a whole new type. You can read all day about Spanning Tree Protocol (STP), and learn the theory, but that’s not enough. When you later try to apply STP concepts to a new topology, or to the same topology that has different STP settings, many people just need practice working through the concepts. That practice is very useful, and my ICND2 book has practice questions about STP. However, it seemed like this is a topic for which a few more practice problems could help.

I’ll do a longer background post on what I’m after here, but I wanted to go ahead and post a problem and see if I could get you folks thinking and get some feedback. If you want to think about STP, look below the fold!

Big Picture: Find the Root Switch, Root Ports, Designated Ports, and all Blocking Ports

The heading gives you most of your marching orders. This problem gives you some information, but not all information, about setting related to STP in the small switched network shown in Figure 1. Treat the information given as a puzzle, and see how much you can figure out about the topology. In particular, what can you determine for certain in regards to which switch is root? The root port on all non-root switches? The designated port on each link? And which ports block?

To list your answers, just mark each port in the figure as RP (root port), DP (designated port), or BL (blocking), and note the root switch. When you can, note each non-root switches cost to reach the root through its root port, which of course matters to the decision of which switch becomes the designated port on links.

Some rules:

  1. The problem lists partial information, so you may not be able to determine all STP facts. Part of your job is to figure out what you cannot tell from the information given.
  2. Unless otherwise stated, assume that the problem relates to the STP topology for VLAN 1
  3. Do *not* assume that the switches use default configuration. That is, if a fact is not stated by the problem, it may be set to a default value, but it also may not e set to a default value.
  4. If you have questions or comments, make sure and list you reasoning that leads up to the question or point.

On that last rule, what I mean is this. If you believe it is impossible to know whether switch S1 or S3 is the root, but you know that it’s not switch S2 or S4, and you want to confirm that you cannot know for sure if S1 or S3 is root, then maybe start with why S2 and S4 are not root.

Today’s Problem

The switches use the topology as shown in Figure 1:

Examples 1 through 4 lists the facts supplied as part of the problem.

Example 1: S1 Facts

Example 2: S2 Facts

Example 3: S3 Facts

Example 4: S4 Facts

STP Puzzle Overview
STP Puzzle #1, Answer Part 1
By certskills November 29, 2011 11:29
Write a comment


  1. Mark M. November 29, 12:36

    S4 is the root. BID is lowest. F0/2 on S3 is blocking. S3 root port is F0/1 as stated. Cost to root is 19 + ? on F0/2. F0/3 on S2 cost is 19. Even with limited info, I was able to see the paths.

    Reply to this comment
    • Wendell Odom of Certskills Author November 29, 13:21

      Hey Mark,
      Thanks for the post.
      Food for thought: on the S2-S3 link, how can you be sure S2’s F0/3 doesn’t block, with S3’s F0/2 as the DP, instead of vice-versa? Just asking as more to consider.

      Reply to this comment
      • Mark M. November 29, 13:59

        Given the information available, S2 F0/3 has a cost of 19. S2 cost to the root will be less than S3. S3 is not directly connected to S4 unlike S2. Given the defaults, S3 F0/2 should be 19 plus whatever the cost from S2 F0/4 cost to root is.

        Reply to this comment
      • Wendell Odom of Certskills Author November 30, 08:21

        Hey Mark,
        In case you’re interested in one more round…
        “S2 cost to the root will be less than S3.”. Do we know enough info to know S2’s root port? If S4 is indeed root, then S2 has three possible root ports. What do we know that rules out any of those three ports as its root port? And what’s that root cost? Those are just rhetorical, again to explore the ideas, but the short version is that I don’t think the puzzle gives enough info to claim “S2 cost to the root will be less than S3”.

        I’ll get to a longer why/wherefore that’s more organized when I walk through the answer, but feel free to post again to work it through. Thanks for playing!

        Reply to this comment
  2. Mark M. November 30, 11:51


    Here is my thought process. You are right that S3 cost to root may be less than S2. S2 port F0/4 might be cost 100, because we do not know the link type. If the root is S4, then F0/4 on S2 and F0/4 on S1 are directly connected to the root bridge.

    I see that I made assumptions based on just looking at the topology and not thinking it through.

    Here is what I believe is the correct answer:

    S4 – Root Bridge F0/1 & F0/2 Root ports

    S2 – F0/1 Root port, F0/3 Designated port, F0/4 blocking

    S1 – F0/4 Root port, F0/2 & F0/3 Designated ports

    S3 – F0/1 Root port, F0/2 Designated port

    Thanks for the challenge Wendell. I am taking the 640-802 test soon, so this was good practice. I am looking forward to your answer.

    Reply to this comment
    • Wendell Odom of Certskills Author November 30, 16:11

      Hey man,
      You’re very welcome. Glad it’s been interesting to think through. I had a few minute to work on the bigger “how to attack” post this AM, and I spent some time specifically on that point.
      I’m good with almost all of what you wrote. Since it may be a few days before I answer this fully, and since you’re taking the test…
      I don’t think S2’s RP is knowable on this problem.
      EG, if S2’s F0/4 VLAN 1 port cost is configured to 9, that port is S2’s RP. (And S2 wins the DP election between S2 and S3).
      EG, if S2’s F0/4 VLAN 1 port cost is configured to 100, I agree with all of your answer in your latest post.

      Last thing – I can’t imagine Cisco could ask you something this detailed in one question on the actual test! Glad you liked the practice – I think doing 2 or 3 of these as late-stage practice is probably worthwhile.

      PS – I edited this post about 10 minutes after posting, so later readers would be less confused. The EG with S2’s F0/4 as cost 1 (original) was changed to cost 9, because at cost 1, S3 would not have chosen its F0/1 as RP.

      Reply to this comment
      • Mark M. November 30, 17:00


        Thanks for the input and giving a thought provoking lab question. I would like to suggest another STP lab that has given me trouble in the past.

        How about a lab question with STP on a per vlan basis and how to figure out root port, blocking and designated ports.

        Thanks for your time.


        Reply to this comment
  3. Wendell Odom of Certskills Author November 30, 19:19

    Mark, let me ask a follow up. In a single question, you want a different STP topo for different VLANs? Could I use the same general format as this question, just point out different details per VLAN? Or do I really need to do a style with show command output (so you have to figure out which parts are for which VLAN).
    thanks for helping me figure out some good exercises!

    Reply to this comment
    • Mark M. November 30, 20:48


      Thanks for taking the time to prepare these labs. I think that this could be a great 2 part question.

      Using the same topology and basically the same info, just add 1 or 2 vlans and let us figure out the answer just looking at the topology. The second part of the question could be to see if what we determined what the answer was looking at the topology and matching it to the command output. Seeing is not always believing.



      Reply to this comment
    • Joe September 28, 15:07

      Wendell can I send you a Pearson question that I’m confused about?

      Reply to this comment
  4. Wendell Odom of Certskills Author December 12, 20:12

    All – also check out this post, which is the “how to attack” post for this kind of question. FYI…

    Reply to this comment
  5. De Jongh S. April 6, 12:40

    Could it be possible that there’s a mistake in S4 Bridge priority ?
    On cisco switch running PVSTP by default, STP Priority must be configured using increments of 4096.

    So for VLAN1, 28763 isn’t possible. Btw i think it’s just a typing mistake.
    Pri should be 28672 + 1 (for sys-ext or vlan-id).

    And sorry to see that fun post so late.

    Reply to this comment
    • certskills Author April 8, 14:30

      I agree; the priority is wrong and a miscalc on paper by me. Don’t think I’m going to go back and trace down a fix all through this thread at this point, because I don’t think it impact the logic at all (other than you couldn’t lab it exactly like this). Thanks for the post!
      And no worries on the timing – I most people browse around old posts anyway. Everyone’s at a different spot in their exam prep.
      Thanks much,

      Reply to this comment
  6. Frank Lee May 3, 17:25

    My answer: (RP Root port, DP Designated Port, BP Blocking port)
    S1. RP: F0/4; DP: F0/2, F0/3
    S2. RP: F0/1; DP:F0/3; BP: F0/4
    S3. RP: F0/1; BP: F0/2
    S3. DP: F0/1, F0/2

    Reply to this comment
  7. Isis October 16, 20:21

    –S1 cannot be the root switch
    >S1 has higher priority than S4
    –F0/3 on S1 is the designated port
    –F0/4 is the root port
    >Since both F0/4 and F0/2 has the same cost and the path through F0/2 will add up the cost of one more link (S2-S4) which must have at least a cost of 1 (which would generate a total cost of 9), F0/4 is the root port.

    –S2 cannot be the root switch
    >S3 has F0/1 as its root port. The first step towards electing a port as a root port is the path cost. F0/1 has a cost of 19 and F0/2 on S1 has a cost of 8. So, to reach S2, it would be a total cost of 27. Through F0/2, the total cost would be 19. However, S3 didn’t choose F0/2 as its root port, meaning that S2 isn’t the root switch.
    –S2’s F0/3 is the DP as every segment has a DP and F0/2 on S3 is in a blocked state.

    –S3 cannot be the root switch
    >S3 has a root port (F0/1)
    –S3 has a root cost of 27
    –F0/2 will be a blocked port since S2, per the interfaces costs on the topology, would have at least a root cost of 12 and the election of the DP relies first on the root cost.

    –S4 is the root switch
    If none of the other switches are the root, then S4 is the root switch.
    –F0/1 and F0/2 on S4 are designated ports

    Reply to this comment
  8. Punya Athma January 4, 00:24

    There is a possibility S4 becomes root Switch, comparing with S1’s BID:-

    The S4 priority, 28763 is less than,
    the S1 priority, 32769.
    i.e, The S4 BID is < S1's BID.

    If, S4 is the root switch, the two ports F0/1, and, F0/2 of S4, become Designated ports.

    S1 has three paths to reach the root switch S4. They are:-

    S1, F0/2 – S2, F0/4 – S4.
    S1, F0/3 – S3, F0/2 – S2, F0/4 – S4
    S1, F0/4 – S4.

    The path hosts for the above paths:
    S1, F0/2 = 8, given in the problem.
    S2, F0/4 = ?
    So, S1, F0/2 – S2, F0/4 – S4 = 8 + ?

    the other path:
    S1, F0/3 – S3, F0/2 – S2, F0/4 – S4 =
    S1, F0/3 + Default + S2, F0/4 – S4 =

    The third and last path:
    S1, F0/4 – S4, this is the shortest path to the root switch.
    So this becomes the root port on that segment.

    S3's F0/1 is Root port, given in the problem.
    Therefore the other end, the port F0/3 of S1, is Designated port.
    S1's F0/2 is also a designated port because S1's F0/4 is a root port, but on the segment of S1 – S2, S2's F0/1 is a root port as S2's F0/1 is closer to the root switch, but, F0/4 of S2 cudn't be root port as there can't be two root ports on a non-root switch. Therefore by configuring a higher port cost, i.e, more than 4, for, S2, F0/4, S2's F0/1 could be made a root port. Thereby, S1, F0/2 becomes the designated port, however, S1's F0/3, is a designated port also, because, S3's F0/1 is a root port, (given).

    Although, not enough information is given, to continue further in this scenario, chances are likely, for S1's F0/3 becomes an alternate port and changes it status as a Blocking port.

    Reply to this comment
  9. Mike August 25, 17:53

    Question: Is the way I came to the same conclusion about S4 being the root switch is valid?

    1. S1 is not the root switch because S4 has the lower BID.

    2. S2 & S3 both have root port costs greater than zero so neither of these switches are the root switch.

    3. Given the above observations, S4 is the root switch.

    Thank-you for your help!

    Reply to this comment
    • certskills Author September 1, 11:32

      Hey Mike,
      Well, the long answer is in the next post, in case you didn’t see it…
      But I’m good with your #1.
      Your #2, I don’t see where this exercise tells us what switch S2’s root port is or its root cost. But I agree that you rule out S3 because it has a root port. In short: if a switch has a root port, it is not the root switch.
      Your #3, when you find a more specific reason to rule out switch S2, yep, it’s S4! But I think this one (over ten years old!) was set up to require you to rule out S2. Tricky, hopefully useful for learning.

      Reply to this comment
  10. Wendell Odom November 11, 17:47

    FYI, 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
  11. sana January 10, 01:23

    The root creates and sends a Hello BPDU with a root cost of 0, out all its working interfaces (those in a forwarding state)
    pg 225

    just want to know that this root cost = 0 is by default or no?
    (because i thought before this puzzle that ROOT’S root cost =0 everytime)

    Reply to this comment
    • Wendell Odom January 12, 11:17

      Hi Sana,
      You can think of it as “by default”, but there’s no other option – it’s the way it is. The root switch’s cost to reach itself is defined as 0. So when the root switch creates and sends the Hello BPDUs, those messages list root cost 0. So it’s not really a default, because default implies that you can change it. It just… truth: root switch has root cost 0.

      Reply to this comment
View comments

Write a comment

Leave a Reply to Mark M. Cancel reply