138
PathCost:
Path cost is the cost of transmitting a frame on to a LAN through that port. It is
recommended to assign this value according to the speed of the bridge, the slower the media,
the higher the cost.
How STP Works?
After a bridge determines the lowest cost-spanning tree with STP, it enables the root port and the
ports that are the designated ports for connected LANs, and disables all other ports that participate
in STP. Network packets are therefore only forwarded between enabled ports, eliminating any
possible network loops.
STP-aware switches exchange Bridge Protocol Data Units (BPDUs) periodically. When the
bridged LAN topology changes, a new spanning tree is constructed. Once a stable network
topology has been established, all bridges listen for Hello BPDUs (Bridge Protocol Data Units)
transmitted from the root bridge. If a bridge does not get a Hello BPDU after a predefined interval
(Max Age), the bridge assumes that the link to the root bridge is down. This bridge then initiates
negotiations with other bridges to reconfigure the network to re-establish a valid network
topology.
802.1D STP
The Spanning Tree Protocol (STP) is a link layer network protocol that ensures a loop-free
topology for any bridged LAN. It is based on an algorithm invented by Radia Perlman while
working for Digital Equipment Corporation. In the OSI model for computer networking, STP
falls under the OSI layer-2. Spanning tree allows a network design to include spare (redundant)
links to provide automatic backup paths if an active link fails, without the danger of bridge loops,
or the need for manual enabling/disabling of these backup links. Bridge loops must be avoided
because they result in flooding the network.
The Spanning Tree Protocol (STP) is defined in the IEEE Standard 802.1D. As the name suggests,
it creates a spanning tree within a mesh network of connected layer-2 bridges (typically Ethernet
switches), and disables those links that are not part of the tree, leaving a single active path
between any two network nodes.
STP switch port states
Blocking - A port that would cause a switching loop, no user data is sent or received
but it may go into forwarding mode if the other links in use were to fail and the
spanning tree algorithm determines the port may transition to the forwarding state.
BPDU data is still received in blocking state.
Listening - The switch processes BPDUs and awaits possible new information that
would cause it to return to the blocking state.
Learning - While the port does not yet forward frames (packets) it does learn source
addresses from frames received and adds them to the filtering database (switching
database)
Forwarding - A port receiving and sending data, normal operation. STP still monitors
incoming BPDUs that would indicate it should return to the blocking state to prevent
a loop.