## STP Puzzle Overview

I’ve named a new type of blog post: an STP Puzzle. The big idea is pretty simple. The problem tells you some (but not all) facts about Spanning Tree Protocol (STP) in a small switched network. Your job: determine as many STP facts as you can, things that are for sure true. The more difficult part may be figuring out which facts you simply cannot know based on the limited information given.

Hopefully, these STP puzzles help us all practice applying STP knowledge. Applying networking knowledge to a different scenario may well be the toughest thing to learn by just reading, but practicing with a mentor helps a lot. Hopefully these puzzles can fill that role to some extent.

The rest of this post provide some background and strategies for this type of problem, so take a look at the details below the fold!

## STP Puzzle Pieces

Each STP puzzle acts like a jigsaw puzzle with missing pieces. Sometimes, you can put all the known pieces together, sometimes not, but always leaving a few holes. Sometimes, you can visualize the picture on the missing pieces, sometimes not.

Each STP puzzle problem statement gives you some pieces of an STP topology, for example, a switch’s Bridge ID (BID). Your job is to put the known pieces together. Then, apply STP rules to determine other STP facts.

For example, some of the STP puzzles use a figure like Figure 1. This topology shows a typical campus switch design, with switches S1 and S2 as distribution switches, and S3 plus S4 as access switches:

Figure 1: Typical STP Puzzle Topology

An STP puzzle problem statement might tell you that S3 and S4 are not the root switch, and also tell you the BID of S1 and S2. The problem might not tell you which switch is the root switch. The problem might not tell you enough to decide which switch is root, but maybe just to rule out a few of the switches so you know that they are not the root switch. Regardless, one task in the puzzle is to determine the root switch if possible, then find the various root ports (RPs), designated ports (DPs), and so on.

These puzzles purposefully do not give you all the information you need, just to make you think about STP a little harder. As a result, these problems require a fair amount of abstract thought. You may also jump to conclusions because of similar examples you may have seen in a book you might have read, but part of the point is to give you examples so you can think and apply the concepts to a different example.

The rest of this post walks through some suggestions on how to solve each STP puzzle.

## Step 1: Determine the Root Switch

To put a jigsaw puzzle together, you first find the corners, and then try to find and fit all the edge pieces together. With STP puzzles, to do the equivalent, find the root switch first.

The STP topology revolves around the root switch. If you know the STP Bridge ID (BID) of all the switches, just choose the root as the switch with the numerically-lowest BID.

For these puzzles, however, you may not know all the BIDs, so you need a strategy. Here’s what I suggest: rule out switches as not possibly being the root, until only one is left. If you can’t rule out all but one switch, you don’t have enough information to identify the root. Here are the specific suggested steps:

1. For switches with known BIDs, rule out switches with a worse (numerically-higher) BID compared to others.
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.

For that last step, if you have narrowed down the possibilities, assume one switch is root, and look at information about known Root Ports (RPs) and Designated Ports (DPs), plus the cost to reach that assumed root switch through various paths. Then puzzle out the logic to see if the known RP and DP information works if that switch is root. If not, rule that switch out as well.

Note that this last step requires a lot of thinking, and is where some of the most interesting work happens. Rather than give three pages on it here, look to future STP puzzles for examples of how to work through that logic.

## Determine the Root Port of Each Non-Root Switch

Assume for a moment that you have determined the root switch. The next step would be to determine the root port (RP) for each non-root switch.

By definition, the rules to determine a switch’s RP are:

1. Pick the local port that is part of the least-cost path through the network to reach the root
2. If the cost ties, use these tiebreakers, but only consider ports whose root cost tied:
1. Choose the port connected to the switch with the numerically lowest BID
2. If the previous tiebreaker fails, choose the port connected to the port on the neighboring switch with the lowest STP port priority
3. If that also ties, choose the port connected to the port on the neighboring switch with the lowest internal port number

Those last two tiebreakers only occur when you have multiple connections from the local switch to one neighboring switch. They are frankly hard to visualize without an example; I’ll eventually add a few such examples to one of the future STP puzzles for discussion.

To determine the root cost, start at a non-root switch. Then determine each path from that non-root switch to the root. For each path, add up the port cost for each outgoing port. Note that the STP port cost is per interface, per VLAN.

For instance, in Figure 1, for switch S3, if S1 were root, three paths exist:

