0% found this document useful (0 votes)
258 views14 pages

Observe STP Topology Changes and Implement RSTP

This document describes a lab to observe STP topology changes and implement RSTP. The lab objectives are to build the network, observe STP convergence and topology changes, and configure and verify RSTP. The lab uses 3 switches (D1, D2, A1) connected as shown. Basic configurations are provided to configure interfaces and VLANs. The default spanning tree is discovered, identifying A1 as the root bridge based on its MAC address.

Uploaded by

cciersman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
258 views14 pages

Observe STP Topology Changes and Implement RSTP

This document describes a lab to observe STP topology changes and implement RSTP. The lab objectives are to build the network, observe STP convergence and topology changes, and configure and verify RSTP. The lab uses 3 switches (D1, D2, A1) connected as shown. Basic configurations are provided to configure interfaces and VLANs. The default spanning tree is discovered, identifying A1 as the root bridge based on its MAC address.

Uploaded by

cciersman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Download PNETLab Platform

PNETLAB Store
PNETLab.com

Observe STP Topology Changes and


Implement RSTP
Topology:

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

Part 1: Addressing Table

Device Interface IPv4 Address

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.

Step 1: Cable the network as shown in the topology.


Attach the devices as shown in the topology diagram, and cable as necessary.

Step 2: Configure basic settings for each switch.


Console into each switch, enter global configuration mode, and apply the basic settings
and interface addressing. The startup configuration is provided below for each switch in
the topology.
Open configuration window
Switch D1
hostname D1
spanning-tree mode pvst
banner motd # D1, STP Topology Change and RSTP Lab #
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.1 255.0.0.0
no shut
3
Download PNETLab Platform
PNETLAB Store
PNETLab.com

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.

Task 2: Discover the Default Spanning Tree


Your switches have been configured and interfaces have been enabled, and the
Spanning Tree Protocol, operational by default, has already converged onto a loop-
free logical network. In this part of the lab, we will discover what that default
spanning tree looks like and evaluate why it converged the way it did. We will do this
by following the same set of steps that Spanning Tree does. We will find the Root
Bridge, then find the Root Ports, and lastly see which ports are Designated ports,
and which ports are non-Designated ports in our topology.

Step 1: Find the root bridge.


Our switches are running the Cisco default PVST+, and we have two VLANs in the
network, so we should see two root bridges.
On A1, issue the command show spanning-tree root and observe what the output tells
you about the root bridge. Amongst the lab devices being used to document this lab, A1
shows the root id with a cost of 100 and the root port as interface E0/1 for both VLAN1
and VLAN2.
Open configuration window

5
Download PNETLab Platform
PNETLAB Store
PNETLab.com

A1# show spanning-tree root


Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 32769 aabb.cc00.8800 100 2 20 15 Et0/1
VLAN0002 32770 aabb.cc00.8800 100 2 20 15 Et0/1

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.

D1# show spanning-tree root


Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 32769 aabb.cc00.8800 100 2 20 15 Et0/0
VLAN0002 32770 aabb.cc00.8800 100 2 20 15 Et0/0

D2# show spanning-tree root

Root Hello Max Fwd


Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 32769 aabb.cc00.8800 0 2 20 15
VLAN0002 32770 aabb.cc00.8800 0 2 20 15

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

Step 2: Find the Root Port for each switch.


Each switch will have one single root port. This port represents the lowest path cost to
the root bridge. Path Cost is the total of the Port Costs in the path to the root bridge.
The Port Cost is based upon the bandwidth value of the port, and it can either be
dynamically assigned or statically configured.
As we saw in the previous output of show spanning-tree root on each switch, the Path
Cost can be different amongst switches. In this case, the path cost from A1 to D1 is 100,
reflecting connectivity via a Ethernet port, while the path cost from D2 to D1 is 0.
Open configuration window
D1# show spanning-tree root

Root Hello Max Fwd


Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 32769 aabb.cc00.8800 100 2 20 15 Et0/0
VLAN0002 32770 aabb.cc00.8800 100 2 20 15 Et0/0

D2# show spanning-tree root

Root Hello Max Fwd


Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 32769 aabb.cc00.8800 0 2 20 15
VLAN0002 32770 aabb.cc00.8800 0 2 20 15

7
Download PNETLab Platform
PNETLAB Store
PNETLab.com

A1# show spanning-tree root


Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
---------------- -------------------- --------- ----- --- --- ------------
VLAN0001 32769 aabb.cc00.8800 100 2 20 15 Et0/1
VLAN0002 32770 aabb.cc00.8800 100 2 20 15 Et0/1

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

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)


Address aabb.cc00.8a00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- --------------------------------
Et0/0 Altn BLK 100 128.1 Shr
Et0/1 Root FWD 100 128.2 Shr
Et0/2 Altn BLK 100 128.3 Shr
Et0/3 Altn BLK 100 128.4 Shr

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

