Spanning Tree and Port Priority

jezg76jezg76 Posts: 97Member ■■□□□□□□□□
Wendell Odom and I have had a lot of time together the past few months and I am trying to really hammer some STP into my brain before my boot camp in a few weeks.

I am having issues with port priority and when you have a tie with two links having the same cost to the root switch. Mr. Odom states the following:

"When a switch experiences a tie in regard to the cost to reach the root, the switch first uses the interfaces' port priority values as a tiebreaker. If the port priority values tie, the switch uses the lowest internal interface number."

To me this sounds like it is the non-root switches' interface, but after further reading on Cisco's site, it appears not to be. The site uses the following image to describe their view:

15f.gif

Initial Cat_R config:
Catalyst_R#show spanning-tree interface FastEthernet 3/1

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0001         Desg FWD 19        128.129  P2p 
VLAN0002         Desg FWD 19        128.129  P2p 

Catalyst_R#show spanning-tree interface FastEthernet 3/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0001         Desg FWD 19        128.130  P2p 
VLAN0002         Desg FWD 19        128.130  P2p 

Initial Cat_D config:
Catalyst_D#show spanning-tree interface FastEthernet 5/1

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0001         Root FWD 19        128.129  P2p 
VLAN0002         Root FWD 19        128.129  P2p 

Catalyst_D#show spanning-tree interface FastEthernet 5/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0001         Altn BLK 19        128.130  P2p 
VLAN0002         Altn BLK 19        128.130  P2p 

