Answer to the #CCNA STP Question

certskills
By certskills July 29, 2013 09:56

No muss, no fuss, let’s dig into STP for #CCNA with the explanation and answer to the previous post’s STP question! Complete with pretty pictures!

(Wendell – #213.)

The Answer(s)

Answer(s): B, C

The Explanation

I organized the answers in the order shown on purpose so I could break down the explanation in the same order. Answers A and B build on each other, while C and D mostly stand alone. All require that you connect the show command output from the question to all those STP rules, so make sure and refer back to the question post!

Answer A (Incorrect)

The show spanning-tree vlan 10 command output from the original question gives you two ways to identify this answer as incorrect. First, the command lists two opening groups of messages: the first is about the root switch, and the second is about the local switch on which the command was entered. If the BID is different in these two message groups, then the local switch (Fred in this case) is not the root.

Second, note that the bottom of the output identifies port G0/2 as Fred’s RP (root port). Only non-root switches have an RP, so the fact that Fred has an RP rules out Fred as being the current root switch in VLAN 10.

Answer B (Correct)

Continuing to look at the command output, and adding to the analysis from answer A, we know:

  • Fred is not the root
  • Fred’s G0/2 is Fred’s root port

The show spanning-tree vlan 10 command output also lists Fred’s root cost, as well as the STP cost for each interface. In this case, the root cost is listed as 4 (first message grouping), and Fred’s G0/2 interface cost is listed as 4 (towards the end of the output). From these two facts, we can analyze as follows:

  1. The root switch always has a cost 0 to reach itself.
  2. The minimum STP interface cost is 1
  3. Fred’s G0/2 cost is 4
  4. If another switch sits between Fred and the root, Fred’s root cost must be at least 5 (Fred’s interface cost of 4, plus at least 1 from the interface cost of the switch between Fred and the root)

Therefore, no other switch could possibly be between Fred and the root. See figure 2 for a visual of the presumed switch between Fred and the root, with the blue items being the known items.

Figure 2: Minimum Root Cost for Fred if Another Switch Exists

Personally, I doubt Cisco would give you something this abstract on the real exam, but I though this answer would be kinda fun to think through with you. Ask questions if you have them!

Answer C (Correct)

Answer C again requires familiarity with the show spanning-tree vlan 10 command output. In this case, any ports currently in a blocking state would be listed at the bottom of the output, with the letters “BLK” under the heading “STS”. No ports are listed as blocking, making answer C correct.

Answer D (Incorrect)

While the analysis of answer C was simple, the analysis for answer D is pretty involved.

First, the question does not tell you anything about the topology of the LAN. What switch is connected to Fred’s G0/1 port? Literally, we know nothing about that switch – or even if there’s a switch connected to the other end of the cable – except what you can deduce from the command output on Fred.

So, what do we know?

  1. Fred’s G0/1 acts as a designated port.
  2. The question stem stated that no tiebreakers were used for picking root ports or designated ports.
  3. Fred’s root cost = 4.

Based on 1 and 2, you can deduce that if a switch exists on the other end of the cable connected to Fred’s G0/1, that switch must have a root cost >4. Why? If such a switch existed (call it Barney), Fred would advertise its Hello with Fred claiming a root cost of 4. Barney would send a Hello, root cost = x. Fred won (with a lower number), and it wasn’t a tie. So, Barney’s root cost must be at least 5.

More Practice Questions:

This question is like those you get if when you buy the ICND2 200-101 Official Cert Guide. This blog also lists various practice questions as well. For more questions on a large variety of topics:

#CCNA Fast Start: a Spanning Tree Question
#CCNA and #CCENT Lab Gear
certskills
By certskills July 29, 2013 09:56
Write a comment

22 Comments

  1. Borrodacho January 11, 06:14

    Hello. It’s clear why Fred’s switch is not the root, but…. In answer A you said “If the BID is different in these two message groups, then the local switch (Fred in this case) is not the root.” In our case we have the same 32778 in both groups…

    Reply to this comment
    • certskills Author January 12, 12:56

      Hi Borrachado,
      I agree, both the local switch (non-root; detailed in 2nd message group) and the root (detailed in 1st message group) have a priority of 32778. But the priority is only the 1st 1/4 of the BID. The last 3/4 is the MAC address of the switch. Note that the root has a different MAC address than the local switch (listed on the line below the respective listings of their priority settings). So, the root’s BID is different because its MAC is different than the local switch’s.
      Hope this helps,
      Wendell Odom

      Reply to this comment
      • Gabriel Moran July 26, 00:50

        I understand the logic behind this and why the answer is correct but the lab explicitly states to ignore all tiebreakers. What you just said right now is an example of a tiebreaker in the form of a lower mac address since the priorities on both switches was identical. If I am missing something please correct me, thank you.

        Reply to this comment
        • certskills Author July 28, 16:29

          Gabriel,
          The comparison to choose the root is between bridge ID’s, not between bridge priorities with then a tie causing the need for a tiebreaker of MAC address. So, from a purely human perspective, both ways are identical. However, it’s not “compare priority, then if a tie compare MACs”, but rather “compare BIDs”. So comparing the MACs isn’t literally a tie breaker.
          Hope this helps,
          Wendell

          Reply to this comment
  2. Ruben April 20, 18:13

    Hello Wendell!
    It’s me again 🙂 I have a little question for you to help me with:
    Concerning this exercise, on your ‘D’ explanation, you state that: “So, Barney’s root cost must be at least 5.” And I agree with that.
    But on the output of the show command on the related question, there is a cost of 4.

    (line 16 of the show command)
    Gi0/1 Desg FWD 4 128.25 P2p

    This means that there is a host connected? (default 4 for gigabit port?) If so should the output be P2P Edge instead?

    As usual, thank you for these side questions my friend! 🙂

    Reply to this comment
    • certskills Author April 24, 15:02

      Hey Ruben,
      No problem. Thanks for being gracious. You are also helping me clean up the posts a bit!
      Yep, that was a problem. I wrote this one I think in 2011. I’ve edited it to make a little more sense by changing the root cost to 5, so it could match the figure. I probably cheated a bit when I made this one, and didn’t catch that. Should at least be consistent now. Thanks!
      Wendell

      Reply to this comment
  3. Chris June 26, 10:39

    I am a little confused with your explanation of option B…
    I see that the Cost of the port from Switch Fred would be 4 but I don’t see where in the line the extra 1 would come from if the Root Switch will always have a root cost of 0 on it’s port.

    Reply to this comment
    • certskills Author July 5, 09:45

      Hi Chris,
      Take a look at the figure above, with Fred, the root, and one more switch between them. Fred connects with its port G0/2. Per the bottom of the command output, that port’s cost is 4. From the top of the output, we know Fred’s root cost is 4. Now think about the ports whose costs are added to determine Fred’s root cost, in this case:
      Fred’s G0/2 cost
      Middle switch’s top port’s cost

      Given the fact the the absolute minimum port cost is 1, Fred couldn’t have a port cost of 4 and a root cost of 4. These two cases could be true:
      Fred’s G0/2 cost is 3, with a cost 1 for that middle switch
      Fred’s G0/2 cost is 4, and Fred is directly connected to the root switch (aka the middle switch doesn’t exist)

      Does that help?
      Wendell

      Reply to this comment
      • Michael July 8, 12:21

        I confused with this answer, in the question you ask identify what is true, ok, option b) No other switches sit between Fred and the root switch, how can this be correct if the root cost is 5 and the root port cost is 4, a root switch as a cost of 0 I can’t see where the extra 1 has come from sorry it does not seem to make any sense.

        Thanks
        Michael

        Reply to this comment
        • certskills Author July 11, 11:24

          Michael,
          I finally see the issue. the switch’s root cost was supposed to be “4”. I wrote the answer all those years ago as if the root cost was 4. Looking back at the question and the exhibit in the question post, the root cost was 5. I’m sure that mistake was the cause of your confusion.
          Note that I updated the exhibit to show a root cost of 4 now, rather than revise big chunks of the explanation.
          Sorry about that,
          Wendell

          Reply to this comment
    • certskills Author July 11, 11:25

      Chris,
      From Michael’s comment, I just figured out the issue. You were thinking correctly, and I just didn’t see it. I thought the root cost was 4, and it was 5 in the original exhibit. (I had intended the exhibit to show a root cost of 4, so I edited the exhibit in the problem statement.) My apologies for the wild goose chase.
      Regards,
      wendell

      Reply to this comment
  4. Ruslan July 17, 12:35

    Hello Wendell!
    Im a littl bit confuced about explanation of answer B. If we change the dafault cost for gigabit interfaces to the lowest (1) then we can say that it is possible that at least one switch can sit between root bridge and Fred. Am I correct? please share your opinion

    Reply to this comment
    • certskills Author July 21, 12:07

      Rusian,
      Yes! Even with the (new) value of 4 for the port cost, with root cost of 5, then we know that one other switch must be in that particular root path.
      Wendell

      Reply to this comment
  5. HectorJ August 9, 23:30

    Regarding (D) answer:

    I took the following chart from page 75, Chapter 3. Spanning Tree Protocol Implementation.
    Book “CCNA Routing and Switching ICND2 200-105”

    Gi0/2
    SW1———SW2——-PC1
    | /Gi0/1
    | /
    | /
    | /
    | /
    | /
    | /
    | /
    | /
    | /
    | /
    | /
    | /
    | /
    |Gi0/1
    | / Gi0/2
    SW3

    This is “show spanning tree vlan 10” display from SW2 (which fits the shown in your example, I think)

    SW2#show spanning-tree vlan 10
    VLAN0010
    Spanning tree enabled protocol ieee
    Root ID Priority 32778
    Address 000B.BE80.4BAD
    Cost 4
    Port 26(GigabitEthernet0/2)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
    Address 0060.3E0B.E533
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 20

    Interface Role Sts Cost Prio.Nbr Type
    —————- —- — ——— ——– ——————————–
    Gi0/2 Root FWD 4 128.26 P2p
    Gi0/1 Desg FWD 4 128.25 P2p
    Fa0/12 Desg FWD 19 128.12 P2p

    (Obviously, switches adresses are not the same than your example)

    This is “show spanning tree vlan 10” display from SW3

    SW3#show spanning-tree vlan 10
    VLAN0010
    Spanning tree enabled protocol ieee
    Root ID Priority 32778
    Address 000B.BE80.4BAD
    Cost 4
    Port 25(GigabitEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
    Address 00D0.9791.AAD2
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
    Aging Time 20

    Interface Role Sts Cost Prio.Nbr Type
    —————- —- — ——— ——– ——————————–
    Gi0/1 Root FWD 4 128.25 P2p
    Gi0/2 Altn BLK 4 128.26 P2p

    SW2 would be Fred and SW3 would be Barney

    SW3 (or Barney, as you wish) root cost is 4, but you say that it should be greater than 4.

    1) I think that I’m missing something. Would you help me to clarify this issue?
    2) If issued the following command on SW3 gi0/1 interface (root port):

    int gi0/1
    spanning-tree vlan 10 cost 3

    What would be SW3 root cost shown with

    show spanning-tree vlan 10

    command?

    Reply to this comment
    • certskills Author August 10, 11:38

      Hi Hector,
      On your #1, I am unclear as to what comment of mine you’re asking about. If you could point to the specific wording, something I could search on, that’d be a help. This post has had a longish history, with one edit to the content of note, so it’s unclear to me what you’re referencing and if that still matters to the question.
      2) Yes, changing the interface cost in VLAN 10 to 3 would change SW3’s root cost to 3, because the only interface (in that scenario) that is part of the least-cost path to the root is that specific interface. That is, for the scenario on pp 74-76 in the book. (Of course, in this question, we’re wondering whether there could be another switch sitting between those two switches.)
      Hope this helps,
      Wendell

      Reply to this comment
  6. HectorJ August 9, 23:43

    Is there a limit of a post size? I tried to post a show spanning-tree command display, but it is not shown here

    Reply to this comment
    • certskills Author August 10, 11:39

      Hi Hector,
      As you can see, it’s there now. I was out of town, and just hadn’t gotten around to approving the post.
      Wendell

      Reply to this comment
  7. HectorJ August 15, 02:32

    Hi, Wendell. Firstable I apoligize for what I posted. Definitly something went wrong: that’s not the chart I tried to send and some parts
    are missing. Actually, when I posted it, didn’t appear. Sorry for the mess. Any way…

    It is all about the (D) answer.

    Watching Fred’s “#show spanning-tree vlan 10” display, I realized that it is practically the same that is shown on “CCNA Routing and Switching
    ICND2 200-105” book, page 76, for SW2. Page 75 shows the chart in which SW2 (the one that might be “Fred” Switch) is directly connected to
    a non-root SW3 switch, on its Gi0/1 interface. This chart shows Root SW1 switch directly connected Gi0/2 SW2 switch (“Fred”).

    SW3 (that we can fairly name “Barney”, according with the exercise) is directly connected to Root SW1 Switch, using SW3’s Gi0/1 port (being
    this one the root port).

    So we have a triangle.

    If I change SW3’s Gi0/1 interface cost to 3, SW3 would have root cost of 3 (remember, it port directly connects to the root switch) and this
    would be the SW3 advertised cost to SW2.

    So:

    The switch connected to SW2’s (SW2=Fred. SW3=) G0/1 port COULD HAVE a root cost of 3

    And it would fit with the display shown on this execise.

    I’m really aware about the fact that the cost to the root Switch SW1 through SW2’s Gi0/2 port is less than the SW3’s advertised root cost
    plus the one on Gi0/1 (the cost through Gi0/1 to the root switch) because, otherwise, SW2’s Gi0/2 port wouldn’t be SW’2 root port.

    So, in my opinion (D) answer would be correct.

    Am I’ missing something?

    Thanks on advance

    Reply to this comment
    • certskills Author August 15, 17:05

      Hector,
      Admittedly, I am a bit confused about the correlations you’re making with the example in the book, and I don’t think it’s necessary, so in my answer I will stick with the scenario posted here.

      Short version:
      There could be a switch off Fred’s G0/1 as you describe.
      It could have a root cost of 3, except that if so, the output shown for Fred would be different that the output shown in the question.
      Therefore, answer D is incorrect.

      Specifically, if that assumed neighboring switch had a root cost of 3, Fred’s G0/1 would not be the designated switch, and would be in a blocking state. That’s how we know.

      Sorry the detail in the answer D section wasn’t clearer.
      Regards,
      Wendell

      Reply to this comment
  8. HectorJ August 16, 01:30

    Hi, Wendell. You’ve made the point. This is what I was missing:

    “The designated port on each LAN segment is the switch port that advertises the lowest-cost Hello onto LAN segment”

    This is the wording I would use to explain (D) answer:

    Let’s call Barney to the neighbor switch directly connected to Fred’s G0/1 interface.
    They share a LAN segment.

    Problem states that Fred’s G0/1 interface is in forwarding state (according with
    Fred’s “show spanning-tree vlan 10” display).

    If Barney had a root cost of 3, it would announce it to Fred. Barney would use
    its interface which directly connects with Fred’s G0/1 port.

    Then the following rule is applied:

    “The designated port on each LAN segment is the switch port that advertises the lowest-cost
    Hello onto LAN segment”.

    Barney is advertising a lesser root cost than Fred’s throughout the shared LAN segment, which
    makes Barney’s port which directly connects to Fred’s G0/1, the designated port.

    Because of that, Fred’s G0/1 would be in blocking state, however, Fred’s “show spanning-tree vlan 10” displays
    shows that this is not true.

    So we must conclude that:

    1.- Fred’s non-root switch neighbor (the one on Gi0/1 interface) could not have a root cost of 3
    2.- This neighbor should advertise a root cost greater than 4 (which is Fred’s root cost), in order to
    keep Fred’s G0/1 interface in forwarding state as a designated port (in this case is like that because
    tiebraker rule of the lower BID switch is not being used).

    If this explanation is right or something is wrong or missing, please let me know.

    Thanks again

    Reply to this comment
  9. Jay Mahannah January 21, 12:07

    Broken link on Question; Is this from Chapter 9?

    Reply to this comment
View comments

Write a comment

Leave a Reply to HectorJ Cancel reply

Search

Categories