What is Spanning Tree Protocol (STP)?

Spanning Tree Protocol (STP) is an IEEE 802.1 standard and blocks some ports to keep only one active link between any LAN segment (collision domain) using the software-based spanning-tree algorithm on all bridge devices, including switchers. It also prevents cycles that may occur with multiple active paths between stops.

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

For networks where the Spanning-tree Protocol is actively used, one root bridge per root network (the root bridge), one non-root bridge (root port) for each non-root bridge, and traffic to pass through each segment. there is one designated port.

Some Spanning Tree Terms

  • Bridge ID: The MAC address of the switcher is its bridge ID. It is important for root bridge selection in the network.
  • Non-root Bridge: All other bridges, except the root bridge, are non-root bridges.
  • Root Port: The root port is always the port that is directly connected to the root bridge or closest.
  • Designated Port Cost: If there is more than one root connection between two switchers, it is taken into consideration. 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 with BPDU messages. BPDUs are; It includes information such as the 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 the ports of the switchers and bridges go from the blocking state to the transmission state. Data is not transmitted until convergence is complete. All devices need to 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 spanning-tree topology in switched networks. Each bridge on topology sends messages called “hello BPDU” to each other and claims that it is the root. In these messages;

  • The identity of the root bridge (BID): This value is its own ID, as each bridge initially shows itself as the root bridge.
  • Priority: It belongs to the root bridge. Again, this value is its priority, as every bridge shows itself as the root bridge.
  • 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 switchers and bridges in the network are called non-root bridges.

BandwidthSTP Cost
4 Mbps250
10 Mbps100
16 Mbps62
45 Mbps39
100 Mbps19
155 Mbps14
622 Mbps6
1 Gbps4
10 Gbps2

Responses to Network Exchange

Root bridges send the “hello” BPDUs they send every two seconds to indicate that they are working. All other switchers and bridges receive these BPDUs. If “Hellos” come from the path where the data is moved, the path to the root is still standing. Spanning-tree operation starts again if there is a wait in receiving “hello”. “Hello” BPDU defines the time that bridges should wait while responding to the network change. These times are; “Hello Time” is the longest waiting time (max-age) and forward delay.

  • “Hello Time”: Indicates how often the root will send periodically “hello” BPDUs to be transmitted by bridges/switch in succession. The default duration is 2 seconds.
  • Longest Waiting Time: It is the time that the switch/bridges have to wait for the STP to change the topology after hearing the “hello”. The default duration is 20 seconds.
  • Transmission Delay: The time it takes for the interface to change from the blocking state to the forwarding state.

STP operation in a stable network works as follows:

  1. The root sends “hello” BPDUs from all its interfaces. (The cost of these BPDUs is 0.)
  2. Neighbor switch/bridges add and transmit “hello” BPDUs to their cost from non-root designated ports.
  3. Repeats step 2 when each switch/bridge “hello” in the network receives the BPDU.
  4. Each bridge repeats step 1 at every “hello time”
  5. If a bridge/switch did not receive “hello” BPDU during the “hello time” period, it continues to operate normally for the longest waiting time, if it still does not receive the BPDU, the STP reacts to change the topology.

The Mission of the Spanning Tree Protocol

The Spanning-tree algorithm brings each bridge and switcher port to one of the blocking or transmission states. These port states;

Blocking state: Frame cannot be sent or received from ports, it only listens to BPDUs. The purpose of this situation is to prevent the formation of loops. When the switchers are operated, all ports are in the blocking state by default.

Listening State: Ports listen to BPDUs before passing the frames to ensure that no looping occurs in the network. While the ports are in this state, they are prepared to transmit data without preparing the MAC address table.

Learning State: The ports listen to BPDUs and learn all the paths in the network. Ports in this state begin to form the MAC address table, but do not transmit frames yet.

Forwarding State: The ports are considered to be in an active spanning-tree. All of the transmission ports can receive and send frames.

Disable State: The passive state does not participate in frame transmission and STP.

Spanning Tree Port States

Ports on Bridge and switchers running STP switch between five different states.

Blocking State: The port in the heap state does not transmit frames, it only listens to BPDUs. The purpose of this situation is to prevent the formation of loops. By default, all ports are heaped when switchers are operated.

Listening State: Ports listen to BPDUs before passing the frames to ensure that no looping occurs in the network. While the ports are in this state, they are prepared to transmit data without preparing the MAC address table.

Learning State: The ports listen to BPDUs and learn all the paths in the network. Ports in this state begin to form the MAC address table, but do not transmit frames yet.

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

Passive (Disable): The passive (administrative) port does not participate in frame transmission and STP.

Related Posts

What is Packet Tracer?
What is CCIE?
Cisco Boot Process
What is GNS3
What is ARP