Got it

Understanding of STP - Basic Concepts Highlighted

Latest reply: May 3, 2021 12:46:57 433 19 18 0 4

OBJECTIVE


The purpose of this post is to present an introduction to the basic concepts STP protocol.


One Root Bridge


A tree topology must have a root. Therefore, the root bridge is introduced by STP.


There is only one root bridge on the entire STP-capable network. The root bridge is the logical center of but is not necessarily at the physical center of the entire network. The root bridge changes dynamically with the network topology.


After the network converges, the root bridge generates and sends out configuration BPDUs at specific intervals. Other devices process the configuration BPDUs so that the configuration BPDUs are advertised to the entire network, ensuring a stable network.


Two Types of Measurements


The spanning tree is calculated based on two types of measurements: ID and path cost


  • ID


IDs are classified into Bridge IDs (BIDs) and Port IDs (PIDs).


    • BID


IEEE 802.1D defines that a BID is composed of a 16-bit bridge priority and a bridge MAC address. The bridge priority occupies the leftmost 16 bits and the MAC address occupies the rightmost 48 bits. On an STP-capable network, the device with the smallest BID is selected to be the root bridge.


    • PID


The PID is composed of a 4-bit port priority and a 12-bit port number. The port priority occupies the left most 4 bits and the port number occupies remaining bits on the right. 


The PID is used to select the designated port


i_f42.gifThe port priority affects the role of a port in a specified spanning tree instance. For details, see STP Topology Calculation.


  • Path cost


The path cost is a port variable and is used to select a link. STP calculates the path cost to select a robust link and blocks redundant links to trim the network into a loop-free tree topology.


On an STP-capable network, the accumulative cost of the path from a certain port to the root bridge is the sum of the costs of all the segment paths into which the path is separated by the ports on the transit bridges.


Three Elements


There are generally three elements used when a ring topology is to be trimmed into a tree topology: ROOT BRIDGE, ROOT PORT, and DESIGNATED PORT. Figure 1 shows the three elements.


02


Figure 1 - STP network architecture


  • Root bridge


The root bridge is the bridge with the smallest BID. The smallest BID is discovered by exchanging configuration BPDUs.


  • Root port


The root port is the port with the smallest root path to the root bridge. The root port is determined based on the path cost. Among all STP-capable ports on a network bridge, the port with the smallest root path cost is the root port. There is only one root port on an STP-capable device, but there is no root port on the root bridge.


  • Designated port


For description of the designated bridge and designated port, see Table 1.


ObjectDesignated BridgeDesignated Port
Device

Device Device that forwards configuration BPDUs to a directly connected device

Designated bridge port that forwards configuration BPDUs to a device
LANDevice that forwards configuration BPDUs to a network segmentDesignated bridge port that forwards configuration BPDUs to a network segment.

Table 1 - Description of the designated bridge and designated port


As shown in Figure 2, AP1 and AP2 reside on S1; BP1 and BP2 reside on S2; CP1 and CP2 reside on S3.


    • S1 sends configuration BPDUs to S2 through AP1. S1 is the designated bridge of S2, and AP1 on S1 is the designated port.


    • Two devices, S2 and S3, are connected to the LAN. If S2 is responsible for forwarding configuration BPDUs to the LAN, S2 is the designated bridge of the LAN and BP2 on S2 is the designated port. 


03



Figure 2 - Networking diagram of the designated bridge and designated port


After the root bridge, root port, and designated port are selected successfully, the entire tree topology is set up. When the topology is stable, only the root port and the designated port forward traffic. All the other ports are in the Blocking state and receive only STP protocol packets instead of forwarding user traffic.


Four Comparison Principles


STP has four comparison principles that form a BPDU priority vector {root BID, total path costs, sender BID, port ID}.


Table 2 shows the port information that is carried in the configuration BPDUs.


FieldBrief Description
Root BIDEach STP-capable network has only one root bridge.
Root path costThe distance between the port sending configuration BPDUs to the root bridge determines the path cost to the root bridge.
Sender BIDBID of the device sending configuration BPDUs.
Port IDPID of the port sending configuration BPDUs.

Table 2 - Four important fields


After a device on the STP-capable network receives configuration BPDUs, it compares the fields shown in Table 2 with that of the configuration BPDUs on itself. The four comparison principles are as follows:


i_f42.gifDuring the STP calculation, the smaller the value, the higher the priority.


  • Smallest BID: used to select the root bridge. Devices running STP select the smallest BID as the root BID shown in Table 2.


  • Smallest root path cost: used to select the root port on a non-root bridge. On the root bridge, the path cost of each port is 0.


  • Smallest sender BID: used to select the root port when a device running STP selects the root port between two ports that have the same path cost. The port with a smaller BID is selected as the root port in STP calculation. Assume that the BID of S2 is smaller than that of S3 in Figure 1. If the path costs in the BPDUs received by port A and port B on S4 are the same, port B becomes the root port.


  • Smallest PID: used to block the port with a greater PID but not the port with a smaller PID when the ports have the same path cost. The PIDs are compared in the scenario shown in Figure 3. The PID of port A on S1 is smaller than that of port B. In the BPDUs that are received on port A and port B, the path costs and BIDs of the sending devices are the same. Therefore, port B with a greater PID is blocked to cut off loops.


04


Figure 3 - Topology to which PID comparison is applied



