Description | This article describes how the STP works. |
Scope | FortiSwitch. |
Solution |
STP is a Layer 2 protocol that enables Ethernet networks to build loop-free logical topologies. Switches that run STP, exchange Bridge Protocol Data Units (BPDUs) that contain information about the network topology. The switches then use the information in BPDUs to determine the root bridge and the cost of all links to the root bridge.
The switch with the lowest bridge ID is elected as the root bridge. The link with the lowest accumulated path cost to the root bridge is selected as the best link. The cost of a link is inversely proportional to its bandwidth. That is, the higher the bandwidth, the lower the cost, and vice versa.
Here is a table about FortiSwitch costs values: Port Speed | Default STP port cost 10 Mbps 2000000 100 Mbps 200000 1Gbps 20000 5Gbps 4000 10Gbps 2000 25Gbps 800 40Gbps 500 50Gbps 400 100Gbps 200
When the best link to the root bridge fails, the switch ports for the alternate links go through a series of STP states to determine the new best link. Ultimately, the switch enables the new best link to the root bridge and disables all other links.
When a redundancy with extra cable is added, it brings loops. For example:
Now there is a loop, both switches will keep forwarding over and over until one of the cables is disconnected, or the Switches will crash because of excessive traffic. It happens because ethernet frames do not have TTL value and for this reason, the loop will be forever.
With the Spanning tree, this situation is solved using BPDU (Bridge Protocol Data Unit) which has inside this frame two pieces of information in which STP is working:
Both pieces make up something called Bridge ID, BPDUs are sent between the switches, by default the priority is 32768 which is configurable. The root Bridge will be:
Another example here, the ports on the root bridge are always Designated and in a forwarding state. Non-root bridges are every switch that is not the root, they have to find the shortest path to the root bridge.
The shortest path to the root bride is called the root port. In order to decide which FortiSwitch between FortiSwitch2 and FortiSwitch3 will have the port down, the election will be again with the formula Bridge ID = Priority + MAC address. Lower is better because both switches have the same priority the tiebreaker is the lowest MAC, and CCC is lower than DDD, fort that reason FortiSwitch2 will have its port as Designated and FortiSwitch3 port as Alternate.
Remember, each time there are STP topologies, be careful about which Switch will be elected as a Root Bridge. It is possible to manipulate the priority, sometimes older Switches gain the battle and are used as root Switches because they have a lower MAC address. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.