Thursday 17 November 2011

Spanning tree Protocol : Difference between Port Priority and Path Cost

When you are working on Spanning tree protocol you know you are trying to make your network more predictable and trying to avoid loops even though redundant links are there.

One of the Questions always asked and is most confusing is " What is difference between STP Port Path cost and Port priority  ? " and " How STP Port path cost and Port Priority should be used ?".

The answer seems difficult to understand but once you do it. you know what it means.

Both the parameters are to be used to determine which of the interface should go in forwarding state.

The behavior and affect of both are different.

Cost is used on local switch to elect the root port of the device. The cost is accumulated up to the root bridge from each interface, and the least cost path to the root bridge becomes the root port on the local bridge.

Here, remember if you change any of the bridges path cost the whole switches in the topology are getting affected, because now again all the local switches has to recalculate the path cost for each port and decide for the designated port and the root ports.

Now for the Downstream switch the priority works. It is only applicable for the two directly connected switches and if you change priority on the local switch A, the Switch B connected in the down link direction will get affected. Higher the priority the less preferred the port.

Lets say         Switch A-------P1-------Switch B
                                  --------P2-------


Switch A and B are connected to each other with 2 ports so as to form a loop. Lets say Switch A becomes the root bridge, so both its ports will be in forwarding mode. Now for Switch B lets say P2 goes to blocking mode. So to make P1 in blocking mode and P2 in forwarding mode following things can be done:

1) Using Path Cost: Change Path cost in Switch B, P2 port and make it less than the P1 of Switch B..

2) Using Priority : Change priority in Switch A, P2 port and make it less than the P1 of Switch A.

Happy Learning !!!!