Bridge ID Priority 32770 (priority 32768 sys-id-ext 2)


Address aabb.cc00.8a00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- --------------------------------
Et0/0 Altn BLK 100 128.1 Shr
Et0/1 Root FWD 100 128.2 Shr
Et0/2 Altn BLK 100 128.3 Shr
Et0/3 Altn BLK 100 128.4 Shr

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

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)


Address aabb.cc00.8800
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- --------------------------------
Et0/0 Desg FWD 100 128.1 Shr
Et0/1 Desg FWD 100 128.2 Shr
Et0/2 Desg FWD 100 128.3 Shr
Et0/3 Desg FWD 100 128.4 Shr

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

Bridge ID Priority 32770 (priority 32768 sys-id-ext 2)


Address aabb.cc00.8800
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- --------------------------------
Et0/0 Desg FWD 100 128.1 Shr
Et0/1 Desg FWD 100 128.2 Shr
Et0/2 Desg FWD 100 128.3 Shr
Close configuration window

Step 3: Identify Designated Ports.


The Spanning Tree Designated Port can be traced back to the early versions of the
protocol, which were developed when LAN segments were shared, multiaccess networks.

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

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)


Address aabb.cc00.8800
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 15 sec

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- --------------------------------
Et0/0 Desg FWD 100 128.1 Shr
Et0/1 Desg FWD 100 128.2 Shr
Et0/2 Desg FWD 100 128.3 Shr
Et0/3 Desg FWD 100 128.4 Shr

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

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)


Address aabb.cc00.8a00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


------------------- ---- --- --------- -------- --------------------------------
Et0/0 Altn BLK 100 128.1 Shr
Et0/1 Root FWD 100 128.2 Shr
Et0/2 Altn BLK 100 128.3 Shr
Et0/3 Altn BLK 100 128.4 Shr

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

Task 3: Implement and Observe Rapid Spanning Tree Protocol


In Part 3, you will implement Rapid Spanning Tree Protocol (RSTP) on all the switches.
Using the same basic rules, RSTP speeds up convergence significantly.
On D2, issue the debug spanning-tree events command, and then issue the shutdown
command for interface g1/0/1 and observe the output.
Open c
D2# debug spanning-tree events
D2# config t
D2(config)# interface e0/0
D2(config-if)# shutdown
D2(config-if)#
*Oct 27 14:50:51.779: STP: VLAN0001 we are the spanning tree root
*Oct 27 14:50:51.779: STP[1]: Generating TC trap for port Ethernet0/0
*Oct 27 14:50:51.779: STP: VLAN0002 we are the spanning tree root
*Oct 27 14:50:51.779: STP[2]: Generating TC trap for port Ethernet0/0
D2(config-if)#
*Oct 27 14:50:53.778: %LINK-5-CHANGED: Interface Ethernet0/0, changed state to
administratively down
*Oct 27 14:50:54.857: %LINEPROTO-5-UPDOWN: Line protocol on Interface
Ethernet0/0, changed state to down
D2(config-if)#
*Oct 27 14:51:11.214: STP: VLAN0002 Topology Change rcvd on Et0/1
*Oct 27 14:51:11.215: STP: VLAN0001 Topology Change rcvd on Et0/1
D2(config-if)#
onfiguration window
From the above output, you can see that it took a total of about 20 seconds for spanning
tree to adjust to the topology change. Rapid Spanning Tree can adjust much faster.
On D2, change the spanning tree mode to rapid-pvst:
D2(config-if)#no shutdown
D2(config-if)#
*Oct 27 14:56:56.073: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Oct 27 14:56:57.269: set portid: VLAN0001 Et0/0: new port id 8001
*Oct 27 14:56:57.269: STP: VLAN0001 Et0/0 -> listening
*Oct 27 14:56:57.269: set portid: VLAN0002 Et0/0: new port id 8001

13
Download PNETLab Platform
PNETLAB Store
PNETLab.com

*Oct 27 14:56:57.269: STP: VLAN0002 Et0/0 -> listening


D2(config-if)#
*Oct 27 14:56:58.269: %LINEPROTO-5-UPDOWN: Line protocol on Interface
Ethernet0/0, changed state to up
D2(config-if)#
*Oct 27 14:57:12.274: STP: VLAN0001 Et0/0 -> learning
*Oct 27 14:57:12.274: STP: VLAN0002 Et0/0 -> learning
D2(config-if)#
*Oct 27 14:57:27.282: STP[1]: Generating TC trap for port Ethernet0/0
*Oct 27 14:57:27.282: STP: VLAN0001 Et0/0 -> forwarding
*Oct 27 14:57:27.282: STP[2]: Generating TC trap for port Ethernet0/0
*Oct 27 14:57:27.282: STP: VLAN0002 Et0/0 -> forwarding

14

You might also like