cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5060
Views
5
Helpful
12
Replies

STP path define (Cost and Port-Priority)

Abdul salaam
Level 1
Level 1

Hi everyone.

In Spanning tree instance, I intentionally changed the path to root switch by changing the port cost on vlan1, when I changed the cost for port, it changed from root to alt block, but when i use port-priority it does not change any path and no affect.

only cost is used to change the path ? if both then why port-priority values changed higher still port is root while ?

 

Only it works when I change port cost !

Thank you

2 Accepted Solutions

Accepted Solutions

M02@rt37
VIP
VIP

@Abdul salaam 

When you changed the port cost on VLAN1, it caused the switch to recalculate the path to the root switch. Since the port cost on the current root port became higher than the new root port, the switch changed the path to the new root port. This is because the Spanning Tree Protocol uses the lowest-cost path to the root switch.

When you changed the port priority, it did not affect the path to the root switch because the port priority is only used when there is a tie in the port cost. If the port cost is lower on the current root port, changing the port priority alone will not change the path to the root switch. The switch will continue to use the current root port as the path to the root switch.

So, in summary, both port cost and port priority are used to determine the path to the root switch in STP. However, changing the port cost will have a more significant impact on the path selection than changing the port priority, as the port cost represents the actual cost of sending packets through the port.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

Because it never got to port priority tie-breaker; either port cost or MAC wins; add another link between Sw1 and sw2 and then manipulate port-priority. I just tested it on PT; it works (not all features do work in PT).

this looks like Percy's example in CLN, see

also see https://learningnetwork.cisco.com/s/question/0D53i00000Kt6RkCAJ/stp-designated-port-election

https://learningnetwork.cisco.com/s/question/0D56e0000CWyKQTCQ3/question-about-stp-designated-port-role-tie-breakers

Also I would recommend free videos you can find on utube; but if u going for CCNP/CCIE I would recommend INE video bundle by Brian M. If u still not sure, let us know.

 

Regards, ML
**Please Rate All Helpful Responses **

View solution in original post

12 Replies 12

M02@rt37
VIP
VIP

Hello @Abdul salaam 

In a Spanning Tree instance, the port cost is used to determine the path to the root switch. The lower the cost, the more preferred the path. Therefore, changing the port cost can change the path to the root switch.

Port priority is used to determine which port becomes the root port and which port becomes the designated port in case of a tie in the port cost. By default, the port priority is set to 128 for all ports, and the lower the priority value, the more preferred the port. However, changing the port priority alone may not change the path to the root switch. If the port cost on the current root port is lower than the port cost on the new root port, the switch will not change the path.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

M02@rt37
VIP
VIP

@Abdul salaam 

When you changed the port cost on VLAN1, it caused the switch to recalculate the path to the root switch. Since the port cost on the current root port became higher than the new root port, the switch changed the path to the new root port. This is because the Spanning Tree Protocol uses the lowest-cost path to the root switch.

When you changed the port priority, it did not affect the path to the root switch because the port priority is only used when there is a tie in the port cost. If the port cost is lower on the current root port, changing the port priority alone will not change the path to the root switch. The switch will continue to use the current root port as the path to the root switch.

So, in summary, both port cost and port priority are used to determine the path to the root switch in STP. However, changing the port cost will have a more significant impact on the path selection than changing the port priority, as the port cost represents the actual cost of sending packets through the port.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Abdul salaam
Level 1
Level 1

Thank you, I found it,  if we change the priority on none root switch it doesn't impact path change until it self fall to Root switch, but when we change the priority from the root switch toward none root switch then it works fine.

Lowest Bridge id = Root

Lowest Bridge id= mac plus priority, Bridge priority is default in all switches, then the lowest mac break the ties.

Lowest cost and lowest priority # is used for path shifting

if two switches connected point to point, same cost, same priority, then none root switch block the port based on highest port number from the root switch. 

Do I understood the concept correct ?

 

 

@Abdul salaam 

You have understood the basic concepts of STP correctly.

--The STP uses a Bridge ID to elect a root bridge. The bridge ID is a combination of the bridge priority and the MAC address. The bridge with the lowest bridge ID becomes the root bridge.

--All the other switches in the network elect a root port to forward traffic towards the root bridge. They also elect designated ports to forward traffic towards non-root bridges. All other ports on non-root switches are blocked.

--If a non-root switch has a lower bridge ID than the current root bridge, it will start forwarding traffic towards itself instead of the root bridge. This results in a topology change, and the STP recalculates the spanning tree.

--If the priority on a non-root switch is changed, it will not affect the spanning tree until the switch becomes the root bridge. However, if the priority on the root bridge is changed, the STP will recalculate the spanning tree, and all switches will adjust their port roles accordingly.

--If two switches are connected directly and have the same priority and cost, the switch with the higher port number will block its port, and the other switch will forward traffic.

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

one thing make me go hmmm....is this in the last sentence "the port based on highest port number from the root switch."

did u lab this ? if not, get Packet tracer (free from cisco net academy program) can help us at CCNA level teck.

Please see this diagram below :

PT.jpg

All I understood, just asking why changing port-priority F0/2 on SW2 does not change the path from Block to Forwarding state and does not block the F0/3 toward SW3 ?

I see changes only when i change port cost.

why port priority does not apply changes to path ?

Thank you.

Because it never got to port priority tie-breaker; either port cost or MAC wins; add another link between Sw1 and sw2 and then manipulate port-priority. I just tested it on PT; it works (not all features do work in PT).

this looks like Percy's example in CLN, see

also see https://learningnetwork.cisco.com/s/question/0D53i00000Kt6RkCAJ/stp-designated-port-election

https://learningnetwork.cisco.com/s/question/0D56e0000CWyKQTCQ3/question-about-stp-designated-port-role-tie-breakers

Also I would recommend free videos you can find on utube; but if u going for CCNP/CCIE I would recommend INE video bundle by Brian M. If u still not sure, let us know.

 

Regards, ML
**Please Rate All Helpful Responses **

Now I fully understood, and resolved the confusion I had, I tested that your statement is quiet correct.

Yes, when we connect to interfaces between two switches, assume (SW1 and SW2) point to point.

Example : SW1 with lowest Bridge ID become Root Bridge, and SW2 become Non-root, after port cost, port priority are the same, then port number break the tie and the lowest port number (interface number) win.

SW1 : Interface fast Ethernet 0/1 and interface fast Ethernet 0/2, the number of interface on none-root does not matter, No none-root switch block the port connected to Fast ethernet 0/2, so the port connected to Fast ethernet 0/1 become RP.

Thank you 

I will share Lab explain criteria that effect elect of root and ports. 
share tonight  

Martin L
VIP
VIP

You should use use port-priority when you have 2 links between switches.  Order of preference is Select Root switch based on BID priority and MAC address, Then, Select Root and DP Ports (Root port (RP) and designated port, DP) based on path Cost.  If cost is a tie, then use BID MAC address.  But if there still is a tie, like u have 2 links to up-stream switch,  then lower Port Priority wins.

Note that sender's port cost and port priority are used to evaluate path.

Regards, ML
**Please Rate All Helpful Responses **

this simple lab will show you all 
how the SW elect low birdge MAC 
how the SW elect port with different propriety 
how the SW elect port (root) with different cost. 

your last lab not give you full view of how STP elect process. 

Screenshot (381).png

Review Cisco Networking for a $25 gift card