Chap 3 STP CONCEPTS

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Chapter 3: SPANNING TREE

PROTOCOL (STP ) CONCEPTS

Objectives:
You will be able to:
-define STP
-know how STP works
-know the different types of STP
-configure steps by steps a STP and RSTP
Introduction
A Layer 2 network protocol known as Spanning tree protocol is used to prevent
looping within a network topology. STP helps to avoid the issues when end devices
exchange data on a local area network that contains redundant paths. In the
following lines we will learn how this protocol works, know the varieties of this
network protocol and configure step by step a STP and RSTP.

I. STP protocol in a switched network


STP is used to prevent problems by monitoring the whole network and tracking
all the links and then shut down the redundant one.

a. How STP works?


STP uses the STA (Spanning-Tree Algorithm) to create a topology database of the network.
To avoid loops, STA places some interfaces in forwarding state and other interfaces in
blocking state. STP decides in which state the port will be placed by a couple of criteria:

1. all switches in a network elect a root switch. All working interfaces on the root switch are
placed in forwarding state.
2. all other switches, called nonroot switches, determine the best path to get to the root
switch. The port used to reach the root switch (root port) is placed in forwarding state.
3. On the shared Ethernet segments, the switch with the best path to reach the root is placed
in forwarding state. That switch is called the designated switch and its port is known as the
designated port.
4. all other interfaces are placed in blocking state and will not forward frames.

b. STP protocol frames


STP uses bridge protocol data units (BPDUs), also known as configuration
messages and as its protocol frames. This uses BPDUs to represent all types of
spanning tree protocol frames.

STP enable devices to exchange BPDUs in order to establish a spanning tree. BPDUs
contain sufficient information for the devices to complete spanning tree calculation.

Configuration of BPDUs
Devices exchange configuration BPDUs to elect the root bridge and determine the port
roles. The Figure below shows the BPDUs format:

The payload of a configuration BPDU includes the following fields:

 Protocol ID—Fixed at 0x0000, which represents IEEE 802.1d.


 Protocol version ID The protocol version ID for STP is 0x00.
 BPDU type—Type of the BPDU. The value is 0x00 for a configuration BPDU.
 Flags—An 8-bit field indicates the purpose of the BPDU. The lowest bit is the Topology
Change (TC) flag. The highest bit is the Topology Change Acknowledge (TCA) flag. All
other bits are reserved.
 Root ID—Root bridge ID formed by the priority and MAC address of the root bridge.
 Root path cost—Cost of the path to the root bridge.
 Bridge ID—Designated bridge ID formed by the priority and MAC address of the
designated bridge.
 Port ID—Designated port ID formed by the priority and global port number of the
designated port.
 Message age—Age of the configuration BPDU while it propagates in the network.
 Max age—Maximum age of the configuration BPDU stored on the switch.
 Hello time—Configuration BPDU transmission interval.
 Forward delay—Delay for STP bridges to transit port state.
Devices use the root bridge ID, root path cost, designated bridge ID, designated port ID,
message age, max age, hello time, and forward delay for spanning tree calculation.

c. Process of root election


A switch with the lowest switch ID will become the root switch. A switch ID consists
of two components: the switch’s priority (by default 32,768 on Cisco switches) and
the switch’s MAC address.
d. The states of ports
In a switched network the ports on the switches can either be in forwarding state or
blocking state.
Let’s say that SW1 is elected as the root switch. All ports on SW1 are placed into
forwarding state. SW2 and SW3 choose ports with the lowest cost to reach the root
switch to be the root ports. These ports are also placed in forwarding state. On the
shared Ethernet segment between SW2 and SW3, port Fa0/1 on SW2 has the
lowest cost to reach the root switch. This port is placed in forwarding state. To
prevent loops, port Fa0/1 on SW3 is placed in blocking state.
II. The STP varieties
There exist different types of stp:
1. 802.1D – as CST (Common Spanning Tree),It is developed by IEEE.
The CST elects only one root for the whole topology. The best path is
established and all the traffic flows over that path. However this doesn’t
hold always the good way, as there can be a case in which the
optimised path to reach a VLAN is different than the initial best path.
This make it slow as it takes 32 seconds to converge.

