The Spanning Tree Protocol

download The Spanning Tree Protocol

of 4

Transcript of The Spanning Tree Protocol

  • 8/6/2019 The Spanning Tree Protocol

    1/4

    The Spanning Tree Protocol (STP) is a network protocol that ensures a loop-free topology for any bridged Ethernet local area network . The basic function of STP is to prevent bridge loops and ensuing broadcast radiation . Spanning tree also allows a network design to include spare (redundant) links to provide automatic backup paths if an active link fails, without the danger of bridge loops, or the need for manual enabling/disabling of these backup links.

    STP is a Data Link Layer protocol. It is standardized as IEEE 802.1D . As the name suggests, it creates aspanning tree within a mesh network of connected layer-2 bridges (typically Ethernet switches ), anddisables those links that are not part of the spanning tree, leaving a single active path between any twonetwork nodes.

    Protocol operation

    The collection of bridges in a local area network (LAN) can be considered a graph whose nodes are bridges and LAN segments (or cables), and whose edges are the interfaces connecting the bridges to thesegments. To break loops in the LAN while maintaining access to all LAN segments, the bridgescollectively compute a spanning tree. The spanning tree is not necessarily a minimum cost spanning tree.A network administrator can reduce the cost of a spanning tree, if necessary, by altering some of theconfiguration parameters in such a way as to affect the choice of the root of the spanning tree. Thespanning tree that the bridges compute using the Spanning Tree Protocol can be determined using thefollowing rules. The example network at the right, below, will be used to illustrate the rules.

    1. An example network. The numbered boxes represent bridges (the number represents the bridge ID).The lettered clouds represent network segments.

  • 8/6/2019 The Spanning Tree Protocol

    2/4

  • 8/6/2019 The Spanning Tree Protocol

    3/4

    4. The least cost path to the root from network segment e goes through bridge 92. Therefore thedesignated port for network segment e is the port that connects bridge 92 to network segment e.

    5. This diagram illustrates all port states as computed by the spanning tree algorithm. Any active port thatis not a root port or a designated port is a blocked port.

    6. After link failure the spanning tree algorithm computes and spans new least-cost tree.

    Select a root bridge. The root bridge of the spanning tree is the bridge with the smallest (lowest) bridge

    ID. Each bridge has a unique identifier (ID) and a configurable priority number; the bridge ID contains both numbers. To compare two bridge IDs, the priority is compared first. If two bridges have equal priority, then the MAC addresses are compared. For example, if switches A (MAC=0200.0000.1111) andB (MAC=0200.0000.2222) both have a priority of 10, then switch A will be selected as the root bridge. If the network administrators would like switch B to become the root bridge, they must set its priority to beless than 10.

    Determine the least cost paths to the root bridge. The computed spanning tree has the property thatmessages from any connected device to the root bridge traverse a least cost path, i.e., a path from thedevice to the root that has minimum cost among all paths from the device to the root. The cost of traversing a path is the sum of the costs of the segments on the path. Different technologies have differentdefault costs for network segments. An administrator can configure the cost of traversing a particular

    network segment. The property that messages always traverse least-cost paths to the root is guaranteed bythe following two rules.

    Least cost path from each bridge. After the root bridge has been chosen, each bridge determines the costof each possible path from itself to the root. From these, it picks one with the smallest cost (a least-cost

    path). The port connecting to that path becomes the root port (RP) of the bridge.

  • 8/6/2019 The Spanning Tree Protocol

    4/4

    Least cost path from each network segment. The bridges on a network segment collectively determinewhich bridge has the least-cost path from the network segment to the root. The port connecting this bridgeto the network segment is then the designated port (DP) for the segment.

    Disable all other root paths. Any active port that is not a root port or a designated port is a blocked port(BP).

    Modifications in case of ties. The above rules over-simplify the situation slightly, because it is possiblethat there are ties, for example, two or more ports on a single bridge are attached to least-cost paths to theroot or two or more bridges on the same network segment have equal least-cost paths to the root. To break such ties:

    Breaking ties for root ports. When multiple paths from a bridge are least-cost paths, the chosen path usesthe neighbor bridge with the lower bridge ID. The root port is thus the one connecting to the bridge withthe lowest bridge ID. For example, in figure 3, if switch 4 were connected to network segment d, therewould be two paths of length 2 to the root, one path going through bridge 24 and the other through bridge92. Because there are two least cost paths, the lower bridge ID (24) would be used as the tie-breaker inchoosing which path to use.

    Breaking ties for designated ports. When more than one bridge on a segment leads to a least-cost path tothe root, the bridge with the lower bridge ID is used to forward messages to the root. The port attachingthat bridge to the network segment is the designated port for the segment. In figure 4, there are two leastcost paths from network segment d to the root, one going through bridge 24 and the other through bridge92. The lower bridge ID is 24, so the tie breaker dictates that the designated port is the port through whichnetwork segment d is connected to bridge 24. If bridge IDs were equal, then the bridge with the lowestMAC address would have the designated port. In either case, the loser sets the port as being blocked.

    The final tie-breaker. In some cases, there may still be a tie, as when two bridges are connected bymultiple cables. In this case, multiple ports on a single bridge are candidates for root port. In this case, the

    path which passes through the port on the neighbor bridge that has the lowest port priority is used.

    [edit ] Data rate and STP path cost

    The table below shows the default cost of an interface for a given data rate.

    Data rate STP Cost (802.1D-1998) STP Cost (802.1t-2001)4 Mbit/s 250 5,000,00010 Mbit/s 100 2,000,00016 Mbit/s 62 1,250,000100 Mbit/s 19 200,000

    1 Gbit/s 4 20,0002 Gbit/s 3 10,00010 Gbit/s 2 2,000