Spanning Tree Protocol

  • In modern Ethernet networks, reliability depends heavily on redundancy.
    Network Engineers often connect switches with multiple links so that if one cable fails, another can instantly take over.

    Redundant network topology with three switches and two PCs before STP activation.

    Figure 1 – Basic Redundant Network Topology

    Why would we have a network loop ?

    In a typical network topology you can have multiple paths leading to a destination and having multiple paths can be dangerous. Let me show you with the example below:

    How Loops Happen

    Imagine a simple network with three interconnected switches (SW1, SW2, SW3) and two devices (PC1 and PC2).

    Each switch is linked to the others for redundancy. In this setup:

    1. PC1 sends a broadcast request (ARP request to communicate with PC2).

    PC1 sends ARP broadcast request through switch SW1 to locate PC2 on the network

    Figure 2 – PC1 Sends an ARP Request (Broadcast)

    2. The switches forward the broadcast to all ports excluding the one it arrived.

    SW1 flood the ARP broadcast to all of his ports except the one that received the arp broadcast

    Figure 3 – SW1 Floods the ARP Broadcast

    3. SW2 and SW3 receive the broadcast and again send this broadcast to all of theirs ports, creating a network loop.

    broadcast frame form a loop\n

    Figure 4 – SW2 and SW3 Flood the Broadcast Again (Loop Begins)

    Answer the question below