Introduction of Spanning Tree Protocol (STP)
In a LAN, redundant links are added to improve the network availability of LAN. But this redundant links may cause frame to loop in the network for infinite time until some action is taken, e.g, some links are taken down. To cope with problem of frame looping, Spanning Tree Protocol (STP) comes into play.
Need for Spanning Tree :
Consider the scenario below with 3 switches with one user attached to each switch.
Arvind sends a broadcast frame to LAN and as nature of switch frame are send out from other ports (Gi0/1 & Gi0/2) except receiving port (Fa0/3). Now, this frame goes to SW2, SW2 also broadcast frame out of Gi0/2 and Fa0/2 ports. SW1 receives frame in its Gi0/1 ports. SW1 also broadcast frame then this frame goes to SW3 and frame broadcasting goes on. Remember that this frame broadcast also occurs in other direction from SW3 out of Gi0/1 port. Above discussed frame looping was from SW3’s Gi0/2 ports. You can imagine the frame flooding in that small LAN. This forever looping of frames around LAN is called Broadcast storm.
This Looping of frames causes three problems as stated below:
- MAC table instability –
Due to looping of frame around LAN, MAC-Table of switch get changed frequently. Looping causes incorrect MAC-table entries resulting in incorrect frame delivery.
- Broadcast Storm –
Repeated forwarding of frames around links in LAN causes the inefficient use of links.
- Multiple Frame Transmission –
A very serious negative effect of looping is that multiple copies of same frame are delivered to host. This process left host with confusion.
How Spanning Tree Protocol helps ?
Spanning tree protocol prevent looping of frames around LAN by placing ports of switch in either forwarding or blocking state. Interfaces (ports of switch) which are in forwarding state act as normally but Interfaces in blocking state doesn’t process any frame received except STP messages and other important overheads. Blocking Interfaces doesn’t learn MAC addresses, don’t forward frames and don’t process received frames.
Now if we again consider the above discussed scenario with SW3’s Gi0/2 interface in blocking state.
- Arvind sends the frame to SW3.
- SW3 forwards frame only to Gi0/1 port as Gi0/2 port is in blocking state.
- Now SW1 receives frame and forward to Fa0/1 and Gi0/1 interfaces.
- SW2 receives frame and forward to Fa0/2 and Gi0/1 interfaces.
- SW3 will receive the frame on Gi0/2 interface but ignores the frame as it is in blocking state.
In this way looping of frame around LAN can be prevented by using STP.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.