• S3 F0/1 to S1
• S3 F0/2 to S2, S2 F0/1 to S1
• S3 F0/2 to S2, S2 F0/4 to S4, S4 F0/1 to S1

All three paths could be S3’s lowest cost path to reach the root, depending on the per-VLAN port cost settings on the interfaces. Add them up, and choose the lowest cost.

As usual, if you know all the information, like all the per-VLAN port costs in this case, finding the root port is relatively simple. However, finding each root port with partial information can be much harder. The point of the puzzle is not to make the problem difficult just to be difficult, but to give us all a chance to think about exactly how a switch makes each STP choice.

## Determine the Designated Port

Each link between switches will have one designated port (DP). In some cases, finding the DP is easy, and in others, it requires that you know each switch’s root cost (RC). First, for review, switches use these rules to choose whether they are a DP on an interface:

1. If the switch is the only switch sending STP Hellos onto that link, for that VLAN, that port is a DP.
2. If the local switch hears Hellos from other switches, the switch advertising the lowest root cost wins, and becomes the DP.
3. If a tie occurs:
1. The switch with the lowest BID wins
2. If a tie still exists, the switch is somehow connected to itself for STP; break the tie by picking the port with the lowest internal port priority, and if a tie, the lowest internal port number.

Those rules are important, but for these puzzles, and then for the exam, you can go a little faster by stepping back for a moment and thinking about a few facts about STP. For instance, the root switch ha no RP port, and the other switches have exactly one RP. The root switch’s ports are all DPs, because they always win the DP election. Finally, on any switch-to-switch link, you end up with either an RP and DP on opposite ends, or a DP and a port in blocking state (because that port is neither RP nor DP). Summarizing what to do, and why:

1. Mark all ports on the root switch as DP. (The root switch’s local ports always win the DP election.)
2. Find any known RPs, and mark the port on the other end of the link as a DP.  (If a port is an RP, the port on the other end of the link will always be a DP.)
3. Find any known blocking ports, and mark the other end of the link as a DP. (For any port in a blocking state, it by definition lost the DP election on that link.)
4. Be careful on links with a known DP, because without more information, you don’t know if the other end is an RP or not.
5. Otherwise, use normal STP rules.

## Mark all non-RP and non-DP as Blocking

In an STP topology, RP and DP ports are placed in a forwarding state, and all the rest of the ports are placed into a blocking state. This part is simple: just note the ports that are neither RP nor DP, and you know the ports that block.

## Note What You Cannot Know

Finally, do not miss out on one of the best features of these puzzles: figuring out what you cannot possibly know. If you cannot determine the root switch, at least list the shorter list of possible root switches. If you can determine a switch’s RP, but not the root cost, note that fact. A lot of useful learning exists in uncovering those assumptions you may be making.

## Puzzle Rules

For each puzzle, you will be given a problem statement that includes the following kinds of facts:

• Switch Bridge ID
• Switch priority (a part of the bridge ID)
• Root port
• Per-VLAN port cost
• Per-VLAN port priority
• Notes about a switch using default settings

You can list your answers any way you like. Here in the blog, I will typically give some commentary that matches the sections in this overview post, and summarize the answer in a figure.

Some rules:

1. The puzzles use CCNA-level concepts only.
2. 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.
3. Unless otherwise stated, assume that the problem relates to the STP topology for VLAN 1
4. Unless otherwise stated, assume all switch-to-switch links are up and working physically, are performing VLAN trunking in the chosen VLAN. That is, the trunking state is not preventing STP from using the link.
5. Do *not* assume that the switches use default configuration.
6. If you have questions or comments, make sure and list you reasoning that leads up to the question or point.

That’s it. Ask questions on the process here if you have them, and engage on the puzzles as I get them posted. Enjoy!

Subscribe
Notify of

Inline Feedbacks

[…] 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 […]

[…] Overview of how to approach these STP puzzles […]

[…] Overview of how to approach STP puzzles […]

[…] Overview of how to approach STP puzzles […]

I hope all is well.

I am slightly confused with something which is mentioned in the CCNA book in regards to STP forward delay timer he said ‘

STP leaves the interface in each interim state for a time equal to the forward delay timer, which defaults to 15 seconds.

As a result, a convergence event that causes an interface to change from blocking to forwarding requires 30 seconds to transition from blocking to forwarding.

The interim states are listening + learning, so how much is each 7.5? Or is learning just the interim state of 15 seconds.

6
0