Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Spanning Tree Protocol – STP

Spanning Tree Protocol (STP) is an IEEE 802.1 standard, using software-based


spanning-tree algorithm on all bridge devices, including switcher, that blocks some ports
so that only one active connection remains between any LAN segment (collision
domain). . At the same time, it prevents loops that can occur with multiple active routes
between stops.

The spanning-tree algorithm is used in bridge and switcher based networks and decides
the best path that traffic can take from source to destination. This algorithm takes into
account all redundant paths and activates only one of them at any one time.

One root bridge per network in networks where Spanning-tree Protocol is actively used,
each non-root bridge has a root port, and each segment has a designated port for traffic
to pass through.

Some Spanning Tree Terms

• Bridge ID: The switcher's MAC address is its bridge ID. It is important for root
bridge selection in the network.
• Non-root bridge: All other bridges except root bridge are non-root bridge.
• Root port: The root port is always the one directly connected to or closest to the
root bridge.
• Designated port cost: It is considered if there is more than one non-root
connection between the two switchers. It is calculated by looking at the
bandwidth.
• Bridge Protocol Data Unit-BPDU: All switchers and bridges included in the
spanning-tree protocol in the same local area network (LAN) communicate with
each other via BPDU messages. BPDUs; It contains information such as
switcher's priority, port priority, port value, MAC address. The Spanning-tree
protocol also uses this information when selecting the root bridge, root port, and
assigned port.
• Convergence: Convergence occurs when all ports of switchers and bridges
transition from the blocking state to the transmitting state. Data is not transmitted
until convergence is complete. All devices must be updated before data can be
transmitted again. Convergence is important to ensure that all devices have the
same database, but it takes some time.

Root Bridge selection


The root bridge is the logical center of the spanning-tree topology in switched networks.
Each bridge on the topology claims to be root by sending messages called "hello
BPDU" to each other. In these messages;

• Identity of root bridge (BID): Initially, this value is its own ID as each bridge presents
itself as root bridge.
• Priority: It belongs to root bridge. Again, since each bridge presents itself as a root
bridge, this value is its own priority.
• The cost of reaching the root: Initially zero.
The root with the lowest priority in the root bridge selection process. If the priorities are
equal, the root with the lowest ID will be.

All other switches and bridges in the network are called non-root bridges.
Bandwidth STP Cost

4 Mbps 250

10 Mbps 100

16 Mbps 62

45 Mbps 39

100 Mbps 19

155 Mbps 14

622 Mbps 6

1 Gbps 4

10 Gbps 2

Responses to Network Change

Root bridges send "hello" BPDUs every two seconds to indicate that they are
operational. All other switches and bridges receive these BPDUs. If the "Hellos" are
coming from the path where the data is being moved, then the path to the root is still
standing. If there is a delay in receiving "Hello"s, the Spanning-tree process starts
again. The "Hello" BPDU defines the time bridges must wait while reacting to the
network change. These periods are; "Hello Time" is the longest waiting time (max age),
and forward delay.

• "Hello Time": Specifies how often the root will send by periodic "hello" BPDUs that
will be transmitted by successive bridge/switches. Its default time is 2 seconds.

• Longest wait time: The time the switch/bridges must wait after not hearing the
"hello"s before it changes the STP topology. Its default time is 20 seconds.
• Transmission delay: The time it takes for the interface to come from the blocking
state to the forwarding state.

In a stable network, STP operation works like this:

1. Root sends "hello" BPDUs from all its interfaces. (These BPDU’s cost 0.)

2. Neighbor switches/bridges add and forward "hello" BPDUs from non-root assigned
ports at their own cost.

3. Every switch/bridge in the network gets "hello" BPDU, it repeats step 2.

4. Each bridge repeats step 1 at each "hello time"

5. If a bridge/switch has not received a "hello" BPDU within the "hello time" period, it will
continue to operate normally for the longest waiting period, if it still has not received a
BPDU, it will react to change its STP topology.

Role of Spanning Tree Protocol

The spanning-tree algorithm puts each bridge and switch port in either a blocking or
transmitting state. These port states are;

• Blocking state: No frames can be sent or received from the ports, it only listens
to BPDUs. The purpose of this situation is to prevent the formation of loops. By
default, all ports are in the blocking state when the switchers are powered on.

• Listening State: Ports listen for BPDUs before relaying frames to ensure that
network loops are not occurring. In this state, ports are prepared to transmit data
without preparing the MAC address table.

• Learning State: Ports listen for BPDUs and learn all routes on the network.
Ports in this state start building the MAC address table but do not yet forward
frames.
• Forwarding State: Ports are considered to be in the active spanning-tree. All
transmit ports can receive and send frames.

• Disable State: The port in the passive (administrative) state does not participate
in frame forwarding and STP.

Spanning Tree Port States

Ports on Bridges and switches running STP switch between five different states.

• Blocking State: The port in the stack state does not forward frames, only listens
for BPDUs. The purpose of this situation is to prevent the formation of loops. By
default, all ports are in cluster state when switchers are powered on.

• Listening State: Ports listen for BPDUs before relaying frames to ensure that
network loops are not occurring. In this state, ports are prepared to transmit data
without preparing the MAC address table.

• Learning State: Ports listen for BPDUs and learn all routes on the network.
Ports in this state start building the MAC address table but do not yet forward
frames.

• Forwarding State: The port both sends and receives all data frames.

• Disable: The port in the passive (administrative) state does not participate in
frame forwarding and STP.

Switch ports are generally either in the transmit state or in the blocking state. Only when
the network topology changes (it happens when new switch is added or connection is
lost), ports can be in a listening and learning state.
Is MAC Address
Are Data Frames Is it a Temporary or
State Learned from Received
Transmitted? a Steady State?
Frames?

Blocking No No Steady

Listening No No Temporary

Learning No Yes Temporary

Forwarding Yes Yes Steady

You might also like