cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
855
Views
0
Helpful
2
Replies

stp : which interface choose between f0/1 & g0/1

Hi everyone,

I study for my ccna and I'm wondering about a problem with STP.

I think this question has already been asked but I can not find a concrete answer.

My topologies :

n°1

topo1

In this topology Sw0 is root with lowest BID, sw1 secondth, sw2 third and so on. Sw2 has a RP = 19, Sw3 has a RP = 8. Why on the segment between SW1/SW3 f0/2 = DP and G0/1 = BLK ?

n°2

topo2

So in this topology (i think understand but i need an outside view)

In this topology Sw4 is root with lowest BID, sw5 secondth, sw6 third and so on. Sw6 has a RP = 8, Sw7 has a RP = 4. Why on the segment between SW7/SW8 g0/1(sw7) = DP and G0/1(sw8) = BLK ?

Although I have my book ICND 2 under my eyes, this 2 topologies are a little complicated.

Best regards,

Julien

1 Accepted Solution

Accepted Solutions

Paul Chapman
Level 4
Level 4

Hi Julien -

Let me start with a quick history of STP.  STP was designed when hubs were still commonly in use, so we have this idea that at least 1 bridge (or switch) must "service" every link in the network.  This means that in the link furthest from the root which would cause a loop always has one bridge in forwarding and one in blocking.

How do we determine which bridge forwards and which one blocks?  All other things being equal, we will use end to end path cost.  This means that we can simply add the costs and make a reasonable prediction.  The costs are as follows (in standard STP): 10Mbps = 100, 100Mbps = 19, 1Gbps = 4.

Here are the path costs for the first topology:

  • Sw1 -> Sw0 = 19
  • Sw2 -> Sw0 = 19 (Link is running at 100Mb due to limitation on Sw0)
  • Sw3 -> Sw1 -> Sw0 = 38
  • Sw3 -> Sw2 -> Sw0 = 23
  • Sw1 -> Sw3 -> Sw2 -> Sw0 = 42
  • Sw2 -> Sw3 -> Sw1 -> Sw0 = 42

Based on this we can see that 1) the best cost from Sw3 to the root is via Sw2, and 2) Sw1 will service the link between Sw3 and Sw1 because Sw1 has the lower cost to the root.

For the second topology, here are the path costs:

  • Sw5 -> Sw4 = 4
  • Sw7 -> Sw4 = 4
  • Sw6 -> Sw5 -> Sw4 = 8
  • Sw6 -> Sw7 -> Sw4 = 8
  • Sw5 -> Sw6 -> Sw7 -> Sw4 = 12
  • Sw7 -> Sw6 -> Sw5 -> Sw4 = 12

Hmm... Now we have a dilemma. We have 2 equal cost paths to the root for Sw6.

We solve this by having a tie-breaking system to determine the best path to the root.

  1. Lowest root bridge ID received (mathematically MAC + Priority)
  2. Lowest cost to root bridge (as discussed above)
  3. Lowest sender bridge ID (MAC + Priority of neighboring bridge)
  4. Lowest sender port ID

For the SW6, we can predict that the first 2 tie breaks are equal for the BPDUs that upstream bridges send to it.  This means that we have to go to #3.

BPDUs actually contain quite a bit of information.  The 2 pieces that are important here are the "Root Bridge" and the "Designated Bridge" fields.  When a bridge receives a BPDU it compares the root ID in the BPDU to it's own ID.  If the bridge's ID is higher, then it forwards the root ID unchanged in BPDUs it sends to others.  It will also send it's own ID in the Designated Bridge field.

What does this mean for topology 2?  It means that Sw6 will receive the root ID and upstream bridge ID in BPDUs from both Sw5 and Sw7.  Since the Root ID and Cost are the same Sw6 will then compare the Designated Bridge IDs and choose the lower one.

Since you stated in the question that Sw5 ID < Sw7 ID, then we can predict that Sw6 will forward to the root via Sw5.

Sorry for the long answer, but you had a complicated question.

HTH

PSC

View solution in original post

2 Replies 2

Paul Chapman
Level 4
Level 4

Hi Julien -

Let me start with a quick history of STP.  STP was designed when hubs were still commonly in use, so we have this idea that at least 1 bridge (or switch) must "service" every link in the network.  This means that in the link furthest from the root which would cause a loop always has one bridge in forwarding and one in blocking.

How do we determine which bridge forwards and which one blocks?  All other things being equal, we will use end to end path cost.  This means that we can simply add the costs and make a reasonable prediction.  The costs are as follows (in standard STP): 10Mbps = 100, 100Mbps = 19, 1Gbps = 4.

Here are the path costs for the first topology:

  • Sw1 -> Sw0 = 19
  • Sw2 -> Sw0 = 19 (Link is running at 100Mb due to limitation on Sw0)
  • Sw3 -> Sw1 -> Sw0 = 38
  • Sw3 -> Sw2 -> Sw0 = 23
  • Sw1 -> Sw3 -> Sw2 -> Sw0 = 42
  • Sw2 -> Sw3 -> Sw1 -> Sw0 = 42

Based on this we can see that 1) the best cost from Sw3 to the root is via Sw2, and 2) Sw1 will service the link between Sw3 and Sw1 because Sw1 has the lower cost to the root.

For the second topology, here are the path costs:

  • Sw5 -> Sw4 = 4
  • Sw7 -> Sw4 = 4
  • Sw6 -> Sw5 -> Sw4 = 8
  • Sw6 -> Sw7 -> Sw4 = 8
  • Sw5 -> Sw6 -> Sw7 -> Sw4 = 12
  • Sw7 -> Sw6 -> Sw5 -> Sw4 = 12

Hmm... Now we have a dilemma. We have 2 equal cost paths to the root for Sw6.

We solve this by having a tie-breaking system to determine the best path to the root.

  1. Lowest root bridge ID received (mathematically MAC + Priority)
  2. Lowest cost to root bridge (as discussed above)
  3. Lowest sender bridge ID (MAC + Priority of neighboring bridge)
  4. Lowest sender port ID

For the SW6, we can predict that the first 2 tie breaks are equal for the BPDUs that upstream bridges send to it.  This means that we have to go to #3.

BPDUs actually contain quite a bit of information.  The 2 pieces that are important here are the "Root Bridge" and the "Designated Bridge" fields.  When a bridge receives a BPDU it compares the root ID in the BPDU to it's own ID.  If the bridge's ID is higher, then it forwards the root ID unchanged in BPDUs it sends to others.  It will also send it's own ID in the Designated Bridge field.

What does this mean for topology 2?  It means that Sw6 will receive the root ID and upstream bridge ID in BPDUs from both Sw5 and Sw7.  Since the Root ID and Cost are the same Sw6 will then compare the Designated Bridge IDs and choose the lower one.

Since you stated in the question that Sw5 ID < Sw7 ID, then we can predict that Sw6 will forward to the root via Sw5.

Sorry for the long answer, but you had a complicated question.

HTH

PSC

Hi Paul,

Thanks to your explanation. It's good to have a long answer if the details corresponding to the request and in this case it meets my needs.

thanks you Paul

Best regards

julien

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card