Now comes the part where it contradicts what I have read or thought I read. :D
You are going to decrease the port priority value for VLAN 1 on port 3/2. This way, the corresponding port 5/2 on Catalyst D receives better BPDUs than the ones that are sent on port 5/1 (that still has a port priority value of 12[IMG]https://us.v-cdn.net/6030959/uploads/images/smilies/icon_cool.gif[/IMG].

    Catalyst_R#config terminal
    Catalyst_R(config)#interface FastEthernet 3/2       
    Catalyst_R(config-if)#spanning-tree vlan 1 port-priority 64 
    Catalyst_R(config-if)#end
    Catalyst_R#



Catalyst_R now has the following:
Catalyst_R#show spanning-tree interface FastEthernet 3/1

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0001         Desg FWD 19        128.129  P2p 
VLAN0002         Desg FWD 19        128.129  P2p 

Catalyst_R#show spanning-tree interface FastEthernet 3/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0001         Desg FWD 19         64.130  P2p 
VLAN0002         Desg FWD 19        128.130  P2p 


Catalyst_D now has the following:
Catalyst_D#show spanning-tree interface FastEthernet 5/1

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0001         Altn BLK 19        128.129  P2p 
VLAN0002         Root FWD 19        128.129  P2p 

Catalyst_D#show spanning-tree interface FastEthernet 5/2

Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0001         Root FWD 19        128.130  P2p 
VLAN0002         Altn BLK 19        128.130  P2p 

Long story short, my question is, the port priority matters on the root switch and not the non-root switch? Is this something that has changed in newer IOS's? Dynamips can't come to the rescue like it normally does due to this being a switch question which can't be emulated perfectly.

Thanks in advance!
policy-map type inspect TACO
class type inspect BELL
drop log

Comments

  • mwgoodmwgood Posts: 293Member
    What is compared are the values received in the Hello messages from the forwarding switch.
  • EdTheLadEdTheLad Posts: 2,112Member
    The root bridge originates the bpdus, switch D receives bpdus on ports 5/1 and 5/2 , it compares the two bpdus received, both have the same bridge id so the port cost is checked.Port cost is dependent on the bw of the interface, in this case both have the same bandwidth so the senders port id is checked.The senders port-id consists of the senders port priority and the port number of the sending interface.The bpdu with the lowest port-id will be preferred so the interface which received the best bpdu will be root and the other interface with a lower priority bpdu is blocked.
    So in order to manipulate which port is forwarding or blocking on your local switch, you must configure the remote switch ports so that they will modify bpdu parameters on transmission.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • jezg76jezg76 Posts: 97Member ■■□□□□□□□□
    I thank you both for your explanations. Slowly, but surely, this is all making more sense. :)
    policy-map type inspect TACO
    class type inspect BELL
    drop log
  • tech-airmantech-airman Posts: 953Member
    jezg76 wrote:
    Wendell Odom and I have had a lot of time together the past few months and I am trying to really hammer some STP into my brain before my boot camp in a few weeks.

    I am having issues with port priority and when you have a tie with two links having the same cost to the root switch. Mr. Odom states the following:

    "When a switch experiences a tie in regard to the cost to reach the root, the switch first uses the interfaces' port priority values as a tiebreaker. If the port priority values tie, the switch uses the lowest internal interface number."

    To me this sounds like it is the non-root switches' interface, but after further reading on Cisco's site, it appears not to be. The site uses the following image to describe their view:

    jezg76,

    Sounds like you're confused because you're missing an intermediate step. The intermediate step that seems to be missing is the difference between CST and PVST+.

    As you may or may not know, basic "Spanning Tree Protocol" or STP for short has the assumption that you're dealing with a SINGLE VLAN. The STP process is:
    1. Electing the root bridge/switch
    2. Electing designated bridge(s)/switch(es)
    3. Port forwarding and blocking.

    Now, let's read what Mr. Odom is saying part by part. Mr. Odom said "When a switch experiences a tie in regard to the cost to reach the root,..." We know at least three things:
    1. Mr. Odom is talking about the Designated Bridge(s)/Switch(es).
    2. A cost comparison was done for the two ports on the Designated Switch and was found equal.
    3. The rest of the sentence talks about what happens when the cost is the same "...to reach the root [switch]...."

    As you may or may not know, the cost of a port is roughly the speed of the port divided by 1000. So a 1Gbps port would have an approximate cost of 1 and a 100Mbps port would have an approximate cost of 10. The purpose of the cost calculation and comparison is that if one port is a 1Gbps port and another is a 100Mbps port, it would be more preferable to send the STP traffic through the 1Gbps port than the 100Mbps port. However, what happens when the costs are equal?

    Mr. Odom said "... the switch first uses the interfaces' port priority values as a tiebreaker." Kinda like how the switch priority is used to elect the root switch, sounds like "port priority" is used to decide which port on the designated switch will become the root port. The root port as in the port that's used for forwarding BPDUs. Therefore the non-root port on the designated switch goes into blocking state. Now in the case where both cost and port priority are the same, just like root bridge/switch election, when Mr. Odom says "If the port priority values tie, the switch uses the lowest internal interface number." is basically saying the "lowest MAC address" comparison.

    Now, what I've been saying so far is assuming a single VLAN. When multiple VLANs are involved, it gets interesting. Non-Cisco switches uses Common Spanning Tree or CST for short. What that means is that just like basic STP with a single VLAN, a single root switch is elected for ALL VLANs. Then designated switches are elected for ALL VLANs. Then root ports are elected on the designated switch for ALL VLANS. So under CST, the system of root switch, designated switch(es) basically remains the same for each VLAN.

    Now, Cisco switches uses something different from CST and that is Per VLAN Spanning Tree or PVST for short. PVST is used for ISL trunking. PVST+ is used for 802.1q trunking. Now, as the name suggests, there's a SEPARATE Spanning Tree for EACH VLAN. So if you have VLANs 1, 2, 3, and 4, there are 4 separate root switch elections, 4 separate designated switch(es) elections, and 4 separate root port elections. The benefit of this apparent added complexity is part of it's beauty and usefulness. As you learned from modifying the port priority on the designated switch, instead of only one cable carrying all trunking traffic, you configured a load balancing situation where both ports on the designated switch are both operating and working. That turns a "wasted backup but unused switch port" into an "active load balancing useful port."

    I hope this helps.
  • EdTheLadEdTheLad Posts: 2,112Member
    Mr. Odom says "If the port priority values tie, the switch uses the lowest internal interface number." is basically saying the "lowest MAC address" comparison.

    Nope, senders port id is made up of port priority and port number, the port number is represented by a hex number.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
Sign In or Register to comment.