Five Port States


Table 3 shows the port status of an STP-capable device


Port StatePurposeDescription
Forwarding

A port in Forwarding state can forward user traffic

and process BPDUs.

Only the root port and designated port 

can enter the Forwarding state.

Learning

When a device has a port in the Learning state, the device creates a MAC address table based on the received user traffic but does not forward user traffic.

This is a transitional state, which is designed to prevent temporary loops.
ListeningAll ports are in the Listening state when STP calculation is being implemented to determine port roles.This is a transitional state.
Blocking

A port in the Blocking state receives and forwards

only BPDUs, not user traffic.

This is the final state of a blocked port.
Disabled
A port in Disabled state does not process BPDUs or forward user traffic.The port is Down.

Table 3 - Port states


Figure 4 shows the process of the state transition of a port.


05



Figure 4 - State transition of a port


i_f42.gifA Huawei datacom device uses MSTP by default. After a device transitions from the MSTP mode to the STP mode, its STP-capable port supports the same port states as those supported by an MSTP-capable port, including the Forwarding, Learning, and Discarding states. For details, see Table 4.



Port StatusDescription
ForwardingA port in Forwarding state can forward user traffic and process BPDUs.
Learning

A port in the Learning state learns MAC addresses from user traffic to construct a MAC address table. A port in Learning state processes BPDUs.

DiscardingA port in the Discarding state can only receive BPDUs


Table 4 - Port Status


The following parameters affect the STP-capable port states and convergence.


  • Hello time


The Hello timer specifies the interval at which an STP-capable device sends configuration BPDUs and Hello packets to detect link faults.


When the network topology becomes stable, the change made on the interval takes effect only after a new root bridge takes over. The new root bridge adds certain fields in BPDUs to inform non-root bridges of the change in the interval. After a topology changes, TCN BPDUs will be sent. This interval is irrelevant to the transmission of TCN BPDUs.


  • Forward Delay


The Forward Delay timer specifies the delay for interface status transition. When a link fault occurs, STP recalculation is performed, causing the structure of the spanning tree to change. The configuration BPDUs generated during STP recalculation cannot be immediately transmitted over the entire network. If the root port and designated port forward data immediately after being selected, transient loops may occur. Therefore, an interface status transition mechanism is introduced by STP. The newly selected root port and designated port do not forward data until an amount of time equal to twice the forward delay has past. In this manner, the newly generated BPDUs can be transmitted over the network before the newly selected root port and designated port forward data, which prevents transient loops.


i_f42.gifThe Forward Delay timer specifies the duration of a port spent in both the Listening and Learning states. The default value is 15 seconds. This means that the port stays in the Listening state for 15 seconds and then stays in the Learning state for another 15 seconds. The port in the Listening or Learning state is blocked, which is key to preventing transient loops.


  • Max Age


The Max Age time specifies the aging time of BPDUs. The Max Age time can be manually configured on the root bridge.


Configuration BPDUs are transmitted over the entire network, ensuring a unique Max Age value. After a non-root bridge running STP receives a configuration BPDU, the non-root bridge compares the Message Age value with the Max Age value in the received configuration BPDU


    • If the Message Age value is smaller than or equal to the Max Age value, the non-root bridge forwards the configuration BPDU.


    • If the Message Age value is larger than the Max Age value, the configuration BPDU ages and the non-root bridge directly discards it. In this case, the network size is considered too large and the non-root bridge disconnects from the root bridge.


i_f42.gifIf the configuration BPDU is sent from the root bridge, the value of Message Age is 0. Otherwise, the value of Message Age indicates the total time during which a BPDU is sent from the root bridge to the local bridge, including the delay in transmission. In real world situations, each time a configuration BPDU passes through a bridge, the value of Message Age increases by 1.


Table 5 shows the timer values defined in IEEE 802.1D.


ParameterDefault ValueValue Range
Hello time200100-1000
Max Age2000600-4000
Forward Delay1500400-3000

Table 5 - Values of STP parameters (in centisecond)


--- End


  • x
  • convention:

Unicef
MVE Created Apr 30, 2021 03:32:28

WELL DONE
View more
  • x
  • convention:

Chanbora
Created Apr 30, 2021 04:13:02

nice
View more
  • x
  • convention:

smileymind
Created Apr 30, 2021 04:22:51

good post
View more
  • x
  • convention:

carlosalcosta
Created Apr 30, 2021 10:32:11

Nice. That's new for me
View more
  • x
  • convention:

Faridrami
Created Apr 30, 2021 16:33:02

Excelent my friend
View more
  • x
  • convention:

MangoKnight
Created Apr 30, 2021 16:39:54

Wow !
View more
  • x
  • convention:

Saqib123
Saqib123 Created Apr 30, 2021 18:31:47 (0) (0)
 
Saqib123
Saqib123 Created Apr 30, 2021 18:31:54 (0) (0)
 
alopez
MVE Author Created Apr 30, 2021 16:40:07

Spectacular post.
Thanks for sharing this content!!Understanding of STP - Basic Concepts-3913637-1
View more
  • x
  • convention:

Saqib123
Created Apr 30, 2021 18:31:38

Thanks for sharing
View more
  • x
  • convention:

LilStylz237
Created Apr 30, 2021 19:07:39

Thanks for sharing
View more
  • x
  • convention:

12
Back to list

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.