Sunday, June 20, 2010

Playing with Spanning Tree MST on multiple regions

Hi all,

This weekend I was playing with MST in a (undocumented :-( ) lab, and I want to share some tests I've done hoping this will help you to better feel with MST.

In particular, I will focus on what happens when we have multiple MST regions, like in this topology:



I used the INE topology, as usual, but with only two links enabled between switches, just to simplify, then I created 10 vlans, here are the relevant parts of the initial config:


!--- SW1 & SW2 initial config
vlan 1-10
!
spanning-tree extend system-id
spanning-tree mode mst
spanning-tree mst configuration
name MST-1-2
!
interface FastEthernet0/13
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/14
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/15
shutdown
!
interface FastEthernet0/16
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/17
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/18
shutdown
!
interface FastEthernet0/19
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/20
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/21
shutdown

!--- END SW1 & SW2 initial config

!--- SW3 & SW4 initial config
vlan 1-10
!
spanning-tree extend system-id
spanning-tree mode mst
spanning-tree mst configuration
name MST-3-4
!
interface FastEthernet0/13
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/14
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/15
shutdown
!
interface FastEthernet0/16
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/17
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/18
shutdown
!
interface FastEthernet0/19
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/20
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/21
shutdown
!--- END SW3 & SW4 initial config


To better understand what will happens, we have to recall the operation of MST:
-inside a region (defined with the "name" command), the MST will elect a "Regional Root" for the MST instance 0, using the same rules as 802.1w: lowest bridge id (priority + vlan id/mst id & base mac ) will be the root
-if you have multiple instances, each instance will have also his Root
-between regions and/or with other stp speaking devices, only the regional root will interact blocking/forwarding some ports.
-in addition, only one MST Regional Root can become the so called CIST ROOT, that is the Common Instance Root, or the root of the common stp domain, which is the root of the regional roots and the other stp/rstp devices.

With our simple initial config applyed, we expect to have:
-A Regional Root for MST region "MST-1-2"
-A Regional Root for MST region "MST-3-4"
-one of these regional roots be elected CIST Root

Let's start looking on base mac addresses on the switches to predict what to expect, without modifying root priority:

SW1#sh ver | inc MAC
Base ethernet MAC Address: 00:13:1A:56:35:80

SW2#sh ver | inc MAC
Base ethernet MAC Address: 00:13:1A:56:0E:80

SW3#sh ver | inc MAC
Base ethernet MAC Address: 00:13:1A:55:80:00

SW4#sh ver | inc MAC
Base ethernet MAC Address: 00:13:1A:56:51:00


So we can predict, leaving the default priority:
-on region MST-1-2: the SW2 base mac address is less (0E:80) than SW1 base mac (35:80). So SW2 will be the regional root for MST-1-2 region
-on region MST-3-4: SW3 base mac is less than SW4 base mac, so SW3 will be regional root for MST-3-4 region
-between the two regions, you have to compare the regional roots mac addresses: SW3 = 00:13:1A:55:80:00 and SW4 = 00:13:1A:56:51:00 So SW3 is less, will win the election and become CIST Root.

What will happen to the ports?
For each MST region, each switch will put in FW state the closest port to the regional root, using the same rules of rstp (cost/priority/lowest port number)
between regions, the Regional Root will choose to put in FW state the port with the better cost to the CIST root, same rules again.

At the end of stp convergence we expect something like:


Let's verify on the switches:

SW1# sh spanning-tree mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a56.3580 priority 32768 (32768 sysid 0)
Root address 0013.1a55.8000 priority 32768 (32768 sysid 0)
port Fa0/13 path cost 200000
Regional Root address 0013.1a56.0e80 priority 32768 (32768 sysid 0)
internal cost 200000 rem hops 19
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/13 Root FWD 200000 128.13 P2p
Fa0/14 Altn BLK 200000 128.14 P2p
Fa0/16 Altn BLK 200000 128.16 P2p Bound(RSTP)
Fa0/17 Altn BLK 200000 128.17 P2p Bound(RSTP)
Fa0/19 Altn BLK 200000 128.19 P2p Bound(RSTP)
Fa0/20 Altn BLK 200000 128.20 P2p Bound(RSTP)


SW2#sh spanning-tree mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a56.0e80 priority 32768 (32768 sysid 0)
Root address 0013.1a55.8000 priority 32768 (32768 sysid 0)
port Fa0/16 path cost 200000
Regional Root this switch
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/13 Desg FWD 200000 128.13 P2p
Fa0/14 Desg FWD 200000 128.14 P2p
Fa0/16 Root FWD 200000 128.16 P2p Bound(RSTP)
Fa0/17 Altn BLK 200000 128.17 P2p Bound(RSTP)
Fa0/19 Altn BLK 200000 128.19 P2p Bound(RSTP)
Fa0/20 Altn BLK 200000 128.20 P2p Bound(RSTP)


SW3#sh spann mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a55.8000 priority 32768 (32768 sysid 0)
Root this switch for the CIST
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/13 Desg FWD 200000 128.13 P2p
Fa0/14 Desg FWD 200000 128.14 P2p
Fa0/16 Desg FWD 200000 128.16 P2p
Fa0/17 Desg FWD 200000 128.17 P2p
Fa0/19 Desg FWD 200000 128.19 P2p
Fa0/20 Desg FWD 200000 128.20 P2p


SW4#sh spann mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a56.5100 priority 32768 (32768 sysid 0)
Root address 0013.1a55.8000 priority 32768 (32768 sysid 0)
port Fa0/19 path cost 0
Regional Root address 0013.1a55.8000 priority 32768 (32768 sysid 0)
internal cost 200000 rem hops 19
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/13 Desg FWD 200000 128.13 P2p
Fa0/14 Desg FWD 200000 128.14 P2p
Fa0/16 Desg FWD 200000 128.16 P2p
Fa0/17 Desg FWD 200000 128.17 P2p
Fa0/19 Root FWD 200000 128.19 P2p
Fa0/20 Altn BLK 200000 128.20 P2p


some observations:
-on SW1, the ports connected to the other region's switches are marked as "Bound(RSTP)", and they are in BLK state
-on SW2, all the ports connected to the same region are in FW state, like expected on a root, but the ports connected outside the region are marked as "Bound(RSTP)" too, and only one is forwarding to te CIST root.
-on SW3 and SW4 there aren't "Bound" ports, since they are on the region that has the CIST root.

What happens if SW1 will loose both links to SW2 ?
The Region MST-1-2 will result partitioned, then both SW1 and SW2 will be Regional Root for each part of the region, and they will have a FW port to the CIST root.

SW2(config)#int range fa 0/13-14
SW2(config-if-range)#shutdown

*Mar 1 03:52:01.295: %LINK-5-CHANGED: Interface FastEthernet0/13, changed state to administratively down
*Mar 1 03:52:01.395: %LINK-5-CHANGED: Interface FastEthernet0/14, changed state to administratively down
*Mar 1 03:52:02.295: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/13, changed state to down
*Mar 1 03:52:02.395: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/14, changed state to down
SW2(config-if-range)#do sh spann mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a56.0e80 priority 32768 (32768 sysid 0)
Root address 0013.1a55.8000 priority 32768 (32768 sysid 0)
port Fa0/16 path cost 200000
Regional Root this switch
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/16 Root FWD 200000 128.16 P2p Bound(RSTP)
Fa0/17 Altn BLK 200000 128.17 P2p Bound(RSTP)
Fa0/19 Altn BLK 200000 128.19 P2p Bound(RSTP)
Fa0/20 Altn BLK 200000 128.20 P2p Bound(RSTP)


SW1#
*Mar 1 03:52:02.063: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/13, changed state to down
*Mar 1 03:52:02.143: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/14, changed state to down
*Mar 1 03:52:03.083: %LINK-3-UPDOWN: Interface FastEthernet0/13, changed state to down
*Mar 1 03:52:03.163: %LINK-3-UPDOWN: Interface FastEthernet0/14, changed state to down
SW1# sh spann mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a56.3580 priority 32768 (32768 sysid 0)
Root address 0013.1a55.8000 priority 32768 (32768 sysid 0)
port Fa0/16 path cost 200000
Regional Root this switch
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/16 Root FWD 200000 128.16 P2p Bound(RSTP)
Fa0/17 Altn BLK 200000 128.17 P2p Bound(RSTP)
Fa0/19 Altn BLK 200000 128.19 P2p Bound(RSTP)
Fa0/20 Altn BLK 200000 128.20 P2p Bound(RSTP)


Ok, let's recover the partitioned region and ... what's happens if I lower the root priority on SW1?
I bet it will become the CIST root and SW2 will have all ports in FW state without the "Bound" type...

SW1(config)#spann mst 0 prio 0

!-- let's wait a little, give it the time to reconverge
SW1(config)#do sh spann mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a56.3580 priority 0 (0 sysid 0)
Root this switch for the CIST
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/13 Desg FWD 200000 128.13 P2p
Fa0/14 Desg FWD 200000 128.14 P2p
Fa0/16 Desg FWD 200000 128.16 P2p
Fa0/17 Desg FWD 200000 128.17 P2p
Fa0/19 Desg FWD 200000 128.19 P2p
Fa0/20 Desg FWD 200000 128.20 P2p


SW2(config-if-range)# do sh spann mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a56.0e80 priority 32768 (32768 sysid 0)
Root address 0013.1a56.3580 priority 0 (0 sysid 0)
port Fa0/13 path cost 0
Regional Root address 0013.1a56.3580 priority 0 (0 sysid 0)
internal cost 200000 rem hops 19
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/13 Root FWD 200000 128.13 P2p
Fa0/14 Altn BLK 200000 128.14 P2p
Fa0/16 Desg FWD 200000 128.16 P2p
Fa0/17 Desg FWD 200000 128.17 P2p
Fa0/19 Desg FWD 200000 128.19 P2p
Fa0/20 Desg FWD 200000 128.20 P2p


SW3# sh spann mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a55.8000 priority 32768 (32768 sysid 0)
Root address 0013.1a56.3580 priority 0 (0 sysid 0)
port Fa0/13 path cost 200000
Regional Root this switch
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/13 Root FWD 200000 128.13 P2p Bound(RSTP)
Fa0/14 Altn BLK 200000 128.14 P2p Bound(RSTP)
Fa0/16 Altn BLK 200000 128.16 P2p Bound(RSTP)
Fa0/17 Altn BLK 200000 128.17 P2p Bound(RSTP)
Fa0/19 Desg FWD 200000 128.19 P2p
Fa0/20 Desg FWD 200000 128.20 P2p


SW4#sh spann mst

##### MST0 vlans mapped: 1-4094
Bridge address 0013.1a56.5100 priority 32768 (32768 sysid 0)
Root address 0013.1a56.3580 priority 0 (0 sysid 0)
port Fa0/19 path cost 200000
Regional Root address 0013.1a55.8000 priority 32768 (32768 sysid 0)
internal cost 200000 rem hops 19
Operational hello time 2 , forward delay 15, max age 20, txholdcount 6
Configured hello time 2 , forward delay 15, max age 20, max hops 20

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/13 Altn BLK 200000 128.13 P2p Bound(RSTP)
Fa0/14 Altn BLK 200000 128.14 P2p Bound(RSTP)
Fa0/16 Altn BLK 200000 128.16 P2p Bound(RSTP)
Fa0/17 Altn BLK 200000 128.17 P2p Bound(RSTP)
Fa0/19 Root FWD 200000 128.19 P2p
Fa0/20 Altn BLK 200000 128.20 P2p


As expected, SW3 is now only Regional Root, SW1 is CIST root.

In case of multiple instances, the instances are significant only in the same region, outside the region, only the Regional Root will have a forwarding port to the CIST root.


have a nice studying/working/labbing week!
Marco

1 comment:

Byas said...

very nice. Thx Christian Biasibetti