The main purpose of STP’s is to stop network loops from occurring on your layer-2 network (bridges or switches). STP takes up a task such as constantly monitoring the network to find all links and make sure that loops do not occur by shutting down redundant links.
STP protocols finds all links in the network and shuts down redundant links, thereby stopping any network loops from occurring in the network. The way it does this by selecting a root bridge that will decide on the network topology.
There can only be one root bridge in any given network. Root-bridge ports
are called designated ports and performs its operations in a forwardingstate
ports. Forwarding-state ports send and receive traffic.
Other switches in your network are called non root bridges, However, the port with the lowest cost to the root bridge is called a root port and sends and receives
traffic. Ports determined to have the lowest-cost path to the root bridge are called
designated ports. The other port or ports on the bridge are considered nondesignated and will not send or receive traffic, which is called blocking mode.