The Layer 2 loop is prevented. Figure shows how STP recalculates the path when a failure occurs:. As shown in the figure, the trunk link between S2 and S1 fails, resulting in the previous path being disrupted. S2 unblocks the previously blocked port for Trunk2 and allows the broadcast traffic to traverse the alternate path around the network, permitting communication to continue.
If this link comes back up, STP reconverges, and the port on S2 is again blocked. The switches running STP are able to compensate for failures by dynamically unblocking the previously blocked ports and permitting traffic to traverse the alternate paths. However, these terms can be misleading. To communicate spanning tree concepts correctly, it is important to refer to the particular implementation or standard in context. Because the two protocols share much of the same terminology and methods for the loop-free path, the primary focus is on the current standard and the Cisco proprietary implementations of STP and RSTP.
IEEE STA designates a single switch as the root bridge and uses it as the reference point for all path calculations. In Figure , the root bridge switch S1 is chosen through an election process. For simplicity, assume until otherwise indicated that all ports on all switches are assigned to VLAN 1.
The lowest BID value is determined by the combination of these three fields. After the root bridge has been determined, the STA calculates the shortest path to the root bridge. Each switch uses the STA to determine which ports to block. While the STA determines the best paths to the root bridge for all switch ports in the broadcast domain, traffic is prevented from being forwarded through the network. The STA considers both path and port costs when determining which ports to block.
The path costs are calculated using port cost values associated with port speeds for each switch port along a given path. The sum of the port cost values determines the overall path cost to the root bridge. If there is more than one path to choose from, STA chooses the path with the lowest path cost. When the STA has determined which paths are most desirable relative to each switch, it assigns port roles to the participating switch ports.
The port roles describe their relationship in the network to the root bridge and whether they are allowed to forward traffic:. Root port —A root port is selected on all non-root bridge switches on a per-switch basis. Root ports are the switch ports closest to the root bridge, based on the overall cost to the root bridge.
There can be only one root port per non-root switch. Root ports could be single-link interfaces or an EtherChannel port channel interface. Designated port —A designated port is a non-root port that is permitted to forward traffic. Designated ports are selected on a per-segment basis, based on the cost of each port on either side of the segment and the total cost calculated by STP for that port to get back to the root bridge.
If one end of a segment is a root port, then the other end is a designated port. All ports on the root bridge are designated ports. Alternate port and b ackup port —An alternate port and a backup port are in a blocking state or discarding state to prevent loops.
Alternate ports are selected only on links where neither end is a root port. Only one end of the segment is blocked, while the other end remains in forwarding state, allowing for a faster transition to the forwarding state when necessary. The port roles displayed are those defined by RSTP.
The role originally defined by the Next, the interconnecting link between S2 and S3 must negotiate to see which port will become the designated port and which port will transition to alternate. As shown in Figure , every spanning-tree instance STP instance has a switch designated as the root bridge. The root bridge serves as a reference point for all spanning-tree calculations to determine which redundant paths to block. Figure shows the BID fields. The bridge priority value is automatically assigned but can be modified.
All switches in the broadcast domain participate in the election process. After a switch boots, it begins to send out BPDU frames every two seconds. The switch with the lowest BID becomes the root bridge. At first, all switches declare themselves as the root bridge. But through the exchange of several BPDUs, the switches eventually agree on the root bridge. The receiving switch compares its current root ID with the received root ID identified in the received frames.
Eventually, the switch with the lowest BID is identified as the root bridge for the spanning-tree instance. Figure The Root Bridge. A root bridge is elected for each spanning-tree instance. It is possible to have multiple distinct root bridges for different sets of VLANs. If all ports on all switches are members of VLAN 1, then there is only one spanning-tree instance. Bridge priority is a value between 0 and 65, The default is 32, If two or more switches have the same priority, the switch with the lowest MAC address becomes the root bridge.
When the root bridge has been elected for the spanning-tree instance, STA starts determining the best paths to the root bridge. Switches send BPDUs, which include the root path cost. This is the cost of the path from the sending switch to the root bridge. It is calculated by adding the individual port costs along the path from the switch to the root bridge. When a switch receives the BPDU, it adds the ingress port cost of the segment to determine its internal root path cost.
It then advertises the new root path cost to its adjacent peers. The default port cost is defined by the speed at which the port operates. As shown in Table , 10 Gbps Ethernet ports have a port cost of 2, 1 Gbps Ethernet ports have a port cost of 4, Mbps Fast Ethernet ports have a port cost of 19, and 10 Mbps Ethernet ports have a port cost of Specifically, 1 Gbps links were assigned a port cost of 1, Mbps link a cost of 10, and 10 Mbps links a cost of Any link faster than 1 Gbps i.
As Ethernet technologies evolve, the port cost values may change to accommodate the different speeds available. The nonlinear numbers in the table accommodate some improvements to the older Ethernet standard. Although switch ports have a default port cost associated with them, the port cost is configurable.
The ability to configure individual port costs gives the administrator the flexibility to manually control the spanning-tree paths to the root bridge. To configure the port cost of an interface, enter the spanning-tree cost value command in interface configuration mode.
The value can be between 1 and ,, Example shows how to restore the port cost to the default value, 19, by entering the no spanning-tree cost interface configuration mode command.
The internal root path cost is equal to the sum of all the port costs along the path to the root bridge. Paths with the lowest cost become preferred, and all other redundant paths are blocked. In Figure , the internal root path cost from S2 to the root bridge S1 using Path 1 is 19 based on Table , while the internal root path cost using Path 2 is Path 1 has a lower overall path cost to the root bridge and therefore becomes the preferred path.
STP configures the redundant path to be blocked, which prevents a loop from occurring. Use the show spanning-tree command as shown in Example to verify the root ID and internal root path cost to the root bridge. Figure Root Path Cost Example. The output generated identifies the root BID as The Cost field value changes depending on how many switch ports must be traversed to get to the root bridge.
Also notice that each interface is assigned a port role and port cost of After the root bridge is elected, the STA determines port roles on interconnecting links. The next seven figures help illustrate this process.
In Figure , switch S1 is the root bridge. Figure Port Role Decisions: Step 1. The root bridge always transitions its interconnecting links to designated port status. Figure Port Role Decisions: Step 2. Non-root switches transition ports with the lowest root path cost to root ports.
Figure Port Role Decisions: Step 3. After the root ports are selected, the STA decides which ports will have the designated and alternate roles, as illustrated with the S2 to S3 link in Figure The root bridge already transitioned its ports to designated status. Non-root switches must transition their non-root ports to either designated or alternate port status. Figure Port Role Decisions: Step 4. The switch advertising the higher BID transitions its port to alternate status.
Figure Port Role Decisions: Step 5. Figure Port Role Decisions: Step 6. If all switches in a single spanning tree have the same bridge priority, the switch with the lowest MAC address will become the root bridge. The diagram below is an illustration of a scenario in which the elected root bridge might not be the optimal choice:. Assuming all switches with their default bridge priority, because switch A has the lowest MAC address, it will be elected as a root bridge in this network.
If the link between switch D and B is 1 gigabit and links between A and D as well as A and D are Mbps, the Gigabit Ethernet link that connects switch D and swith B will be blocked, as a result of the election of Switch A as a root. Daniel Dib Daniel Dib 7, 31 31 silver badges 58 58 bronze badges. The bridge priority 16 bits is set in multiples of because it consists of another bridge priority leftmost 4 bits and the extended system ID rightmost 12 bits. Sw1: spanning-tree vlan 1,3,5,7 root primary spanning-tree vlan 2,4,6,8 root secondary Sw2: spanning-tree vlan 1,3,5,7 root secondary spanning-tree vlan 2,4,6,8 root primary.
I admit my response was focused on a Cisco "rapid-pvst" config. Could you also explain the issues you indicated could be created? Nearly all vendors have a per vlan implementation of RSTP.
The command will change the STP priority to a specific switch-dependent value, but not guarantee that the switch is either the primary or secondary since a switch with an even lower priority could already exist or be added later. Sign up or log in Sign up using Google. Sign up using Facebook.
Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Upcoming Events.
Note that if there are topological changes STP will re-converge. In case of a failure of the link between Switch A and Switch B the blocked port of Switch C will be put in to forwarding state. There are five STP Port states which are mentioned below. All Ports when administratively shut down fall in the category of Disabled State. When a Port is enabled it will start in Blocking State to prevent any loops and thus no forwarding of traffic will take place neither the port will learn any MAC addresses.
In this state the port will be allowed to send BPDUs as well so that it can actively participate in Spanning-tree. After another Forward Delay the port is transitioned to Forwarding state and now it can send and receive traffic and is a fully functional port.
0コメント