Is spanning tree important in switched networks?
What happens when you disable spanning tree?
Do you actually need spanning tree in a layer 2 Ethernet network?
Okay, so let's see what happens at the moment on both of these switches
A default configuration is being used so show spending tree shows us that spending tree is enabled on
the VLAN 1.
On switch 1 all ports of forwarding switch 1 is the root of the spanning tree, spanning tree is also
running on switch to on VLAN one the switch is not the root switch interface gigabit.
102 is blocking on this switch. So lets disable spanning tree conf t, no spanning tree VLAN 1. On
this side no spanning tree VLAN 1, so on switch 1, show spanning tree shows us that spanning tree is
disabled. On switch 2 show spanning tree shows us that spanning tree is disabled. Notice all ports
are now showing green no ports are being blocked. Please note that I'm running in simulation mode
in packet tracer and what I'm gonna do now is send a ping from PC 1 to PC2, PC 2s IP address
is 10.1.1.2, the MAC address of PC 2 is this.
On PC 1
IP address is 10 1.1.1, MAC address is this.
So what happens if we ping PC 2, we're sending an ICMP message but the PC doesn't know the MAC address
of PC 2, so it's gonna send an ARP into the network which is a broadcast and it's gonna try and
find out the MAC address of PC 2. I'm gonna click capture forward the ARP message is sent to the
switch
notice what happens.
It's sent to switch 2, switch 2 however duplicates the packet and floods it out of all ports so
it goes back to switch 1 on gigabit 101 and it's received by PC 2, so PC 2 is receiving
this broadcast
and now PC 1 is receiving the broadcast that it sent. Notice the source MAC address is
PC 1 destination is broadcast it's looking for the MAC address of PC 2, so PC 1 will drop that
packet.
But notice we now have multiple packets being flooded through the network.
PC 1 has received the ARP message once again so as PC 2. So PC 2 is receiving multiple ARP requests
from the network, the switches are also duplicating packets when we look at the MAC address table
of switch 2,
we can see that
PC 2 is found on gigabit 103 and PC 1 is found on gigabit 102.
Capture forward,
notice now the switch thinks that PC 2 is connected to gigabit 102 whereas in actual fact PC 2
is connected to gigabit 103.
Once again this is the MAC address of PC 2, so the switch is receiving conflicting information
previously it thought that PC 2 is connected to this port.
Now it thinks that PC 2 is connected to gigabit 101, so the switch previously thought that PC
2 is connected to 103 which is correct then it's thought that PC 2 is connected to 102 and now it
thinks that PC 2 is connected to 101, previously it's thought that PC 1 is connected to 102 then
to 101 and now to 102.
So the MAC address table is constantly being updated.
This is how broadcast storms happen in live networks
which can bring down an entire network.
We have duplication of packets,
we have mac address table instability, we have hosts receiving the packets that they sent out into the
network, such as here PC 1 receiving its own ARP request message.
Generally, we don't talk to ourselves and in the same way, a PC doesn't send a broadcast to itself like
we see in this network.
And if I continue doing that notice we constantly, we constantly have these ARP messages being duplicated
and flooded through the network. Packet tracer isn't showing all the duplication here
but notice this just continues on and on and on and can cause a broadcast storm and network meltdown
in a real network.
The same original packet is being duplicated multiple times.
Notice this is stolen ARP message
looking for the MAC address of PC 10.1.1.2
and if I continue to capture forward we just see those messages being sent continuously by the switches
throughout the network.
So is spanning tree important?
Definitely, should you disable spanning tree in a layer 2 network? In most cases no, layer 2 switch networks
are a single broadcast domain.
A broadcast gets flooded throughout a layer 2 domain.
If you had a more complex network like this your broadcast storm would be even worse.
Here's a very simple example of what happens when spanning tree is disabled, so I'll go back on to switch
1 and I'll re enable spanning tree.
I'll do something similar on switch 2 enable spanning tree.
Notice
now we see spanning tree messages being sent between the switches.
That's how the switches learn about one another
they are sending out BPDUs.
So in packet tracer, we can see the actual BPDU messages.c
I'll turn this back to real-time and what should happen now is the ports should transition to green
once the switches have learnt about one another
and decided to the root bridge is notice the ports are currently in the learning state, show spanning
tree on switch 2 we see something similar.
These ports are now forwarding, this port is blocking on switch 1 all ports have transitioned to the
forwarding state so we can now see that this port is blocking in Packet Tracer.
So let's do that ping again.
We've got an ARP message being sent into the network that now gets sent to switch 2 across port gigabit
101
it's sent to PC 2 but notice this packet is gonna be dropped.
The packet will not be forwarded out of port 102, spanning trees blocking that broadcast the packet
is only forwarded to PC 2.
We now have the ARP reply from PC 2 back to PC 1 so in the inbound PDU we can see target MAC address
target IP address.
Source MAC address is PC 2,
this is an ARP reply message gets sent across the top link to switch 1 and gets sent to PC 1 and
now PC 1 can send the ICMP message
using the top link to PC 2 and the reply can be sent back
to PC 1.
That's what we wanna see in an ethernet network.
We wanna have the devices communicating with each other. So hopefully this packet tracer demonstration
has shown you how important spanning tree is in a layer 2 switched network even in this small topology
the network breaks when spanning tree is disabled on both switches, make sure that you have a spanning
tree enabled on layer 2 switch networks unless you have a very good reason to disable spanning tree
on your switches.