I am new to networking so this probably a naive question. I've been reading up on the spanning tree protocol and understand why it's necessary in a network (it prevents loops) and I understand that this is not the most optimal way to route traffic in some cases. But the question is: why do we not find and use the optimal route from network to network? It seems fairly easy to do, even algorithmically, and it would decrease the number of bridges that traffic needs to go through. Is it too much computation per packet? Is it because we don't store state of the previous bridge - and why don't we?

As an example, if I wanted to route traffic from network d to network b I would need to go through network a instead of routing directly to network b: enter image description here

  • 5
    Just to clarify, spanning-tree is to prevent SWITCHING loops. Routing has nothing to do with spanning-tree. Route preference is some else entirely.
    – Jesse P.
    Commented Nov 29, 2019 at 19:34
  • 5
    In addition to Ron's fine answer: you've discovered the importance to design the network and select your root bridge so that (very) few traffic needs to use non-optimal paths. An important detail is to keep your tree depth small.
    – Zac67
    Commented Nov 29, 2019 at 19:56
  • 4
    There have been some attempts to replace the spanning tree protocol with something that switches frames more optimally. Various vendors have “Data center fabric” solutions. VSS handles a specific case. These technologies are usually vendor specific and only supported on a small subset of gear, severely limiting their adoption. Most network engineers design small L2 topologies and use L3 routing. In particular they avoid “random” network topologies such as your diagram. The 3-layer core-distribution-access design methodology is very helpful. Commented Nov 29, 2019 at 21:17

1 Answer 1


You are confusing layer-2 and layer-3. Routing happens at layer-3, and bridging happens at layer-2.

Routing routes packets between networks, and it usually finds the best path between networks. Layer-3 packets also have a TTL that gets decremented as a router processes the packets, and the packet is discarded when the TTL hits 0.

Bridging bridges frames on the same network, and the path for the frames may be suboptimal because of possible loops. Remember that there will be broadcasts at layer-2, and the broadcasts are sent to every interface (there is no optimal path for a broadcast as there is no single endpoint), and that is where you can get loops. If every interfaces forwards broadcast frames, then there is no stopping the broadcasts, and they will loop forever (a broadcast storm) crashing the network. Frames do not have a TTL, and bridges are transparent devices so they do not process the frames to even be able to decrement a TTL.

  • Well there are several technologies now to route at l2 as well, trill is one of those efforts to use Commented Dec 7, 2019 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.