Answer to an Earlier STP Question

 In 200-301 V1 Ch09: Spanning Tree, 200-301 V1 Part 3: VLANs, STP, Q&A

This post answers the Spanning Tree question linked here. The short answer is that there are lots of right answers! What could impact the choice of root port in a triangle topology? All port costs except the root switch’s ports’ costs, and the port priority on the non-root switches as well. Details to follow!

Answers: A, B, E

Part of the point of this question is to get us to generically apply the concepts of how a switch chooses its root port. The question asked about how any non-root switches would think about how they choose their respective toot ports, and what facts might influence those choices. This explanation walks through an analysis that breaks down the topology into triangles, and shows why collectively all non-root switches’ STP costs matter, and why the same interfaces’ STP priorities matter.

Default STP Costs

First, consider the re-drawn version of the subset of the topology with switches S1, S2, and S3, shown here as Figure 2. S1, the root per the original question, sits at the top of the figure, just to make the tree structure more intuitive. The figure shows the default FastEthernet cost of 19 on each interface. It also shows the flow of Hellos that reach switch S2 during the STP convergence process.

Figure 2: S1 as Root, S2 Calculates Competing Root Costs

You can choose to use an acronym like RACA to recall the steps a switch uses when thinking about Hello messages and choosing its root port. RACA would stand for in this case:

Receive all Hello messages

Add the interface cost on which each Hello was received, respectively

Choose the best hello; use that port as the root port

Advertise a Hello based on that choice out other ports

In this case, S2 receives the cost=0 Hello on F0/1, adds cost 19 (of S2’s F0/1), as one cost-to-reach-the-root to consider. S2 also receives a cost=19 Hello from S3; then S2 adds its F0/3 cost of 19, for a second option of cost 38. Clearly, the first of S2’s options has the lower cost; S2 chooses its F0/1 interface as Root Port.

So which of these ports’ interface costs impacted S2’s choice? Well, both of S2’s interfaces in the triangle  impacted one or the other calculation. Additionally, S3’s F0/1 interface cost impacted the cost S3 listed in the Hello it sent to S2. So all three interfaces’ costs impacted the choice.

Note that if the costs were reconfigured, S2 might have chosen its F0/3 interface as root port, e.g., if S3’s F0/1 were cost 10, and S2’s F0/3 were cost 8, then S2 would have chosen its F0/3 interface as its root port.

Switch S3’s F0/2 Port Also Plays a Role

So far, the analysis does not show a case where S3’s F0/2 interface impacts any RP choice. However, if you take the same logic, and think about it from S3’s perspective, both of S3’s interface costs in the triangle impact the choice. Figure 3 shows just such a case. Note that some of the STP costs have been reconfigured just to make the math choices more obvious.

Figure 3: S1 as Root, S3 Calculates Competing Root Costs

In this case, S3 actually chooses the longer path to the root switch as the better path, making S3’s F0/2 interface S3’s root port.

Lowest Sender’s Bridge ID as the Last Tiebreak in this Topology

If one switch receives multiple Hellos from the same root switch over different paths, plus the costs tie, the switch has to use a tiebreaker. The tiebreakers are, in order:

  1. Choose based on the lowest bridge ID of the neighbor that sent the Hello
  2. Choose based on the lowest port priority of the sender’s port (interface)
  3. Choose based on the lowest internal interface number of the sender’s port (interface)

However, in this topology, with only a single link between each pair of switches, the first tiebreaker will always break the tie. For example, Figure 4 shows a tie on S2, with cost 19 through both paths to the root. In this case, S2 would examine both received Hellos: one that lists S1’s bridge ID as the forwarding switch of the Hello, and one that lists S3’s bridge ID as the forwarding switch of the Hello.

Figure 4: S1 as Root, S2’s Root Port Options Tie on Cost

Because of the topology, with three switches, one switch will be root, and the two non-root switches will receive up to two Hellos: one from each of the other switches. As a result, the neighboring switch’s Bridge ID, which is listed in the Hello, will be unique, so it will always allow the switch to choose based on the better (lower) bridge ID.

Because of that, I would consider the two answers that mention port priority to be incorrect in this case. The reasoning is that the question asked about this particular network, and with this topology, the first of the three tiebreakers will determine the root port, so the port priority, which is not considered until the 2nd tiebreaker, will never affect the outcome.

Whew. That was a lot! Ask clarifying questions if you have them.

Answers: ACL Drill Set 1
ACL Drill Set 2
Subscribe
Notify of
guest

6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

[…] post answers the Spanning Tree question linked here. But first, remember that triangle analysis of STP from last question? Well, all you need to know to rule in all the right answers, and rule out all the incorrect […]

Marcelo

Hi. Excellent explanations. I think almost the same way like you. I was thinking for myself that in the case of a tie, in this topology SW1 would always win, because it is the root because it has the lowest BID in the topology. So, I thought the other answers were right too (those about priorities), until I read your explanation. But I think, if a BID is the lowest, is logical to think that it has the lowest priority too, so I think that the order of the tiebreakers would be 1. lowest port priority, 2. lowest port BID (because if priorities tie, then you see the switch MAC address as a tiebreaker), 3. lowest internal interface number.

I’m a little confused about my point of view and yours, please clarify this a little more. Thanks a lot.

Marcelo

Hi. Yes, it helped a lot. The reason of my confusion is that I was seeing the priority and the mac address as two separate things inside the BID, and not as one big number. Someone else had a similar way to see things like me, in the first question of this post https://www.certskills.com/ccna/q213-answer/
But now I have a clearer idea. Thanks a lot.

Tewa

Hi Wendell,
I am reading your CCNA 200-301 Vol 1 textbook in 2023 and am a bit lost on this question. In reading the book, I do not recall any mention of triangles with respect to spanning tree. Can you please give a bit of a background why triangles shold be considered in solving SPT question and why S4 was not considered in this question.

Wendell Odom

Tewa,
STP supports any arbitrary topology. However, when making good choices for designing campus LANs, the design typically has two distribution switches and many access switches. Each access switch connects to both distribution switches, with the distribution switches connecting to each other, forming a triangle subset of the design. By design, one of the distribution switches should be configured so its the root switch. So, in this question, you can think of S1-S2-S3 as a triangle, S1-S2-S4 as a triangle, just to break down the problem. Knowing that the access switch is not the root (again by purposeful design), then you know one of its two uplinks is its root port. So it gives you a good start on predicting the STP topology.
And you are correct, I don’t happen to discuss STP in this way in the book.
Like any large problem, it’s just one way to break it into a smaller problem to help think through the problem.
Wendell
PS See Volume 2’s LAN Architecture chapter for more on the design terms.

6
0
Would love your thoughts, please comment.x
()
x