DESARROLLO DE LA EXPERIMENTACIÓN
CONTENIDOS: SESIONES
STP logic monitors the normal ongoing Hello process when the network topology is stable; when the Hello process changes, STP then needs to react and converge to a new STP topology. When STP has a stable topology, the following occurs:
1. The root switch generates a Hello regularly based on the Hello timer.
2. Each non-root switch regularly (based on the Hello timer) receives a copy of the root’s Hello on its RP.
3. Each switch updates and forwards the Hello out its Designated Ports.
4. For each blocking port, the switch regularly receives a copy of the Hello from the DP on that segment. (The switches do not forward Hellos out blocking interfaces.)
When some deviation from these events occurs, STP knows that the topology has changed and that convergence needs to take place. For instance, one simple case might be that the root switch loses power; the rest of the switches will not hear any Hello messages, and after the maxage timer expires (default 10 times Hello, or 20 seconds), the switches elect a new root based on the logic described earlier in this chapter.
For a more subtle example, consider Figure 3-3, which shows the same loop network as in Figure 3-2. In this case, however, the link from SW1 to SW2 has just failed.
Figure 3-3 Reacting to Loss of Link Between SW1 and SW2
The following list describes some of the key steps from Figure 3-3: 1. SW2 ceases the receive Hellos on its RP.
2. Because SW2 is not receiving Hellos over any other path, it begins a new root election by claiming to be root and flooding Hellos out every port.
3. SW4 notices that the latest Hello implies a new root switch, but SW4 ends up with the same RP (for now). SW4 forwards the Hello out toward SW3 after updating the appropriate fields in the Hello.
4. SW3 receives the Hello from SW4, but it is inferior to the one SW3 receives from SW1. So, SW3 becomes the DP on the segment between itself and SW4, and starts forwarding the superior Hello on that port.
Remember, SW1 had won the earlier election; as of Steps 3 and 4, the Hellos from SW1 and SW2 are competing, and the one claiming SW1 as root will again win. The rest of the process results with SW3’s fa0/4 as DP, SW4’s fa 0/3 as RP, SW4’s fa 0/2 as DP, and SW3’s fa 0/4 as RP.
Topology Change Notification and Updating the CAM
When STP reconvergence occurs, some Content Addressable Memory (CAM) entries might be invalid (CAM is the Cisco term for what’s more generically called the MAC address table, switching table, or bridging table on a switch). For instance, before the link failure shown in Figure 3-3, SW3’s CAM might have had an entry for 0200.1111.1111 (Router1’s MAC address) pointing out fa0/4 to SW4. (Remember, at the beginning of the scenario described in Figure 3-3,
Loop Design – All Port Costs 19 UnlessShown
SW1 Fa0/4 Cost 19 Disabled Fa0/3 Fa0/2 Fa0/4 Disabled Cost 1 SW1’sbridge ID isbetter.
So I’m sending the
superior Hello on this segment. I am now DP! Fa0/1 Cost 100 MAC 0200.1111.1111 Root SW3 SW2 SW4 My RP failed. I am receiving no other Hellos. I must be the root now!
Hello Root = Sw2 Cost 0 Hello Root = Sw2 Cost 19 Hello Root = Sw1 Cost 0 Hello Root = Sw1 Cost 100 R1 1 1 2 3 4
802.1D Spanning Tree Protocol 67
SW3 was blocking on its fa0/1 interface back to SW1.) When the link between SW1 and SW2 failed, SW3 would need to change its CAM entry for 0200.1111.111 to point out port fa0/1. To update the CAMs, two things need to occur:
■ All switches need to be notified to time out their CAM entries.
■ Each switch needs to use a short timer, equivalent to the forward delay timer (default 15 seconds), to time out the CAM entries.
Because some switches might not directly notice a change in the STP topology, any switch that detects a change in the STP topology has a responsibility to notify the rest of the switches. To do so, a switch simply notifies the root switch in the form of a Topology Change Notification (TCN) BPDU. The TCN goes up the tree to the root. After that, the root notifies all the rest of the switches. The process runs as follows:
1. A switch experiencing the STP port state change sends a TCN BPDU out its Root Port; it repeats this message every Hello time until it is acknowledged.
2. The next switch receiving that TCN BPDU sends back an acknowledgement via its next forwarded Hello BPDU by marking the Topology Change Acknowledgement (TCA) bit in the Hello.
3. The switch that was the DP on the segment in the first two steps repeats the first two steps, sending a TCN BPDU out its Root Port, and awaiting acknowledgement from the DP on that segment.
By each successive switch repeating Steps 1 and 2, eventually the root receives a TCN BPDU. Once received, the root sets the TCA flag on the next several Hellos, which are forwarded to all switches in the network, notifying them that a change has occurred. A switch receiving a Hello BPDU with the TCA flag set uses the short (forward delay time) timer to time out entries in the CAM.
Transitioning from Blocking to Forwarding
When STP reconverges to a new, stable topology, some ports that were blocking might have been designated as DP or RP, so these ports need to be in a forwarding state. However, the transition from blocking to forwarding state cannot be made immediately without the risk of causing loops. To transition to forwarding state but also prevent temporary loops, a switch first puts a formerly blocking port into listening state, and then into learning state, with each state lasting for the length of time defined by the forward delay timer (by default, 15 seconds). Table 3-4 summarizes the key points about all of the 802.1D STP port states.
Table 3-4 IEEE 802.1D Spanning Tree Interface States
In summary, when STP logic senses a change in the topology, it converges, possibly picking different ports as RP, DP, or neither. Any switch changing its RPs or DPs sends a TCN BPDU to the root at this point. For the ports newly designated as RP or DP, 802.1D STP first uses the listening and learning states before reaching the forwarding state. (The transition from forwarding to blocking can be made immediately.)