Observe STP Topology Changes and Implement RSTP
Observe STP Topology Changes and Implement RSTP
PNETLAB Store
PNETLab.com
https://user.pnetlab.com/store/labs/detail?id=16038113072199
Objectives
Part 1: Build the Network and Configure Basic Device Settings
Part 2: Observe STP Convergence and Topology Change
Part 3: Configure and Verify Rapid Spanning Tree
1
Download PNETLab Platform
PNETLAB Store
PNETLab.com
D1 VLAN1 10.0.0.1/8
D2 VLAN1 10.0.0.2/8
A1 VLAN1 10.0.0.3/8
Background / Scenario
The potential effect of a loop in the Layer 2 network is significant. Layer 2 loops could
impact connected hosts as well as the network equipment. Layer 2 loops can be
prevented by following good design practices and careful implementation of the
Spanning Tree Protocol. In this lab, you will observe the operation of spanning tree
protocols to protect the Layer 2 network from loops and topology disruptions. The
terms "switch" and "bridge" will be used interchangeably throughout the lab.
Note: This lab is an exercise in deploying and verifying various STP mechanisms. It does
not reflect networking best practices.
Note: The switches used with CCNP hands-on labs are Cisco 3650 with Cisco IOS XE
release 16.9.4 (universalk9 image) and Cisco 2960+ with IOS release 15.2 (lanbase
image). Other routers and Cisco IOS versions can be used. Depending on the model
and Cisco IOS version, the commands available and the output produced might vary
from what is shown in the labs.
Note: Ensure that the switches have been erased and have no startup configurations.
If you are unsure contact your instructor.
Required Resources
• 2 Switches (Cisco 3650 with Cisco IOS XE release 16.9.4 universal image or
comparable)
• 1 Switch (Cisco 2960+ with Cisco IOS release 15.2 lanbase image or comparable)
• 1 PC (Windows with a terminal emulation program, such as Tera Term)
• Console cables to configure the Cisco IOS devices via the console ports
• Ethernet cables as shown in the topology
2
Download PNETLab Platform
PNETLAB Store
PNETLab.com
Part 2: Instructions
Task 1: Build the Network and Configure Basic Device Settings and Interface
Addressing
In Part 1, you will set up the network topology and configure basic settings and
interface addressing on routers.
exit
Switch D2
hostname D2
banner motd # D2, STP Topology Change and RSTP Lab #
spanning-tree mode pvst
line con 0
exec-timeout 0 0
logging synchronous
exit
interface range g1/0/1-24, g1/1/1-4, g0/0
shutdown
exit
interface range g1/0/1, g1/0/5-6
switchport mode trunk
no shutdown
exit
vlan 2
name SecondVLAN
exit
interface vlan 1
ip address 10.0.0.2 255.0.0.0
no shut
exit
Switch A1
hostname A1
banner motd # A1, STP Topology Change and RSTP Lab #
spanning-tree mode pvst
line con 0
exec-timeout 0 0
logging synchronous
exit
interface range f0/1-24, g0/1-2
shutdown
4
Download PNETLab Platform
PNETLAB Store
PNETLab.com
exit
interface range f0/1-4
switchport mode trunk
no shutdown
exit
vlan 2
name SecondVLAN
exit
interface vlan 1
ip address 10.0.0.3 255.0.0.0
no shut
exit
Set the clock on each switch to UTC time.
Save the running configuration to startup-config.
Close configuration window
Note: Outputs and Spanning Tree topologies highlighted in this lab may be different
than what you observe using your own equipment. It is critically important for you to
understand how Spanning Tree makes its decisions, and how those decisions impact
the operational topology of the network.
5
Download PNETLab Platform
PNETLAB Store
PNETLab.com
Because we know from the physical topology diagram that A1 is connected to D1 using
E0/0, and that interface is a FastEthernet interface, therefore having a cost of 100, D1 is
the root bridge for both VLAN 1 and VLAN 2. The question at this point is – why?
The root bridge is elected based upon which switch has the highest Bridge ID (BID). The
BID is made up of a configurable priority value (which defaults to 32768) and the base
MAC address for the switch. Use the command show spanning-tree root to gather that
information from your switches to support the root bridge decision.
The first thing to look at is the priority value. It is 32768 by default. Because we are
working with PVST+, a differentiator is added – the priority value is modified with the
extended system ID, which is equal to the VLAN number. You can see in the output here
that our three devices are using default priorities – 32769 for VLAN 1 (32768 + 1) and
6
Download PNETLab Platform
PNETLAB Store
PNETLab.com
32770 for VLAN 2 (32768 + 2). For each VLAN, the priority values are the same for each
of the three switches. When this happens, the rest of the BID is taken into account. The
rest of the BID includes the base MAC address. The lowest base MAC address is used to
break the tie.
Amongst the three switches being used to document this lab, D1 has the lowest base
MAC address. The OUI portion of each MAC address is the same. The first set of
hexadecimal characters are different; 0x28 is a lower number than 0x5d. This is what
has caused D1 to be elected as the root bridge.
Close configuration window
7
Download PNETLab Platform
PNETLAB Store
PNETLab.com
These are direct connections to the root, so port cost and path cost are the same. This
can be seen in the output of show spanning-tree.
A1#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address aabb.cc00.8800
Cost 100
Port 2 (Ethernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
VLAN0002
Spanning tree enabled protocol ieee
Root ID Priority 32770
8
Download PNETLab Platform
PNETLAB Store
PNETLab.com
Address aabb.cc00.8800
Cost 100
Port 2 (Ethernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Our topology does not really illustrate the difference between port cost and path cost
very well, so we will introduce a change in the network to achieve this. At D1, shutdown
the e0/0 interface. The result of this is that D2 will have to change the port it considers
root, and we will then see the difference between port cost and path cost.
D1(config)# interface e0/0
D1(config-if)# shutdown
On D2, issue the command show spanning-tree and you will see the port cost and path
cost values separating themselves.
D2#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address aabb.cc00.8800
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
9
Download PNETLab Platform
PNETLAB Store
PNETLab.com
VLAN0002
Spanning tree enabled protocol ieee
Root ID Priority 32770
Address aabb.cc00.8800
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
10
Download PNETLab Platform
PNETLAB Store
PNETLab.com
In these networks, there was a very real possibility that there could be users attached to
a segment between two switches.
The job of the Designated Port back then was to ensure that users had a way to access
the network from a given segment, and there was always one Designated Port on each
segment. In the switched networks of today, there are very few shared segments, so the
job of the Designated Port is more to help maintain the network topology.
A Designated Port stays active in the topology, both sending BPDUs and learning MAC
addresses. Every port on the Root Bridge is a Designated Port. Further, there is one
Designated Port on every segment that is not attached directly to the root.
Open configuration window
If you have not already done so, issue the no shutdown command for D1 interface e0/0.
This will restore our full topology and allow for the non-root attached segment to exist
(the links between A1 and D2).
On D2, issue the show spanning-tree command, and you will see that there are two
ports now identified as being in the Designated Port role.
D2#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address aabb.cc00.8800
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
11
Download PNETLab Platform
PNETLAB Store
PNETLab.com
And now look at the segments from the A1 side. Issue the show spanning-tree
command on A1.
A1#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address aabb.cc00.8800
Cost 100
Port 2 (Ethernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interfaces Et0/2 and Et0/3 on A1 are in the Alternate Role, which is the Cisco PVST+
version of the IEEE 802.1D Discarding role. These interfaces are up and receiving BPDUs
from the Designated Ports on each segment, but they will not learn MAC addresses or
forward traffic until they stop receiving those BDPUs and move to the Designated state.
Why is D2 controlling the Designated Port role on these two segments? Because from
the middle of the segment, D2 has a lower cost to the root bridge than does A1.
You may have noticed in the previous output that the two links from A1 to D1 were not
being used.
Close configuration window
12
Download PNETLab Platform
PNETLAB Store
PNETLab.com
13
Download PNETLab Platform
PNETLAB Store
PNETLab.com
14