Introduction to Spanning-Tree

Ok for the first point (PVST) but for the second one, it is not clear for me …
" Don’t use the same VLAN on more than one switch " … so i have to use one VLAN by switch that it will be never appear on antoher switch ?
and then playing with a router-on-stick ?
So what if i have more than one vlan and existing on another switch -> PVST ?
Is that the explanation ?
Thks in advance

Let me try to explain it a bit more, let’s say that we are using the topology from this article with the 3 switches in a triangle. Imagine that we have some printers behind SWA, SWB and SWC.

With layer 2 switches we create a single VLAN, configure it on all switches and add the printers to this VLAN. We can use a single subnet for this VLAN. This works but spanning-tree will block an interface since there is a loop within this VLAN.

In (new) network designs we try to restrict a VLAN to a single switch so that we don’t have to deal with spanning-tree. We replace our layer 2 switches with layer 3 switches that can do routing. Instead of 1 VLAN for our printers, we create 3 VLANS:

- one vlan for the printers on SWA
- one vlan for the printers on SWB
- one vlan for the printers on SWC

These VLANs are only configured locally on the switch, they are not used on the other switches. Each VLAN will have its own subnet.

Since we have different subnets, we have to “route” from one subnet to the other. Our layer 3 switches support routing protocols like EIGRP or OSPF.

The advantage of these routing protocols compared to spanning-tree is that they can “load-balance” when there are multiple links while spanning-tree will block an interface. Convergence is also faster, this means that they are able to recover from changes in the topology very quickly…faster than spanning-tree.

This is a bit a “high level” design story but I hope you get the idea :slight_smile: Let me know if you want more details…

1 Like

Great Great Great ! :slight_smile:

Hats off, The Artist !

Hi Rene,

You mentioned that in Blocking state it takes 20 seconds before we connect cable to switch’s interface port. Why it is taking 20 secs in blocking state before changing to listening state.
How can we change Bridge ID Priority for a switch?

Thanks,
Maruti.

Hi Maruti,

STP has a couple of timers:

- Hello timer
- Forward delay
- Maximum age

The blocking state is defined with the maximum age timer which is 20 seconds by default. The listening and learning state is defined by the forward delay.

Changing the priority is simple, there are two commands you can use:

spanning-tree vlan 1 priority 8192

This one is the most simple one, it changes the priority per VLAN. The other one is:

spanning-tree vlan 1 root primary

This is a macro…it will check the priority of the current root bridge and then sets the priority lower so this switch becomes the root bridge.

Hope this helps!

Rene

Thanks Rene!

For SWA since it is the ROOT bridge in this triangle diagram, and its both ports going to other switches ( one to switch c and one to switchb). Shouldn’t the root switch show its all ports are designated?

why in the example it shows
Fa0/14 Desg FWD 19 128.16 P2p
Fa0/17 Root FWD 19 128.19 P2p

Hi Atif,

In my first example, SWA was the root bridge. However in the configuration section you can see that SWC was elected as root bridge.

Rene

Hi,

What mode would you suggest to use for STP when you have two switches connected via Trunk Ports and servers are multi home. This requires NIC teaming and have same vlan on both switches for redundancy.

Thanks,
Nav

Hi Nav,

The only STP mode that is really used nowadays is rapid PVST (or MST if you have a lot of VLANs on all switches).

Rene

Hi Rene.

Question.

Does SSTP (single spanning tree) work same manner?

Hi Alberto,

Yes it’s pretty much the same thing. Cisco IOS switches only support PVST, RPVST and MST though. They don’t use the “classic” spanning-tree anymore.

Rene

Easy and clean read in regards to spanning-tree. Great job.

  1. Root bridge switch reload, does the secondary switch take over immediately or it go through STP election and eventually become Root? 2.Root bridge switch went down, does all the switches in the domain go through STP?

Hi Lawrence,

It will have to go through another STP election. The only reason we have a “secondary switch” is that it has a lower priority so we know that it will become the next root bridge in case the first one fails.

Rene

Hello Rene ,

Root ID    Priority    32769
             Address     000f.34ca.1000
             Cost        19
             Port        18 (FastEthernet0/16)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

i’m wondering about this part in switch B “Port 18 (FastEthernet0/16)” … what is the number 18 stands for ?? and i notice it is 19 in switch A !!
and what about the “Aging Time 300” … could you explain it please
best regards.

Hi Hussein,

Spanning-tree apparently uses its own numbering for interfaces. The aging time of 300 seconds is about the MAC address table, when a switch doesn’t hear a host for 300 seconds then the MAC address is removed from the MAC address table.

Rene

Hi Rene,

when a switch evaluates interface speed to determine cost does is evaluate to ports speed capability or the configured speed? I always see example where 1 interface in a segment will be 1gbps and the other side is an fastethernet port. So while one switch may have a 1gbps port, the speed would be running at 100mbps.

 

Thanks

19 posts were merged into an existing topic: Introduction to Spanning-Tree

Hi Adam,

It will be the configured speed:

SW1#show running-config interface GigabitEthernet 0/1
Building configuration...

Current configuration : 132 bytes
!
interface GigabitEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
end
SW1#show spanning-tree interface GigabitEthernet 0/1 

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001            Root FWD 4         128.2    Shr

Above you can see the default cost of 4 for a Gigabit interface. Let’s change the speed:

SW1(config)#interface GigabitEthernet 0/1
SW1(config-if)#speed 100

The new cost is:

SW1#show spanning-tree interface gigabitEthernet 0/1

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0001            Root FWD 19        128.2    Shr

19, the default for a 100Mbit interface.

Hope this helps!

Rene

2 Likes