Spanning Tree Protocol builds a loop-free path through a switched network by electing a root bridge and blocking redundant ports. That keeps Ethernet frames from circling endlessly, while backup links remain ready to restore connectivity if a link fails. Rapid STP can bring the network back faster.

Multiple Choice

Which protocol prevents network loops by creating a tree structure?

The idea being tested is how to prevent loops in a switched network by creating a single, loop-free topology. Spanning Tree Protocol does this by building a tree that spans all switches in a network. It exchanges information (BPDUs) to elect a root bridge, calculates the best path to the root based on path costs, and then blocks redundant ports to ensure there is only one active path between any two devices. This blocking removes potential cycles, so frames don’t loop endlessly. If a link fails, STP can re-enable a blocked port to re-establish connectivity, and modern variants like Rapid Spanning Tree Protocol converge much faster. In contrast, the other options are Layer 3 routing protocols and don’t prevent Layer 2 switch loops by creating a spanning tree.

A switched network can have more than one path between devices, which is useful when a cable or switch fails. But those extra paths can also create a loop. Ethernet frames may circle through the network again and again, causing broadcast storms and confusing switches about where devices are located. Spanning Tree Protocol (STP) prevents this by keeping a loop-free path active while holding redundant links in reserve.

This is a core Layer 2 idea for anyone learning MikroTik networking. It connects bridge configuration with a broader question: how can a network stay available without letting its own backup links bring it down?

Why a loop can cause so much trouble

Ethernet frames don’t have a built-in limit on how many switches they can cross. When switches form a loop, a broadcast frame can return to where it started and travel around again. Each switch may forward it, multiplying the traffic. The result can be a broadcast storm that slows or overwhelms the network.

Loops can also cause MAC address flapping. A switch learns which port leads to each device by reading the source addresses in incoming frames. If a loop makes the same device appear on different ports in quick succession, the switch’s address table keeps changing. That makes normal forwarding unreliable.

Redundant links are still valuable. If one link fails, another can keep devices connected. STP provides a way to keep that resilience without leaving every path active at once.

STP builds a tree across the switches

Spanning Tree Protocol creates a logical tree: a connected structure with no loops. It does this by exchanging Bridge Protocol Data Units, or BPDUs, between switches. The switches use the information in those messages to agree on a loop-free arrangement.

First, they elect a root bridge. The root acts as the reference point for the rest of the network. Each bridge then works out its best path toward that root, using path costs. A path with a lower total cost is preferred.

Next, switches decide which ports should forward traffic and which should stay blocked. The chosen forwarding links form the active tree. A blocked port keeps a redundant path from creating a cycle, but it can become useful if an active link fails.

It’s a little like closing one lane on a quiet side street to keep traffic from circling a block forever. The lane is still there; it simply isn’t carrying traffic unless the route needs to change.

The key roles, in plain language

A few STP terms make the process easier to follow:

  • Root bridge: The switch selected as the network’s central reference point.

  • Root port: On a non-root switch, the port with the best path to the root bridge.

  • Designated port: The port selected to forward traffic for a network segment.

  • Alternate port: A standby path that can take over if the active route fails.

These roles are chosen through BPDU exchanges and path-cost comparisons. A switch doesn’t need someone to manually map every cable and declare which one should be blocked. The protocol calculates a suitable topology from the information it receives.

A detail worth keeping in mind: the root bridge isn’t necessarily the most powerful switch or the one in the center of the building. The election depends on bridge identifiers, which include a priority value and a MAC address. Network administrators can set bridge priority to influence which device becomes root. Choosing a reliable, central switch can make the resulting topology more predictable.

What happens when a link fails?

STP’s standby links are there for a reason. If an active link goes down, switches exchange updated information and may move a previously blocked port into a forwarding role. Connectivity can then return along a different route.

The original STP process can take noticeable time to settle after a change. Rapid Spanning Tree Protocol (RSTP) improves this convergence time by handling changes more quickly. It keeps the same general goal—a loop-free Layer 2 topology—but uses updated roles and transition processes to restore forwarding faster.

This distinction matters in real networks. A backup link that takes a long time to activate may still leave users without service during the change. RSTP can reduce that disruption, though the exact result depends on the network design and equipment.

How this relates to MikroTik bridges

In MikroTik RouterOS, bridging connects devices at Layer 2, much as a physical Ethernet switch does. When multiple bridges or switches are linked with redundant paths, spanning-tree settings help prevent loops across that topology.

RouterOS bridge settings include a protocol-mode property. Depending on the configuration and RouterOS version, a bridge can use STP, RSTP, or no spanning-tree protocol. RSTP is commonly used in modern networks because it generally responds to topology changes faster than classic STP.

A simplified RouterOS command may look like this:


/interface bridge

set [find name=bridge1] protocol-mode=rstp

The exact bridge name and configuration depend on the device. Before changing a live network, it’s wise to understand how the bridges connect and which switch should become root. A careless change can alter the active topology, even when every cable is connected correctly.

MikroTik devices can also be part of a mixed network with switches from other vendors. In that case, compatible STP or RSTP behavior matters. The network’s devices need to exchange and interpret spanning-tree information consistently. VLAN design, bridge settings, and hardware features can affect how traffic is handled, so configuration should be checked across the whole Layer 2 path—not just on one router.

Why routing protocols aren’t the same thing

STP works at Layer 2 and addresses loops created by bridged Ethernet paths. Routing protocols work at Layer 3, where routers choose paths between IP networks. They solve different problems.

A routing protocol may calculate routes through a network, but it doesn’t automatically block a redundant Ethernet switch port to create a spanning tree. That distinction is useful when learning MikroTik topics: bridge behavior belongs to the switching side of networking, while IP routing deals with moving packets between networks.

The layers can interact in a real deployment, of course. A MikroTik router might route between VLANs while its bridge handles Ethernet traffic within a VLAN. Still, each function has its own tools and logic.

A few useful habits when reviewing a topology

Start with the physical layout. Identify every connection between switches and bridges, including links added as backups. Then check which device is acting as the root bridge and whether that choice makes sense for the site.

Also look for signs of trouble: repeated MAC address changes, unusually high broadcast traffic, or devices that lose connectivity when a cable is added. Those symptoms don’t prove a spanning-tree issue, but they’re good reasons to inspect the Layer 2 design.

Finally, remember that a blocked port isn’t necessarily a fault. It may be doing exactly what the network needs. STP doesn’t remove redundancy; it manages it.

A tree-shaped topology lets a switched network keep a spare route without allowing frames to circulate endlessly. For MikroTik learners, that simple idea ties together bridges, BPDUs, path costs, and failover. Once the pieces click, a blocked port looks less like wasted capacity and more like a carefully held safety net.