Advantages:
 Less CPU and memory required.
Disadvantages:
 Lesser optimisation as the path is calculated following the best cost to root. The
bridge might not be the best path to reach a network.

2. Per VLAN Spanning Tree + (PVST+) – It is a spanning tree standard


developed by Cisco for its devices which finds the root bridge per VLAN. It is a
Cisco default version of STP. It finds separate 802.1d spanning tree instance for
each VLAN. It also provides backward comparability with 802.1d or CST. This is
more optimized to the IEEE because it provides optimal path selection as separate
instance of STP per VLAN is.

Advantages:
 PVST+ provides more optimization on the performance of a network than CST as it
selects root bridges per VLAN.

 Bandwidth consumption is lesser than CST.

 Optimum load balancing is achieved.


Disadvantages:
 This is slow as CST i.e. convergence time is slow. By default, Cisco switches take 50
seconds for converging.
 More resources (CPU and memory) are required.

3. 802.1w – Rapid Spanning Tree Protocol (RSTP) – It is a spanning standard developed


by IEEE which provides faster convergence than CST but holds the same idea of finding a
single root bridge in the topology. The bridge resources needed in RSTP is higher than CST
but less than PVST+ .
Advantages:
 Prevents network loops.
 Prevents redundancy.
 Faster Convergence.
 Backward compatible with STP.
4. Rapid Per VLAN Spanning Tree + (RPVST+) –This Spanning Tree standard is
developed by Cisco and provides faster convergence than PVST+ and finds separate
instance of 802.1w per VLAN. It requires much more CPU and memory than other STP
standards.

5. 802.1s (Multiple Spanning Tree) :-This standard is developed by IEEE in which


grouping of VLANs is done and for each single group, RSTP is run. This is basically a
Spanning Tree Protocol running over another Spanning Tree Protocol.
Advantages:
 prevents High redundancy
 load balancing can be achieved.
 lower CPU and memory usage are required
Disadvantages:
 More configuration is required and not easy to implement.
III- STP and RSTP configuration
a) Steps of STP Confgiuration
Configuration of the spanning tree protocol:

The STP is activated by default on VLANs and also on all newly created VLANs.
Steps of stp re-enabling:
Step 1 – enabling STP
Type the following commands in the concerned switch:

step 2:

Use the commands below to determine the root switch

Step 3:

We use the commands below to enable pvst or rapid-pvst


b) Steps of RSTP Confgiuration

RSTP Configuration Topology


STP (Spanning Tree Protocol) has four states. These STP states are: Blocking, Listenning,
Learning and Forwarding. With RSTP (Rapid Spanning Tree Protocol), the Spanning Tree
state Blocking and Listenning are bypassed. The RSTP states that starting with discarded, go
through the learning and forwarding states.

In STP (Spanning Tree Protocol), Blocking State is 20 seconds, Listenning State is 15


seconds and Learning State is 15 seconds. So, for STP, going through forwarding states
needs 50 seconds. This total time is 15 seconds in RSTP (Rapid Spanning Tree Protocol).
Because RSTP, bypasses the Blocking and Listenning states.

Let’s start to configure RSTP (Rapid Spanning Tree Protocol) on Cisco Packet Tracer.
Switch0(config)# spanning-tree mode ?
pvst Per-Vlan spanning tree mode
rapid-pvst Per-Vlan rapid spanning tree mode

Switch0 (config)# spanning-tree mode rapid-pvst


Switch0 (config)# end
Switch0 # copy running-config startup-config

Switch1 (config)# spanning-tree mode rapid-pvst


Switch1 (config)# end
Switch1 # copy running-config startup-config
TP : configuration and functionality test

Conclusion
Spanning tree defines a tree topology by electing one of the switches as a root
switch and a loop is removed from the root to all switches in the Layer 2 network.
STP forces redundant data paths into a standby (blocked) state. There exist
variants types of STP .In order to configure a STP set of steps are required.

You might also like