The Cisco Meraki MS series switch is compatible with industry standard STP (IEEE 802.1D) and RSTP (IEEE 802.1w). RSTP is used by default. Information on how to configure RSTP on a Cisco Meraki Switch can be found in the Configuring Spanning Tree on Meraki Switches (MS) article.
Confirming the correct root bridge election in a switched network is important for increasing the stability of a switched network. The root bridge is a central hub that can interconnects other legs of the network and can be exposed to heavy switching traffic. If the elected root bridge doesn't have the sufficient resources to handle the task,network performance may be affected. The root bridge is selected by manually configuring its bridge priority to a low value. 32768 is the default value out of a range from 0 to 61440. If all switches in a single spanning tree have the same bridge priority, the switch with the lowest MAC address will become the root bridge. The diagram below is an illustration of a scenario in which the elected root bridge might not be the optimal choice: In this diagram, Switches D and B comprise the core of the network, Switch A and C are access layer switches. Assuming all switches with their default bridge priority, because switch A has the lowest MAC address, it will be elected as a root bridge in this network . If the link between switch D and B is 1 gigabit and links between A and D as well as A and D are 100 Mbps, the Gigabit Ethernet link that connects switch D and swith B will be blocked, as a result of the election of Switch A as a root. This block causes all the data to flow via a 100-Mbps link across the access layer resulting in a non optimal layer 2 network.
To avoid the scenario above, it is important to determine what device in the switch fabric is acting as the Spanning-tree root bridge. In order to identify which MS switch is the Root Bridge, navigate to Switch > Monitor > Switches and select the desired switch. In the switch status area, take note of the field called RSTP Root as it will identify which switch is the Root Bridge.
Information on which switch is elected as the root bridge is accessible on the dashboard. Best practice dictates the root bridge to be the core of the network, this can be accomplished by manually setting the priority of the switch selected to be the root bridge. Information on enabling RSTP and setting the STP root bridge on a Cisco Meraki MS switch can be found in our Configuring Spanning Tree on Meraki Switches article.
07 Sunday Jul 2013
Posted in Spanning Tree Protocol≈ 34 Comments
In this post we will see how to manipulate STP root port selection in a given topology. We will use the VLAN 10 (management vlan) STP instance to see which ports will be Root Port in each switch. Any given switch Bridge ID consist of Bridge Priority (default 32768 + system extend ID) & MAC address. Since we are taking vlan10 as example default bridge priority will be 32778. Here are the basic rules of STP 1. Lowest bridge ID (Priority:MAC Address) switch becomes the Root-Bridge According to the topology CAT1 is having lowest MAC address (hence lowest bridge ID) & will become the Root Bridge. Butif you do not want to rely on MAC addreses you can lower priority of a given switch to make them as the Root Bridge for all VLANs. In my case will make priority for all Vlans to lowest value( which is 0) in CAT1. CAT1(config)#spanning-tree vlan 1-4094 priority ? <0-61440> bridge priority in increments of 4096 CAT1(config)#spanning-tree vlan 1-4094 priority 0 CAT1#sh spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 10 Address 0017.94ba.bc80 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 10 (priority 0 sys-id-ext 10) Address 0017.94ba.bc80 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 secNow we will look at which port become Root Port in each non-root bridges (CAT2,CAT3,CAT4). Root Port selection is based on the port having lowest cost to the Root Bridge (CAT1). For PVST (Per VLAN Spanning Tree) path cost will depend on bandwidth of links and cost value is as shown below for most commonly used links. 10Gbps -> 2 1 Gbps -> 4 100 Mbps -> 19 10 Mbps -> 100 Also it is important to understand how path cost calculate. From Root Bridge it will send BPDU with cost to Root Bridge as “0”. When this BPDU receive by any other switch it will add its own port cost (according to the above mentioned value). So if BPDU receive by a Fast Ethernet port (100 Mbps) it will calculate path cost to root as 19 (0+19). For CAT3, it has 3 different option (label b,t,p). Here Root Port choice is obvious, only via Fa 0/22 (b) is having lowest path cost to Root Bridge. So that will become the Root Port. For CAT2’s it has 4 different ports (label d,f,u,r). Out of which two ports (d & f) are having same path cost (19) to Root Bridge. Via port “u” it is having path cost of 38 & via port “r” it is having path cost of 57. Since we have two equal cost paths, you need to know tie breaking rules in this scenario. Here they are, 1. Lowest Sending Bridge ID In our case both port “d” & “f” receiving BPDU from same bridge (CAT1) which suggest “lowest port priority of sender” will be the tie breaker. By default each port is having priority value of 128 (can be 0-256 multiplier of 16). This makes “lowest interface number of sender” it tie breaker. In our case CAT1’s fa1/0/23 is having lower interface number & therefore that BPDU received by CAT2’s fa1/0/24 will become root port. CAT2#sh spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 10 Address 0017.94ba.bc80 Cost 19 Port 26 (FastEthernet1/0/24) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address 001a.e3a7.ff00 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa1/0/2 Desg FWD 19 128.4 P2p Fa1/0/21 Desg FWD 19 128.23 P2p Fa1/0/23 Altn BLK 19 128.25 P2p Fa1/0/24 Root FWD 19 128.26 P2pNow let’s see what will happen if you change CAT1’s fa1/0/24 port priority. Now if you look in CAT2 you would see Fa1/0/23 (connected to CAT1’s fa1/0/24) will become root port because of the lower port priority of sender. CAT2#sh spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 10 Address 0017.94ba.bc80 Cost 19 Port 25 (FastEthernet1/0/23) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address 001a.e3a7.ff00 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa1/0/2 Desg FWD 19 128.4 P2p Fa1/0/21 Desg FWD 19 128.23 P2p Fa1/0/23 Root FWD 19 128.25 P2p Fa1/0/24 Altn BLK 19 128.26 P2pFor CAT4, both port G0/3 “q” & G0/2 “s” are having equal path cost(38) to root bridge(CAT1). But in this case port “s” is getting BPDU from a lower bridge id switch CAT2 (32778: 001a.e3a7.ff00) comparison to port “q” from CAT3 (32778: 0024.137b.5a00). In this case Port “s” – G0/2 become root port & Port Priority or Interface ID won’t come into play. CAT4#sh span vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 10 Address 0017.94ba.bc80 Cost 38 Port 2 (GigabitEthernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address 58bf.ea59.f800 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 15 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi0/2 Root FWD 19 128.2 P2p Gi0/3 Altn BLK 19 128.3 P2pBut in here if you want to make G0/3 as root port you can change it’s port cost to a lower value which results lower path cost to root. In this example I will change it to cost of 1 which resulting path cost to root is 20 via that port. So that will become root port. CAT5(config-if)#spanning-tree vlan 10 cost ? <1-200000000> Change an interface's per VLAN spanning tree path cost CAT5(config-if)#spanning-tree vlan 10 cost 1 CAT5#sh spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 10 Address 0017.94ba.bc80 Cost 20 Port 3 (GigabitEthernet0/3) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address 58bf.ea59.f800 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi0/2 Altn BLK 19 128.2 P2p Gi0/3 Root FWD 1 128.3 P2pNow you know which port becomes a root port in each non-root switches. So Port “b”, “f” & “q” will become root port in this topology. If you want to identify which ports become Designated Ports (DP) you can follow below rules. 1. All ports in Root Bridge will become Designated Ports If a given link does not have a Root Port, either of them could be a designated port. But lower bridge ID switch port wins in this situation (“u” in “t-u” link & “r” in “r-s” link ) become a DP. In this way ports other than “d”, “t” & “s” will become either DP or RP. Hence those will become “FORWARDING” ports & others (d,t,s) become “BLOCKING” Ports as shown in the below diagram. Here is “show spanning tree vlan 10” output to verify the above. CAT2#sh spanning-tree vlan 10 Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa1/0/2 Desg FWD 19 128.4 P2p Fa1/0/21 Desg FWD 19 128.23 P2p Fa1/0/23 Root FWD 19 128.25 P2p Fa1/0/24 Altn BLK 19 128.26 P2p <- "port d" CAT3#sh spanning-tree vlan 10 Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa0/3 Desg FWD 19 128.3 P2p Fa0/21 Altn BLK 19 128.21 P2p <- "Port t" Fa0/22 Root FWD 19 128.22 P2p CAT4#sh spanning-tree vlan 10 Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi0/2 Altn BLK 19 128.2 P2p <- "port S" Gi0/3 Root FWD 1 128.3 P2pIn this way you can manipulate the Root Port selection of your network. References: |