In this case, the command can result in a loop. The to second delay that occurs during the transition from blocking to forwarding mode prevents a temporal loop condition in the network when you connect two switches.
This section lists rules for how STP works. When the switches first come up, they start the root switch selection process. The switches then agree on which switch is the root switch. The switch with the lowest bridge ID in the network wins this election process. After the root switch identification, the switches adhere to these rules:. Note: In some corner cases, which involve self-looped ports, there is an exception to this rule.
Next, each switch determines the best path to get to the root. The switches determine this path by a comparison of the information in all the BPDUs that the switches receive on all ports. The switch uses the port with the least amount of information in the BPDU in order to get to the root switch; the port with the least amount of information in the BPDU is the root port. After a switch determines the root port, the switch proceeds to rule 2. In addition, the switches on each LAN segment communicate with each other to determine which switch is best to use in order to move data from that segment to the root bridge.
This switch is called the designated switch. The rule only applies to ports that connect to other bridges or switches. STP does not affect ports that connect to workstations or PCs. These ports remain forwarded. The other VLAN parts of a trunk link can forward traffic normally. Note: By default, spanning tree runs on every port. The spanning tree feature cannot be turned off in switches on a per-port basis. Extreme care should be taken whenever you disable spanning tree because this creates Layer 2 loops within the network.
Issue the show version command in order to display the software version that the switch runs. In this scenario, Switch 15 is the best choice for the root switch of the network for all the VLANs because Switch 15 is the backbone switch. Note: The default priority for switches is When you set the priority with this command, you force the selection of Switch 15 as the root switch because Switch 15 has the lowest priority.
Note: In this scenario, all the switches started with cleared configurations. Therefore, all the switches started with a bridge priority of If you are not certain that all the switches in your network have a priority that is greater than , set the priority of your desired root bridge to 1. Note: Only configure this setting on ports that connect to workstations or PCs. Do not enable PortFast on any port that connects to another switch.
This example only configures Switch Spanning-tree protocols address both of these issues because they provide link redundancy while simultaneously preventing undesirable loops. RSTP is the default spanning-tree protocol for preventing loops on Ethernet networks. Connects to devices that are not STP-capable, such as PCs, servers, routers, or hubs that are not connected to other switches, by using edge ports. Spanning-tree protocols intelligently avoid loops in a network by creating a tree topology spanning tree of the entire bridged network with only one available path between the tree root and a leaf.
All other paths are forced into a standby state. The tree root is a switch within the network elected by the STA spanning-tree algorithm to use when computing the best path between bridges throughout the network and the root bridge.
Frames travel through the network to their destination—a leaf such as an end-user PC—along branches. A tree branch is a network segment, or link, between bridges.
Switches that forward frames through an STP spanning tree are called designated bridges. Each port has both a role and a state. The five port roles used in RSTP are:. Root port—The port closest to the root bridge has the lowest path cost from a bridge. This is the only port that receives frames from and forwards frames to the root bridge. Designated port—The port that forwards traffic away from the root bridge toward a leaf.
A designated bridge has one designated port for every link connection it serves. A root bridge forwards frames from all of its ports, which serve as designated ports. Alternate port—A port that provides an alternate path toward the root bridge if the root port fails and is placed in the discarding state. This port is not part of the active spanning tree, but if the root port fails, the alternate port immediately takes over. Backup port—A port that provides a backup path toward the leaves of the spanning tree if a designated port fails and is placed in the discarding state.
A backup port can exist only where two or more bridge ports connect to the same LAN for which the bridge serves as the designated bridge. A backup port for a designated port immediately takes over if the port fails. Each port has both a state and a role. RSTP places each port of a designated bridge in one of three states:.
A port in this state discards all frames it receives and does not learn MAC addresses. Learning—The port prepares to forward traffic by examining received frames for location information in order to build its MAC address table. Forwarding—The port filters and forwards frames. A port in the forwarding state is part of the active spanning tree. Spanning Tree also defines the concept of an edge port , which is a designated port that connects to devices that are not STP-capable, such as PCs, servers, routers, or hubs that are not connected to other switches.
Spanning Tree Protocol Explained! Share this blog. Special Offer. Valid first name is required. After this is the MAC address of the switch. The switch with the lowest BID wins the election; this means that if default values are used, the switch with the lowest MAC Address will win the election. In order to work out which will have their ports blocked, we need to assign port types to the switches. In order to work out which will become the root and designated port, we need to know the Root Port Cost RPC of each switch port on a non-root switch.
The switch port with the lowest RPC will become the root port, and all of the other ports will become a designated port.
So how do we get this value? In the above table, I have assigned the Root Port Cost to the speed of the cabling type. For example, if the link negotiated a speed of mbps on a gigabit link, it will choose a cost of 19, not 4.
Here we have altered the diagram slightly to introduce the RPC values. We now know the root ports for the switches and need to determine the designating and blocking ports. SW1 will have all ports set to designated as no ports will enter blocking mode.
One will be designated, but the other will have to go blocking; this is because there can only be one designated port on a collision domain, and the root port has already been selected on both switches.
With this information, we can quickly work out which will become the designated port, and which will go blocking. First, which has the lowest RPC?
0コメント