In the previous article we looked at the PortFast feature to expedite STP edge port forwarding. The next two articles will focus on STP enabled links connecting switches together. As you guessed by the title, this one is about a feature called Uplink Fast.
What problem are we solving with this feature? Consider the topology below. SW1 is the root bridge via manual priority configuration. This causes SW3 to elect G0/0 as it’s root port and block on G0/1. What happens if SW3 loses its root port? G0/1 will have to go though Listening and Learning states for the duration of the Forward Delay timer for both. This means that SW3 cannot converge for at least 30 seconds. 30 seconds is far too long to wait for the clients connected to SW3. Uplink Fast helps with this by allowing SW3 to switch to G0/1 almost immediately.
Testing Without Nerd Knobs
Before configuring Uplink Fast, we need to first observe STP status and convergence under default conditions. In the output below we can see that the local bridge priority is 32768, the root path cost is 4, and each port cost is 4.
SW3#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 4097
Address 5254.0014.8da9
Cost 4
Port 1 (GigabitEthernet0/0)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 5254.001d.f9d4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0 Root FWD 4 128.1 P2p
Gi0/1 Altn BLK 4 128.2 P2p
Gi0/2 Desg FWD 4 128.3 P2p Edge
With Spanning Tree event debugging enabled, shutting down SW3’s root port will simulate root link failure. The debug output below confirms that there was a 30 second delay between entering listening state and transitioning to forwarding.
SW3(config-if)#shutdown
SW3(config-if)#
*Jan 31 20:52:21.248: STP: VLAN0001 new root port Gi0/1, cost 8
*Jan 31 20:52:21.249: STP: VLAN0001 Gi0/1 -> listening
*Jan 31 20:52:21.250: STP[1]: Generating TC trap for port GigabitEthernet0/0
*Jan 31 20:52:23.222: %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to administratively down
*Jan 31 20:52:23.250: STP: VLAN0001 sent Topology Change Notice on Gi0/1
*Jan 31 20:52:24.222: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down
*Jan 31 20:52:36.249: STP: VLAN0001 Gi0/1 -> learning
*Jan 31 20:52:51.249: STP[1]: Generating TC trap for port GigabitEthernet0/1
*Jan 31 20:52:51.251: STP: VLAN0001 sent Topology Change Notice on Gi0/1
*Jan 31 20:52:51.252: STP: VLAN0001 Gi0/1 -> forwarding
Enabling, Testing and Understanding Uplink Fast
Uplink Fast is intended to be used on switches at the edge of the network that are not providing transit for other switches. The classic use case is like the demo topology where an access layer switch has two uplinks to the distribution layer and one of them is blocking.
Configuring Uplink Fast is a single command, show below. The feature only needs to be enabled on edge switches that need to rapidly switch to a new root port. When Uplink Fast is configured, it is applied to all VLANs. Per VLAN configuration is not supported. Notice the message that prints to the terminal after enabling the feature. The bridge priority is increased to make the switch less attractive so that it is less likely to be used as a transit bridge. Here the priority is set to 49152 + the system extended ID (VLAN number, 1).
SW3#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
SW3(config)#spanning-tree uplinkfast
SW3(config)#
*Jan 31 20:56:20.449: setting bridge id (which=1) prio 49153 prio cfg 49152 sysid 1 (on) id C001.5254.001d.f9d4
The bridge priority is not the only thing that is changed when Uplink Fast is configured. Notice the port cost in the output below. The last time we viewed this output, the port cost was 4 on all interfaces. This is another measure to prevent the Uplink Fast enabled switch from becoming transit.
SW3#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 4097
Address 5254.0014.8da9
Cost 3004
Port 1 (GigabitEthernet0/0)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 49153 (priority 49152 sys-id-ext 1)
Address 5254.001d.f9d4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Uplinkfast enabled
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Gi0/0 Root FWD 3004 128.1 P2p
Gi0/1 Altn BLK 3004 128.2 P2p
Gi0/2 Desg FWD 3004 128.3 P2p Edge
With Uplink Fast enabled and the major talking points covered, it is time to test failover. The debug output below confirms that G0/1 takes over as forwarding almost immediately.
SW3(config)#interface g0/0
SW3(config-if)#shut
SW3(config-if)#
*Jan 31 21:37:57.124: STP: VLAN0001 new root port Gi0/1, cost 3008
*Jan 31 21:37:57.125: %SPANTREE_FAST-7-PORT_FWD_UPLINK: VLAN0001 GigabitEthernet0/1 moved to Forwarding (UplinkFast).
*Jan 31 21:37:57.126: STP[1]: Generating TC trap for port GigabitEthernet0/1
*Jan 31 21:37:57.126: STP[1]: Generating TC trap for port GigabitEthernet0/0
*Jan 31 21:37:59.101: %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to administratively down
*Jan 31 21:37:59.126: STP: VLAN0001 sent Topology Change Notice on Gi0/1
*Jan 31 21:38:00.101: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down
Educating Downstream Switches About the New Topology
Having fast failover to a new physical topology is nice, but not all that useful if we must wait for the MAC aging timer to expire for the downstream switch forwarding tables to be updated. Thankfully, this problem was considered when Uplink Fast was invented.
Consider the topology below. SW3 G0/0 was the root port, but the link failed and Uplink Fast caused SW3 to quickly fail over and promote G0/1 to root port duty. Without intervention, SW2’s MAC address table would still have an entry for ClientA out of its G0/0 interface
Unfortunately, this aspect of Uplink Fast doesn’t seem to work in my virtual lab environment. I rebuilt an identical topology with physical routers and switches for demonstration.
When SW3 moves G0/1 to forwarding, it creates a frame with the source MAC of each entry in its MAC address table (except those learned via the old root port, those should be flushed when the RP fails). The destination MAC address is a multicast address. Multicast frames are flooded by switches like broadcast. This multicast frame is sent out of the newly elected root port. In this example, SW2 will receive the frame, update its MAC address table so that it now knows that ClientA is reachable via G0/1, and forward the frame to SW1. SW1 will repeat this process by updating its MAC table so that the ClientA MAC is reachable via G0/1. Router1 will receive the frame and drop it. The network is now fully converged around the link failure between SW1 and SW3.
Below is a snippet of one of these multicast frames. The source MAC is G0/0 of ClientA.
Reactivating the Original Root Port
What happens when SW3 G0/0 comes back up? Do we rapidly fail back to the best root path? Recall that Uplink Fast is only configured on SW3, all other switches in the network are operating by regular STP rules. This means that SW3 G0/0 can not safely transfer to forwarding immediately. This is not an issue though, G0/1 remains active until just before the switchover. Debug output below showing the transition back to root port G0/0.
SW3(config-if)#no shutdown
SW3(config-if)#
*Feb 1 01:44:03.215: set portid: VLAN0001 Gi0/0: new port id 8001
*Feb 1 01:44:03.216: STP: VLAN0001 Gi0/0 -> listening
*Feb 1 01:44:04.203: STP: VLAN0001 Gi0/0: root port delay timer active
*Feb 1 01:44:04.204: STP: VLAN0001 Gi0/0 -> blocking
*Feb 1 01:44:05.034: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up
*Feb 1 01:44:06.034: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
*Feb 1 01:44:39.203: STP: VLAN0001 new root port Gi0/0, cost 3004
*Feb 1 01:44:39.204: STP: VLAN0001 Gi0/1 -> blocking (uplinkfast)
*Feb 1 01:44:39.204: STP[1]: Generating TC trap for port GigabitEthernet0/1
*Feb 1 01:44:39.205: %SPANTREE_FAST-7-PORT_FWD_UPLINK: VLAN0001 GigabitEthernet0/0 moved to Forwarding (UplinkFast).
*Feb 1 01:44:39.206: STP[1]: Generating TC trap for port GigabitEthernet0/0
*Feb 1 01:44:39.208: STP: VLAN0001 sent Topology Change Notice on Gi0/0