What is Spanning Tree and Portfast, and how can they affect my Altiris environment?
The Spanning-Tree Protocol (STP) was created to overcome the problems of transparent bridging in redundant networks. The purpose of STP is to avoid and eliminate loops in the network by negotiating a loop-free path through a root bridge. This is done by determining where there are loops in the network and blocking links that are redundant.
Spanning-Tree Protocol executes an algorithm called the Spanning-Tree Algorithm (STA). In order to find redundant links, STA will choose a reference point called a Root Bridge, and then determines all the available paths to that reference point. If it finds a redundant path, it chooses for the best path to forward and for all other redundant paths to block. This effectively severs the redundant links within the network.
All switches participating in STP gather information on other switches in the network through an exchange of data messages. These messages are referred to as Bridge Protocol Data Units (BPDUs). The exchange of BPDUs in a switched environment will result in the election of a root switch for the stable spanning-tree network topology, election of designated switch for every switched segment, and the removal of loops in the switched network by placing redundant switch ports in a backup state.
During the execution of the Spanning-Tree Algorithm, Spanning-Tree will force the ports to go into five different states:
A escription of each state follows:
- Blocked—All ports start in the blocked mode in order to prevent the switch from creating a loop.
- Listen—The port transitions from the blocked state to the listen state. It uses this time to attempt to learn whether there are any other paths to the root bridge. This state is really used to indicate that the port is getting ready to transmit but it would like to listen for a little longer to make sure it does not create a loop.
- Learn—When in this state, the switch will add information it has learned through the listening process to its address table. It is still not allowed to send data.
- Forward—This state means the port can send and receive data.
- Disabled—The switch can disable a port for a variety of reasons including: hardware failure, deletion of the ports native VLAN, and being administratively disabled.
The transitioning period from state to state takes the following times by default:
- From blocking to listening: 20 seconds
- From listening to learning: 15 seconds
- From learning to forwarding: 15 seconds
Spanning-Tree protocol is running by default on all ports of the switch. The spanning-tree protocol makes each port wait up to 50 seconds before data is allowed to be sent on the port. This Delay in turn can cause problems with some applications/protocols (PXE, Bootworks, etc.). To alleviate the problem, Porfast was implemented on Cisco devices, the terminology might differ between different vendor devices.
PortFast causes a port to enter the forwarding state almost immediately by dramatically decreasing the time of the listening and learning states. Portfast minimizes the time it takes for the server or workstation to come online, thus preventing problems with applications such as DHCP, DNS, Novell IPX, PXE, BootWorks, etc.
The spanning-tree protocol is always running even when the port is in forwarding state so that it can still detect loops, however the use of Portfast should only be implemented when the port on the switch is directly connected to a server/workstation and never to another hub/switch.
To enable portfast on Cisco switches you must enter the following command:On set based switches at the Switch>(enable)" prompt:
Set Spantree portfast <mod_number/port_number>
on IOS based switches: at the "switch(config-if)#" prompt: