Saturday, 26 October 2019

Types of Spanning Tree Protocol STP

Types of Spanning Tree Protocol STP

The different Types of Spanning Tree Protocol STP are discussed in details. The operation of Per-VLAN Spanning Tree Plus (PVST +) and Rapid Per-VLAN Spanning Tree Plus (RSTP) in a switched LAN environment is explained.

Types of Spanning tree protocols

Types of Spanning tree protocols include the following:
  1. STP : is the original version of IEEE 802.1D (802.1D-1998 and earlier), which provides a loopless topology in a network with redundant links. The common spanning tree (CTS) assumes a spanning tree instance for the entire linked network, regardless of the amount of VLAN.
  2. PVST + : This is a Cisco enhancement from STP that provides an 802.1D spanning tree instance for each VLAN configured in the network. The separate instance supports PortFast, UplinkFast, BackboneFast, BPDU protection, BPDU filter, root protection and loop protection.
  3. 802.1D-2004 : this is an updated version of the STP standard that incorporates IEEE 802.1w.
  4. Rapid Spanning Tree Protocol (RSTP) or IEEE 802.1w: This is an evolution of STP that provides faster convergence than STP.
  5. Fast PVST + : This is a Cisco improvement from RSTP that uses PVST +. Fast PVST + provides a different 802.1w instance per VLAN. The separate instance supports PortFast, BPDU protection, BPDU filter, root protection and loop protection.
  6. Multiple Spanning Tree Protocol (MSTP) : It is an IEEE standard inspired by the previous Cisco multi-instance STP (MISTP) implementation. MSTP assigns several VLANs in the same spanning tree instance. MST is the Cisco implementation of MSTP, which provides up to 16 instances of RSTP and combines several VLANs with the same physical and logical topology in a common RSTP instance. Each instance supports PortFast, BPDU protection, BPDU filter, root protection and loop protection.

It is possible that a network professional, whose tasks include switch management, should decide what type of tree spanning protocol to implement.

Characteristics of Spanning tree protocols

The characteristics of the various Spanning tree protocols are detailed below. Italicized words indicate whether that particular spanning tree protocol is unique to Cisco or an implementation of the IEEE standard.

Spanning Tree Protocol STP

It assumes an IEEE 802.1D spanning tree instance for the entire linked network, regardless of the amount of VLAN. Because there is only one instance, the CPU and memory requirements for this version are less than for the rest of the protocols.
However, since there is only one instance, there is also only one root bridge and one tree. Traffic for all VLANs flows along the same route, which may cause poor traffic flows. Due to the limitations of 802.1D, the convergence of this version is slow.

 PVST +

It is a Cisco STP enhancement that provides a different instance of the Cisco 802.1D implementation for each VLAN that is configured on the network. The separate instance supports PortFast, UplinkFast, BackboneFast, BPDU protection, BPDU filter, root protection and loop protection.
Creating an instance for each VLAN increases the CPU and memory requirements, but supports root bridges over VLAN. This design allows the optimization of the spanning tree for the traffic of each VLAN. The convergence of this version is similar to the convergence of 802.1D. However, the convergence is by VLAN.

 RSTP (or IEEE 802.1w)

It is an evolution of the spanning tree that provides faster convergence than the original 802.1D implementation. This version solves several convergence problems, but since it still provides a single instance of STP, it does not solve the problems of poor traffic flow.
To support faster convergence, the CPU and memory usage requirements of this version are barely more demanding than those of CTS, but less than those of RSTP +.

 PVST + fast

It is a Cisco enhancement of RSTP that uses PVST +. It provides a different 802.1w instance per VLAN. The separate instance supports PortFast, BPDU protection, BPDU filter, root protection and loop protection.
This version solves both convergence and poor traffic flow problems. However, this version has the most demanding CPU and memory requirements.

 MSTP

It is the IEEE 802.1s standard, inspired by the previous MISTP implementation, unique to Cisco. To reduce the number of STP instances required, MSTP assigns several VLANs with the same traffic flow requirements in the same spanning tree instance.

 MST

It is the Cisco implementation of MSTP, which provides up to 16 instances of RSTP (802.1w) and combines many VLANs with the same physical and logical topology in a common RSTP instance. Each instance supports PortFast, BPDU protection, BPDU filter, root protection and loop protection. The CPU and memory requirements of this version are less than those of PVST + fast but more than those of RSTP.
The default spanning tree mode for Cisco Catalyst switches is PVST +, which is enabled on all ports. PVST + has a much slower convergence than PVST + fast after a change in the topology.

 Per-VLAN Spanning Tree Plus (PVST +)

The original IEEE 802.1D standard defines a common spanning tree (CST) that assumes only one spanning tree instance for the entire switched network, regardless of the amount of VLAN. Networks running CST have the following characteristics:
  • It is not possible to share the load. An uplink must block all VLANs.
  • The CPU is preserved. Only one instance of spanning tree should be calculated.

Cisco developed PVST + so that a network can run a separate instance of the Cisco implementation of IEEE 802.1D for each VLAN in the network. With PVST +, a trunk link port on a switch can block a VLAN without blocking others . PVST + can be used to implement Layer 2 load balancing. Because each VLAN executes a different STP instance, the switches in a PVST + environment require more CPU processing and a higher BPDU bandwidth consumption than the implementation of traditional STP CST.

In a PVST + environment, the spanning tree parameters can be adjusted so that half of the VLANs are forwarded on each uplink trunk. In Image 1, port F0 / 3 on S2 is the forwarding port for VLAN 20, and F0 / 2 on S2 is the forwarding port for VLAN 10. This is achieved by configuring a switch. as a root bridge for half of the VLANs in the network and a second switch as a root bridge for the other half of the VLANs. In the illustration, S3 is the root bridge for VLAN 20, and S1 is the root bridge for VLAN 10. If there are several STP root bridges per VLAN, the redundancy in the network is increased.

PVST + features

Networks running PVST + have the following characteristics:
  • Load balancing can work optimally.
  • An spanning tree instance for each VLAN that is maintained can mean a huge waste of CPU cycles for all switches in the network (in addition to the bandwidth used in each instance to send its own BPDU). This would only be a problem if a large number of VLAN networks were configured.

 Port States

STP facilitates the logical path without loops throughout the broadcast domain. The spanning tree is determined through the information obtained in the exchange of BPDU frames between the interconnected switches. To facilitate the learning of the logical spanning tree, each switch port undergoes a transition through five possible states and three BPDU timers .
The spanning tree is determined immediately after the switch completes the boot process. If a switch port passes directly from the blocking state to the forwarding state without information about the entire topology during the transition, the port can create a temporary data loop. For this reason, STP introduces the five port states.

Description of STP port states

In Image 2, the following port states are described that ensure that no loops occur during the creation of the logical spanning tree:
  • Blocking : the port is an alternative port and does not participate in frame forwarding. The port receives frames from BPDU to determine the location and root ID of the root bridge switch and the port functions that each of them must assume in the final topology of the active STP.
  • Listen : listen to the path to the root. STP determined that the port can participate in frame forwarding based on the BPDU frames the switch received so far. At this point, the switch port not only receives BPDU frames, but also transmits its own BPDU frames and informs adjacent switches that the switch port prepares to participate in the active topology.
  • Learning : learn MAC addresses. The port prepares to participate in frame forwarding and begins to complete the MAC address table.
  • Forwarding : the port is considered part of the active topology. Forwards data frames, in addition to sending and receiving BPDU frames.
  • Disabled : Layer 2 port does not participate in the spanning tree and does not forward frames. The disabled state is set when the switch port is administratively disabled.
Note that the number of ports in each of the various states (blocking, listening, learning or forwarding) can be displayed with the show spanning-tree summary command

 Functioning of Spanning Tree 

For each VLAN in a switched network, PVST + follows four steps to provide a logical network topology without loops:
  • Choose a root bridge : only one switch can function as a root bridge (for a given VLAN). The root bridge is the switch with the lowest bridge ID. In the root bridge, all ports are designated ports (in particular, those that are not root ports).
  • Select the root port on each non-root port: STP establishes a root port on each non-root bridge. The root port is the lowest cost route from the non-root bridge to the root bridge, which indicates the direction of the best route to the root bridge. Generally, the root ports are in forwarding state.
  • Select the designated port in each segment : STP establishes a designated port on each link. The designated port is selected on the switch that has the lowest cost route to the root bridge. Usually, the designated ports are in forwarding state and forward traffic for the segment.
  • The rest of the ports in the switched network are alternative ports : in general, the alternate ports are kept in a locked state to break the loop topology logically. When a port is in a blocking state, it does not forward traffic but can process received BPDU messages.

Extended system ID

In a PVST + environment, the extended switch ID ensures that the switch has a unique BID for each VLAN.

For example, the default BID of VLAN 2 would be 32770 (32768 priority, plus 2 extended system ID). If no priority was set, all switches have the same default priority, and the root choice for each VLAN is based on the MAC address. This method is a random means to select the root bridge.

 Rapid Per-VLAN Spanning Tree Plus (PVST + Fast)

RSTP (IEEE 802.1w) is an evolution of the original 802.1D standard and is incorporated into the IEEE 802.1D-2004 standard. The terminology of STP 802.1w remains fundamentally the same as that of the original STP IEEE 802.1D. Most of the parameters were not modified, so users familiar with STP can configure the new protocol with ease. Fast PVST + is simply the Cisco implementation of RSTP by VLAN . With fast PVST +, a separate RSTP instance is run for each VLAN.

In image 4, a network running RSTP is shown. The S1 is the root bridge with two ports designated in forwarding state. RSTP supports a new type of port: port F0 / 3 on S2 is an alternate port in discarded state. Note that there are no blocked ports. RSTP defines port states as discard, learn or send. (does not have the status of the blocking port).
RSTP increases the speed of recalculation of the spanning tree when the topology of the Layer 2 network changes. In addition, it can achieve much faster convergence in a properly configured network, sometimes only in a few hundred milliseconds. RSTP redefines the types of ports and their states. If a port is configured as an alternate or backup port, it can automatically switch to the forwarding state without waiting for the network to converge.

RSTP features

The characteristics of RSTP are briefly described below:
  • RSTP is the preferred protocol to avoid Layer 2 loops in a switched network environment. Most of the differences were established with improvements to the original Cisco 802.1D standard exclusive to Cisco. These improvements, such as BPDUs that transport and send information about port functions only to neighboring switches, do not require additional configuration and generally have better performance than previous versions owned by Cisco. They are now transparent and integrated into the operation of the protocol.
  • Improvements to the original Cisco 802.1D standard exclusive to UplinkFast and BackboneFast are not compatible with RSTP .
  • RSTP (802.1w) replaces the original 802.1D standard and, at the same time, maintains compatibility with earlier versions. Most of the terminology of the original 802.1D standard is maintained, and most of the parameters were not modified. In addition, 802.1w can be reverted to the old 802.1D standard to interoperate with older switches per port. For example, the RSTP spanning tree algorithm chooses a root bridge in the same way as the original 802.1D standard does.
  • RSTP maintains the same BPDU format as the original IEEE 802.1D standard, except that the Version field is set to 2 to indicate the RSTP protocol and the Indicators field uses all 8 bits.
  • RSTP can actively confirm that a port can undergo a secure transition to the send state without relying on any timer settings.

BPDU in RSTP

RSTP uses BPDU type 2, version 2. The original STP 802.1D protocol uses BPDU type 0, version 0. However, the switches running RSTP can communicate directly with the switches running the original STP 802.1D protocol. RSTP sends BPDU and completes the indicator byte in a slightly different way than the original 802.1D standard:
  • The protocol information can be immediately expired on a port if the greeting packets are not received for three consecutive greeting times (six seconds by default) or if the maximum age timer expires.
  • Because BPDUs are used as an activity mechanism, three BPDUs lost consecutively indicate loss of connectivity between a bridge and its neighboring root or designated bridge. The rapid expiration of information allows failures to be detected very quickly.

Edge ports

An Edge port in RSTP is a switch port that never connects to another switch device. It suffers the transition to the state of sending immediately when it is enabled.
The RSTP perimeter port concept corresponds to the PVF + PortFast feature; A perimeter port connects directly to a terminal station and assumes that there is no switch device connected to it. The RSTP perimeter ports must immediately go to the forwarding state, so the long listening and learning port states of the original 802.1D standard are omitted.
The Cisco implementation of RSTP, fast PVST +, retains the PortFast keyword using the spanning-tree portfast command for perimeter port configuration. This makes the transition from STP to RSTP smoothly.

 Link types

By using duplex mode on the port, the link type provides a categorization for each port that participates in RSTP. Depending on what is connected to each port, two different types of link can be identified:
  • Point to point : a port that operates in full-duplex mode usually connects one switch to another and is a candidate for the rapid transition to the forwarding state.
  • Shared : A port that works in half-duplex mode connects a switch to a hub that connects several devices.

The type of link can determine if the port can immediately go to the forwarding state, assuming certain conditions are met. These conditions are different for end ports and for non-end ports. Non-end ports are categorized into two types of links, point to point and shared . The type of link is determined automatically, but can be overridden with an explicit port configuration using the spanning-tree link-type parameter command .
Perimeter and point-to-point port connections are candidates for the rapid transition to the forwarding state. However, before the link type parameter is considered, RSTP must determine the port function.

Features

The characteristics of the port functions in relation to the link types include the following:
  • Root ports do not use the link type parameter. Root ports are capable of making a quick transition to the state of sending whenever the port is synchronized.
  • In most cases, alternate and backup ports do not use the link type parameter.
  • The designated ports are the ones that use the link type parameter the most. The rapid transition to the forwarding state for the designated port occurs only if the link type parameter is set to point-to-point.

No comments:

Post a Comment