Spanning Tree Cost command with uplinkfast

Finally getting around to studying for CCIE.  First week, and I'm already having issues (hoping its a lack of sleep).  I need some help understanding the spanning-tree cost command while uplinkfast is enabled.  I have 4 switches setup like the INE lab, with a loop setup:

SW1 - int fast0/13-15 - SW2 int fas0/13-15

SW2 - int fas0/19-21 - SW4 int fas0/16-18

SW4 - int fas0/19-21 - SW3 int fas0/19-21

SW3 - int fas0/13-15 - SW1 int fas0/16-18

 

Switch 1 is the Spanning tree root for all VLANS.  On SW2, I'm trying to make all traffic go through SW4.  I changed the port cost on 0/13-15 and the new Root port is Fas0/21 - just as expected.  This was lab1.19 and 1.20.

After lab 1.24 - I had uplinkfast enabled, which increased my costs on all switches by 3000.  I decided to go back and manipulate my costs on ports SW2 0/13-15 to once again make my traffic flow through SW4.  I changed the spanning-tree cost to 4000.  While debugging, I can see that TCNs are sent, and spanning tree is reconverging on SW2, but the strange thing is, it keeps port 13 as the root, even with a higher cost.  If I disable uplinkfast on all switches, they behave according to cost again.  Once I enable uplinkfast, SW2 uses a Root port with the higher cost again.  Uplinkfast is enabled on SW2,3,4 but not the root -SW1.  Any ideas on what's going on?


sw2(config-if-range)#do sh spann vlan 5


SVLAN0005

Spanning tree enabled protocol ieee

Root ID Priority 24581

Address 0026.0a05.fb80

Cost 4000

Port 15 (FastEthernet0/13)

Hello Time 2 sec Max Age 10 sec Forward Delay 20 sec

Bridge ID Priority 49157 (priority 49152 sys-id-ext 5)

Address 0018.baf8.2d80

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 20

Uplinkfast enabled

Interface Role Sts Cost Prio.Nbr Type

------------------- ---- --- --------- -------- --------------------------------

Fa0/13 Root FWD 4000 128.15 P2p

Fa0/14 Altn BLK 4000 128.16 P2p

Fa0/15 Altn BLK 4000 128.17 P2p

Fa0/19 Desg FWD 3019 128.21 P2p

Fa0/20 Desg FWD 3016 128.22 P2p

Fa0/21 Desg FWD 3015 128.23 P2p

 


sw2(config-if-range)#do sh spann vlan 5 det

VLAN0005 is executing the ieee compatible Spanning Tree protocol

Bridge Identifier has priority 49152, sysid 5, address 0018.baf8.2d

Configured hello time 2, max age 20, forward delay 15

Current root has priority 24581, address 0026.0a05.fb80

Root port is 15 (FastEthernet0/13), cost of root path is 4000

Topology change flag not set, detected flag not set

Number of topology changes 14954 last change occurred 00:10:34 ago

from FastEthernet0/19

Times: hold 1, topology change 30, notification 2

hello 2, max age 10, forward delay 20

Timers: hello 0, topology change 0, notification 0, aging 300

Uplinkfast enabled

Port 15 (FastEthernet0/13) of VLAN0005 is root forwarding

Port path cost 4000, Port priority 128, Port Identifier 128.15.

Designated root has priority 24581, address 0026.0a05.fb80

Designated bridge has priority 24581, address 0026.0a05.fb80

Designated port id is 128.15, designated path cost 0

Timers: message age 1, forward delay 0, hold 0

Number of transitions to forwarding state: 0

Link type is point-to-point by default

BPDU: sent 8, received 2089

Port 16 (FastEthernet0/14) of VLAN0005 is alternate blocking

Port path cost 4000, Port priority 128, Port Identifier 128.16.

Designated root has priority 24581, address 0026.0a05.fb80

Designated bridge has priority 24581, address 0026.0a05.fb80

Designated port id is 128.16, designated path cost 0

Timers: message age 1, forward delay 0, hold 0

Number of transitions to forwarding state: 0

Link type is point-to-point by default

BPDU: sent 2, received 2082

Port 17 (FastEthernet0/15) of VLAN0005 is alternate blocking

Port path cost 4000, Port priority 128, Port Identifier 128.17.

Designated root has priority 24581, address 0026.0a05.fb80

Designated bridge has priority 24581, address 0026.0a05.fb80

Designated port id is 128.17, designated path cost 0

Timers: message age 1, forward delay 0, hold 0

Number of transitions to forwarding state: 0

Link type is point-to-point by default

BPDU: sent 0, received 2082

