Friday, January 20, 2012

Understanding spanning-tree vlan root primary command

Today's lets understand the command "spanning-tree vlan <vlan-id> root primary. Its nothing but a macro which works like  this

The macro "spanning-tree vlan <vlanid> root primary" configured lets say on sw1 works as follows with only one exception

1. sw1 first tries to be the root bridge by setting its priority equal to the current root bridge(by increasing or decreasing its priority). It becomes root bridge if its mac address is lower than current root bridge.

2. If sw1's mac address is not lower than current root bridge then sw1 further reduces its priority by 4096 and becomes the root bridge.

3. Macro can not set sw1's priority to be 0 even if current root bridge has priority 4096+vlanid. This case may arise when sw1 mac address is higher than current root bridge and cuurent root bridge priority is 4096+vlanid.

4. The only exception to this rule is if current root bridge has priority anything over 28672+vlanid, then sw1 sets its priority to 24576+vlanid this happens only because it has to accomodate the priority of secondary root bridge which is always be 28672+vlanid. 

This macro is mainly designed for switches enabled with extended system-id.

No comments: