Professional Documents
Culture Documents
storm are eliminated. As such, the physical links that form a loop
can be in place for the purpose of redundancy, but only a single
path will be forwarding frames at any point in time. Should the
active link fail, Spanning Tree will activate one of the redundant
links automatically. Unfortunately, it does take some time for
Spanning Tree to first of all recognize that a link has failed, and
secondly switch a previously blocked port to a forwarding state.
Once the network is back to forwarding frames normally, it is said to
have converged.
Spanning Tree Port States
On almost all Cisco switches, Spanning Tree Protocol is turned on by
default. The reason for this is simple, if it weren't, you might
accidentally create a network loop when configuring redundant
links. In that way, the default STP configuration is trying to save
you from yourself. On many older bridges and switches, STP was
often not configured by default, which could lead to some pretty
serious communication issues that could be difficult to track down.
On a switch or bridge running Spanning Tree, ports will be in one of
four different states. Each of these states is listed below. The
transition between states will be discussed shortly.
Listening. In this state, a port is listening to Spanning Tree
messages known as Bridge Protocol Data Units (BPDUs), attempting
to determine how the network is configured. When in a listening
state, a port is not forwarding frames.
Learning. In this state, a port is adding MAC addresses to its MAC
address table. When in a learning state, a port is also not
forwarding frames.
Forwarding. In this state, a port is sending and receiving data as
normal. Once a network has converged, a port will be in either a
forwarding or blocking state.
Blocking. In a blocking state, a port will not send or receive any
data traffic, but will still listen to STP BPDU messages. When a
address will win. In this way, a switch's MAC address acts as a type
of tiebreaker. Your goal should be to have a powerful and centrallylocated switch act as your Root Bridge if possible. The easy way to
ensure this is to configure it with a lower bridge priority value than
the other switches on your network.
But why all this fuss about the Root Bridge? Well, other switches
and bridges on an STP network need to calculate a path to the Root
Bridge in order to determine which of their ports will be placed in a
forwarding mode, and which will be blocked. Ultimately, a switch will
attempt to place the port with the "shortest" path to the Root Bridge
in a forwarding mode, and place all other redundant links in a
blocked state. In the case of STP, the "shortest" path is the one with
the lowest aggregate port cost to the Root Bridge. Port costs are
looked at in the next section.
Port Costs
Much like a Spanning Tree switch has a bridge priority value, so do
individual ports. By default, port costs are determined according to
the speeds that they support - the faster the port, the lower its
associated cost. The default IEEE costs associated with common
port speeds are listed in the table below.
Link Speed
Port
Cost
Gigabit Ethernet
Fast Ethernet
19
(100 Mbps)
Ethernet (10
100
Mbps)
Root Ports
The purpose of the Root Port is best illustrated with an example.
Consider the figure below. In it, there are three bridges, and Bridge
A has been made the Root Bridge, on account of the fact that it has
the lowest MAC address (notice that all bridge priorities are equal).
By default, all ports on the Root Bridge are also Root Ports, and
have a cost of 0 (Since they are directly connected to the Root
Bridge, their cost to reach the Root Bridge is 0).
Convergence
After learning about the Root Bridge, Root Ports, and Designated
Ports, it's time to bring it all together. Once the transfer of BPDUs
between systems has determined all of these factors, the network
will be loop free. However, the key to understanding the operating
of Spanning Tree lies in appreciating what happens when something
goes wrong, namely the failure of a link that is forwarding traffic.
Even once the STP topology of a network has been calculated,
switches will still be forwarding BPDUs every 2 seconds. These
messages serve to inform switches of which links are still
active, and which are not. For example, let's say that Bridge B in
our example was to fail or be powered down. In this case, Bridge C
will fail to receive BPDU messages from Bridge B on it's port 2
interface (remember that a port continues to listen to BPDU
messages, even which in a blocking state). After 20 seconds have
passed without Bridge C receiving a BPDU on port 2 from Bridge B,
Bridge C will assume that Bridge B is not available, and will transfer
into the listening state. The listening state lasts for 15 seconds, and
is the time when Bridge B will be listening to and inspecting BPDUs
from all other bridges. Recall that during the listening stage, the
bridge port will still not be forwarding traffic.
After the 15 seconds of the listening state is complete, port 2 will go
into a learning state for another 15 seconds. During this time, port
2 will be learning MAC addresses, as discussed earlier. As with the
listening state, port 2 will not be forwarding traffic during this
period.
Once the learning state is complete, port 2 will transition into
forwarding mode, where it will forward traffic as the active path to
the Root Bridge. At this point, the network is considered to be
converged. It's worth noting the amount of time that passes
between the transition from a blocking to a forwarding mode. In all,
this constitutes a total of 50 seconds - 20 seconds without receiving
BPDUs from the Designated Port, and 15 seconds each of both
listening and learning. During this time, no traffic would be
forwarded to or from Network 1(Segment BC). While some people