Definition: Spanning trees are a standard technique used in local area network (LAN) switching. Spanning tree algorithms were developed to prevent redundant transmission of data along intermediate hops between a source and destination host on a mesh network topology. Without spanning trees, a mesh network can be flooded and rendered unusable by messages circulating in an infinite loop between hosts.
The primary Spanning Tree Protocol (STP) is IEEE standard 802.1D, an algorithm commonly used on Ethernet networks. This algorithm works by limiting the paths messages can travel at any given time to a fully connected tree rather than a mesh. As hosts join and leave the network, this protocol dynamically updates the tree accordingly.