STP
Spanning Tree Protocol
• STP is used to reduce the effect of the broadcast frames in LAN networks.
- Block some ports on switches to prevent the broadcast frames to move in two opposite directions
- Make the propagation of the broadcast frame in one way only and prevent it in the reverse way.
Example:
- Assume three switches in a LAN network are connected in triangular form as shown :
- The costs of the links between switches are shown in the figure.
SW1 P2 P1 SW2
4
P1 P2
5 4
P2 SW3 P1
MAC addresses
SW1 [Link]
SW2 [Link]
SW3 [Link]
Note:
• If no STP protocol is applied to this network,
- The broadcast frame will propagat in clockwise and anticlockwise ( 2 opposite directions )
- Which causes bad performance of the network due to the broadcast storm,
• In the STP protocol we must assign the following
Root switch • The switch which control how the STP operates.
• It is elected as the lowest MAC address.
- root switch will be SW2 (from the table).
- As SW2 is the root switch so its ports must be always open (forward)
- P1/SW2 and P2/SW2
Root ports • The root ports are the facing port to the root switches on the other Switches
- P1/SW3 and P2/SW1 ports must be always open (forward)
Designated • The designated port is an open (forward) port but not directly connected to the root switch.
Blocking port - We still have two ports not assigned if forward (open) or blocked (closed).
- These two ports are: P1/SW1 and P2/SW3.
• To choose the designated port
1. We take the port who has the less costs to the root switch SW2.
- In this case the costs are equal 4+5 = 9
2. Assign the port on the less MAC address between the switches on the link(SW1,SW3).
- MAC address of SW1 < MAC address of SW3
- The port on SW1 (P1/SW1) will be the designated port and P2/SW3 is the blocked port.
• We can brief the functions of the port in STP in the following table
P1/SW1 Designated port forward
P2/SW1 root port forward
P1/SW2 port on root switch forward
P2/SW2 port on root switch forward
P1/SW3 root port forward
P2/SW3 Blocking port blocking