Port 21 (FastEthernet0/19) of VLAN0005 is designated forwarding

Port path cost 3019, Port priority 128, Port Identifier 128.21.

Designated root has priority 24581, address 0026.0a05.fb80

Designated bridge has priority 49157, address 0018.baf8.2d80

Designated port id is 128.21, designated path cost 4000

Timers: message age 0, forward delay 0, hold 0

Number of transitions to forwarding state: 14

Link type is point-to-point by default

BPDU: sent 29817, received 19623

Port 22 (FastEthernet0/20) of VLAN0005 is designated forwarding

Port path cost 3016, Port priority 128, Port Identifier 128.22.

Designated root has priority 24581, address 0026.0a05.fb80

Designated bridge has priority 49157, address 0018.baf8.2d80

Designated port id is 128.22, designated path cost 4000

Timers: message age 0, forward delay 0, hold 0

Number of transitions to forwarding state: 11

Link type is point-to-point by default

BPDU: sent 28965, received 19840

Port 23 (FastEthernet0/21) of VLAN0005 is designated forwarding

Port path cost 3015, Port priority 128, Port Identifier 128.23.

Designated root has priority 24581, address 0026.0a05.fb80

Designated bridge has priority 49157, address 0018.baf8.2d80

Designated port id is 128.23, designated path cost 4000

Timers: message age 0, forward delay 0, hold 0

Number of transitions to forwarding state: 5

Link type is point-to-point by default

BPDU: sent 2654, received 504

 

Comments

  • Hello Jeff,

    I had this same problem when I was going through this lab and I'm glad I did, because it made me really dive deeper into STP.

    Check this out...

    F0/13 does in fact have a higher cost than f0/21, but if you look at it's placement in reagrds to the root bridge, it is directly connected. What this means is that the total end to end cost is only 4000 to reach the root bridge from this port. With all 3 ports f0/13-15 having the same path cost of 4000 to reach the root bridge, f0/13 is selected due to it having the lowest port-id.

    F0/21, even though it has a port cost of 3015, has a total end to end cost of 9053 to reach the root bridge (that's if you are using FastEthernet ports with the default STP cost of 19).

    Here's the breakdown:

    Calculating the end to end cost from port f0/21, the cost from SW2 - SW4 is 3015, from SW4 - SW3 is 3019 and from SW3 - SW1 is also 3019, so if you add those up together: 3015 + 3019 + 3019 you get 9053 for the total end to end cost.

    In order to make F0/21 the root port, you need to increase the cost on f0/13-15 higher than 9053, so putting a cost of 10000 should work.

    Remember, with STP, it's the lowest end to end cost to reach the Root Bridge that wins...

    Edwin

     

     

     

  • Just backing up what Edwin said.

     

    What you must remember is that when you do a show span vlan 5 and the switch shows you the spanning tree costs per port these are "local" cost only and do not inlcude the cost the neighbor is advertising to uss.  So when the switch receives a BPDU in it will look at the cost the neighbor is advertising and add the local cost to make the total cost.  The port with the lowest "total" cost will be the root port.

     

    You can see this in the detail output you pasted above:

     

    Port 15 (FastEthernet0/13) of VLAN0005 is root forwarding

    Port path cost 4000, Port priority 128, Port Identifier 128.15. << My local cost

    Designated root has priority 24581, address 0026.0a05.fb80

    Designated bridge has priority 24581, address 0026.0a05.fb80

    Designated port id is 128.15, designated path cost 0  << The cost to the root from the Designated bridge on this segment

     

    So 4000+0 = total cost of 4000 for F0/13

     

    We cannot see the cost of using F0/19, 20 and 21 as WE are the designated bridge so we are advertsing OUR cost down to SW4 meaning we have a better cost than Switch 4 to the root (or we have the same Cost but better Bridge ID)

     

    Port 23 (FastEthernet0/21) of VLAN0005 is designated forwarding

    Port path cost 3015, Port priority 128, Port Identifier 128.23.

    Designated root has priority 24581, address 0026.0a05.fb80

    Designated bridge has priority 49157, address 0018.baf8.2d80

    Designated port id is 128.23, designated path cost 4000   << Our cost of 4000 is better than SW4's cost

     

    You can check SW4's cost by looking at its root port with the show span detail command.

     

    The important point is the show span commands show LOCAL cost.  You need to add the neighbors cost to get the total.

     

    Nick

     

  • Thanks guys, that explains it.  Studied STP last year, but was drawing a blank on this one.  Went back and read about this in depth today.  Have to remember which commands show the root cost and which show local cost.  

Sign In or Register to comment.