0% found this document useful (0 votes)
22 views12 pages

Lab 2.1

This document describes a lab activity on configuring and observing spanning tree protocol (STP) and per-VLAN spanning tree protocol (PVST+) on a network topology. The objectives are to determine the root bridge, observe STP port selection based on path cost and port priority, and implement load balancing using PVST+ configuration.

Uploaded by

Riia Pangilinan
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)
22 views12 pages

Lab 2.1

This document describes a lab activity on configuring and observing spanning tree protocol (STP) and per-VLAN spanning tree protocol (PVST+) on a network topology. The objectives are to determine the root bridge, observe STP port selection based on path cost and port priority, and implement load balancing using PVST+ configuration.

Uploaded by

Riia Pangilinan
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/ 12

Lab 2.

1 – Observing STP and Configuring PVST+


This activity comes with an accompanying Packet Tracer file with a partially configured network. Make sure to
download the Packet Tracer file from the Animospace assignment page.

Addressing Table

Device Interface IP Address Subnet Mask

PC1 NIC 192.168.1.1 255.255.255.0


PC2 NIC 192.168.1.2 255.255.255.0
PC3 NIC 192.168.2.1 255.255.255.0
PC4 NIC 192.168.2.2 255.255.255.0

Objectives
Part 1: Determine the Root Bridge and Port Roles
Part 2: Observe STP Port Selection Based on Path Cost
Part 3: Observe STP Port Selection Based on Port Priority
Part 4: Implement Load Balancing using PVST+ Configuration

Background / Scenario
Redundancy increases the availability of devices in the network topology by protecting the network from a
single point of failure. Redundancy in a switched network is accomplished through the use of multiple
switches or multiple links between switches. When physical redundancy is introduced into a network design,
loops and duplicate frames can occur.

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 1 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

The Spanning Tree Protocol (STP) was developed as a Layer 2 loop-avoidance mechanism for redundant
links in a switched network. STP ensures that there is only one logical path between all destinations on the
network by intentionally blocking redundant paths that could cause a loop.
The Per-VLAN Spanning Tree (PVST) protocol is a Cisco proprietary enhancement of STP that maintains a
separate spanning tree instance per VLAN in the network. This allows each spanning tree to be
independently fine-tuned to implement load balancing in the network.

Part 1: Determine the Root Bridge


Every spanning-tree instance (switched LAN or broadcast domain) has a switch designated as the root
bridge. The root bridge serves as a reference point for all spanning-tree calculations to determine which
redundant paths to block.
An election process determines which switch becomes the root bridge. The switch with the lowest bridge
identifier (BID) becomes the root bridge. The BID is made up of a bridge priority value and the MAC address
of the switch.

Step 1: Temporarily disable selected ports on the switches.


Temporarily deactivate ports F0/2 and G0/1 on S4.
S4(config)# interface f0/2
S4(config-if)# shutdown
S4(config-if)# interface g0/1
S4(config-if)# shutdown
S4(config-if)# end

Step 2: Display spanning tree information.


a. Issue the show spanning-tree command on S1. The Bridge ID Priority is calculated by adding the priority
value and the extended system ID. The extended system ID is always the VLAN number. Currently, all
four switches have equal Bridge ID Priority values (32769 = 32768 + 1, where default priority = 32768,
VLAN number = 1); therefore, the switch with the lowest MAC address becomes the root bridge. The root
bridge is identified by the switch in the command output under the Root ID section
S1# show spanning-tree

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0001.64C4.1250
Cost 38
Port 1(FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

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


Address 000B.BEBB.35C4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa0/1 Root FWD 19 128.1 P2p
Fa0/3 Altn FWD 19 128.3 P2p
Fa0/5 Desg FWD 19 128.5 P2p

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 2 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

b. Use the show spanning-tree command on the rest of switches to gather information about the spanning
tree status of each switch. Complete the table.
Open configuration window

Port Role Status


Switch Port
(Root, Desg, Altn) (FWD, BLK…)
F0/1 Root FWD
S1
F0/3 Altn BLK
F0/1 Desg FWD
S2
S2
F0/3 Root FWD
F0/1 Desg FWD
S3
S3
F0/3 Desg FWD
F0/1 Root FWD
S4
S3

F0/3 Desg FWD

Based on the output from your switches, answer the following questions.

Which switch is the root bridge? S3

Why did spanning tree select this switch as the root bridge?

It has the lowest bridge ID in hexadecimal.

Notice that Packet Tracer uses a different color for the link light on one of the connections between the
switches. What do you think does this link light mean?
It indicates that the link is blocked.

Why did the spanning tree algorithm select this port as the non-designated (blocked) port?

It is based on the port with the higher path cost.

Given the resulting spanning tree, what path do data frames take to go from PC1 to PC2?

It would take the path from PC1 to S1, to S4, then to S3, and finally to PC2

Part 2: Observe STP Port Selection Based on Path Cost


The spanning tree algorithm (STA) uses the root bridge as the reference point and then determines which
ports to block, based on path cost. The port with the lower path cost is preferred. If path costs are equal, then
spanning tree compares BIDs. If the BIDs are equal, then the port priorities are used to break the tie. Lower
values are always preferred. In Part 2, you will change the path cost to control which port is blocked by
spanning tree.

Step 1: Determine current path cost.


With the current topology, all switches are linked using Fast Ethernet connections which use a default link
cost of 19. The spanning tree algorithm aggregates the cost of each individual link to determine the overall
path costs which is used as basis to select the least cost path to the root bridge.

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 3 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

Issue the show spanning-tree command on S1. The Root ID section indicates the total cost of the least cost
path calculated by the switch to reach the root bridge.
S1# show spanning-tree

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0001.64C4.1250
Cost 38
Port 1(FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

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


Address 000B.BEBB.35C4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa0/1 Root FWD 19 128.1 P2p
Fa0/3 Altn FWD 19 128.3 P2p
Fa0/5 Desg FWD 19 128.5 P2p
Fa0/6 Desg FWD 19 128.6 P2p

Notice that the cost is currently 38. This is because to reach the root bridge (S3) through S2, S1 crosses two
Fast Ethernet links with a cost of 19 each.

What would have been the path cost of S1 to S3 if going through S4? 38

Step 2: Change path cost.


You will now change the cost of the path going through S4 to influence the path of S1 to the root bridge by
swapping the Fast Ethernet connection from S4 to the root bridge with a Gigabit connection. Deactivate F0/1
on S4 and activate G0/1 instead.
S4(config)# interface f0/1
S4(config-if)# shutdown
S4(config-if)# interface g0/1
S4(config-if)# no shutdown

Step 3: Observe spanning tree changes.


Wait 30 seconds for the spanning-tree to adjust to the new topology (or you may click on the fast-forward
button of Packet Tracer). Re-issue the show spanning-tree command S1. Observe that the path cost to root
has now changed and the spanning tree is now blocking the port connected to S2.

S1# show spanning-tree

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 4 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

Address 0001.64C4.1250
Cost 23
Port 3(FastEthernet0/3)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

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


Address 000B.BEBB.35C4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Fa0/1 Altn FWD 19 128.1 P2p
Fa0/3 Root FWD 19 128.3 P2p
Fa0/5 Desg FWD 19 128.5 P2p
Fa0/6 Desg FWD 19 128.6 P2p

Why did spanning tree change the previously blocked port to a root port, and block the port that was a root
port on the other S2?

Because it now has the lower path cost.

How did the swapping of connection types between S4 and S3 affect the cost of the path? Hint: Observe the
cost of the G0/1 port using show spanning-tree command on S4.

The cost was reduced from the default cost of Fast Ethernet (19) to the lower cost of Gigabit Ethernet (4).

Part 3: Observe STP Port Selection Based on Port Priority


If path costs are equal, then spanning tree compares BIDs. If the BIDs are equal, then the port priorities are
used to break the tie. The default port priority value is 128. STP aggregates the port priority with the port
number / port ID to break ties. Lower values are always preferred. In Part 3, you will activate the redundant
paths between S4 and S3 to observe how STP selects a port using the port priority.
a. Activate the redundant link between S1 and S4 by enabling F0/2 on S4.
S4(config)# interface f0/2
S4(config-if)# no shutdown
S4(config-if)# end
b. Wait 30 seconds for STP to complete the port transition process (or you may click on the fast-forward
button of Packet Tracer), and then issue the show spanning-tree command on S1. Observe that the root
port has moved to the lower numbered port linked to the upstream switch and blocked the previous root
port.
S1# show spanning-tree

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0001.64C4.1250

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 5 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

Cost 23
Port 2(FastEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

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


Address 000B.BEBB.35C4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20

Interface Role Sts Cost Prio.Nbr Type


---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Altn BLK 19 128.1 P2p
Fa0/2 Root FWD 19 128.2 P2p
Fa0/3 Altn BLK 19 128.3 P2p
Fa0/5 Desg FWD 19 128.5 P2p
Fa0/6 Desg FWD 19 128.6 P2p

What port did STP select as the root port on S1? fa0/2

Why did STP select this port as the root port on S1?

It has the lowest path cost to reach the root bridge.

c. Adjust the port priority of the upstream switch S4 to influence the selection of the root port on S1 by
issuing the interface spanning-tree vlan port-priority command. Port priorities are set at 128 by default
and may be adjusted in increments of 16.
S4(config)# interface f0/3
S4(config-if)# spanning-tree vlan 1 port-priority 112
d. Wait for the spanning tree to adjust to the new topology (or you may click on the fast-forward button of
Packet Tracer) then issue the show spanning-tree command on S4. Confirm that the port priority has
now changed for F0/3.
S4# show spanning-tree

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0001.64C4.1250
Cost 4
Port 25(GigabitEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

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


Address 0030.F250.0126
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 6 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

Interface Role Sts Cost Prio.Nbr Type


---------------- ---- --- --------- -------- --------------------------------
Fa0/2 Desg FWD 19 128.2 P2p
Fa0/3 Desg FWD 19 112.3 P2p
Gi0/1 Root FWD 4 128.25 P2p

e. Issue the show spanning-tree command on S1. Observe that the root port has again moved back to
F0/3 from F0/2.
S1# show spanning-tree

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0001.64C4.1250
Cost 23
Port 3(FastEthernet0/3)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

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


Address 000B.BEBB.35C4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20

Interface Role Sts Cost Prio.Nbr Type


---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Altn BLK 19 128.1 P2p
Fa0/2 Altn BLK 19 128.2 P2p
Fa0/3 Root FWD 19 128.3 P2p
Fa0/5 Desg FWD 19 128.5 P2p
Fa0/6 Desg FWD 19 128.6 P2p

Part 4: Implement Load Balancing using PVST+ Configuration


The default STP variant used on Cisco switches is Per VLAN Spanning Tree Protocol (PVST+). PVST+
creates a separate spanning tree instance per VLAN which makes it possible to fine-tune each spanning tree
to effectively balance the traffic load in the network. In Part 4, you will use PVST+ to adjust the spanning trees
to create different paths for traffic of different VLANs.

Step 1: Modify the switch topology.


a. Disconnect the G0/1 and F0/2 links of S4 to S3 and S1 respectively.
b. Reenable the F0/1 interface of S4.
S4(config)# interface f0/1
S4(config-if)# no shutdown
S4(config-if)# end

Step 2: Create a new VLAN in the network.


a. Configure ports connecting ALL switches as trunks. A sample configuration is shown below.
S1(config)# interface range f0/1-3

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 7 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

S1(config-if-range)# switchport mode trunk


S1(config-if-range)# end
b. Create VLAN 2 on ALL switches. A sample configuration is shown below
S1(config)# vlan 2
c. Assign fa0/6 on S1 and S3 to VLAN 2
S1(config)# interface f0/6
S1(config)# switchport access vlan 2

S3(config)# interface f0/6


S3(config)# switchport access vlan 2
d. Test connectivity between hosts.

Can PC1 ping PC2? Yes

Can PC3 ping PC4? Yes

If any of these do not work, recheck your configurations and troubleshoot VLAN and trunk configurations
as necessary.

Step 3: Adjust the spanning tree of each VLAN


Spanning trees may be manipulated by adjusting the bridge priority of switches to influence root bridge
election.
In PVST+, the lower 12 bits of the 20-bit BPDU bridge priority field is repurposed to contain the VLAN ID of
the spanning tree; hence when adjusting the bridge priority, one can only do so in increments of 4096.
a. Issue the show spanning-tree command on the switches. Observe that there are now two spanning tree
details listed in the output – each corresponding to a VLAN currently active in the network.
S1#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0001.64C4.1250
Cost 38
Port 1(FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

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


Address 000B.BEBB.35C4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20

Interface Role Sts Cost Prio.Nbr Type


---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Root FWD 19 128.1 P2p
Fa0/3 Altn BLK 19 128.3 P2p
Fa0/5 Desg FWD 19 128.5 P2p

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 8 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

VLAN0002
Spanning tree enabled protocol ieee
Root ID Priority 32770
Address 0001.64C4.1250
Cost 38
Port 1(FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

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


Address 000B.BEBB.35C4
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20

Interface Role Sts Cost Prio.Nbr Type


---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Root FWD 19 128.1 P2p
Fa0/3 Altn BLK 19 128.3 P2p
Fa0/6 Desg FWD 19 128.6 P2p

Currently, all switches are set equally at the default bridge priority value.

What is the bridge priority value of the switches for VLAN 1? 32769

What is the bridge priority value of the switches for VLAN 2? 32770

Why do the bridge priorities appear to be different values between VLAN 1 and VLAN2?

Because PVST+ uses the lower 12 bits of the bridge priority field to include the VLAN ID.

b. Influence the flow of traffic for each VLAN by manipulating the root bridge of their respective spanning
trees through bridge priority adjustment. Set S2 as the primary and S4 as the secondary root bridges of
VLAN 1; and S2 as secondary and S4 as primary root bridges of VLAN 2.
S2(config)# spanning-tree vlan 1 root primary
S2(config)# spanning-tree vlan 2 root secondary

S4(config)# spanning-tree vlan 2 root primary


S4(config)# spanning-tree vlan 1 root secondary
c. Wait approximately 30 seconds for the spanning trees to recalculate (or click the fast forward button a few
times) then issue the show spanning-tree command on the switches.
Record the spanning tree information of each switch in the table below:

VLAN 1 VLAN 2

Switch Bridge Priority Port Port Role Bridge Priority Port Port Role

F0/1 Root F0/1 Root


S1 32769 32770
F0/3 Alternate F0/3 Alternate

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 9 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

VLAN 1 VLAN 2

Switch Bridge Priority Port Port Role Bridge Priority Port Port Role

F0/1 Root F0/1 Root


S2 32769 32770
S2
F0/3 Alternate F0/3 Alternate
F0/1 Root F0/1 Root
S3 32769 32770
S3
F0/3 Alternate F0/3 Alternate
F0/1 Root F0/1 Root
S4
S3
32770 32769
F0/3 Alternate F0/3 Alternate

d. Observe the link lights of the switch trunks.


What has changed after the bridge priority adjustments?

The link lights may have changed to indicate new root and designated ports for each VLAN, affecting
the active links.

Why do you think have the recent configurations resulted in these link light changes?

The configurations changed the root bridge for each VLAN.

Step 4: Observe the paths traversed by VLAN traffic.


a. The simulation mode of Packet Tracer allows observation of packet movement through the network. Use
this mode to view how the traffic of each VLAN travels through switch links based on their respective
spanning trees.
1) Switch Packet Tracer to simulation mode by clicking on the button on the lower right of the window.

2) Edit the packet filter so that only ping packets will be observed. First click on the ‘Show All/None’
button then click on the ‘Edit Filters’ button

3) From the resulting pop-up window, enable ICMP then close the pop-up.

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 10 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

b. Simulate a ping from PC1 to PC2 by clicking on the simple PDU button of Packet Tracer.

Once your cursor changes to a PDU symbol, first click on PC1 (to specify the PDU source), then click on
PC2 (to specify the destination)
c. Click on the play button to begin the simulation then observe the path taken by the packet. You may
adjust the animation speed by moving the speed slider to the right or left.

What path does the ping packet take to travel from PC1 to PC2?

PC1, S1, S4, S3, PC2.

d. Clear the simulation by clicking on the Delete button in the Scenario pane.

e. Perform a simulated ping between PC3 to PC4 this time using the same procedure and observe the path
taken.
What path does the ping packet take to travel from PC3 to PC4?

PC3, S1, S4, S3, PC4.

Reflection
1. What is the value of having redundant paths in a switched network?

Redundant paths in a switched network enhance reliability and availability. They provide alternative
routes in case of link failures, minimizing downtime and ensuring continuous connectivity.

2. Based on your tests and observations, in what order does a switch prioritize the following factors when
selecting which among its ports to assign as the root port? (1= first, 4= last)

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 11 of 12
Lab – Configuring and Verifying Standard IPv4 ACLs

2 Lowest upstream switch BID

3 Lowest upstream switch interface ID

1 Lowest path cost

4 Lowest upstream switch interface priority

3. How does the use of PVST+ contribute to more efficient utilization of switch links in a network?

PVST+ contributes to more efficient link utilization by creating separate spanning tree instances per
VLAN. This allows switches to independently optimize paths for each VLAN, reducing congestion and
ensuring better load balancing.

© 2024 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 12 of 12

You might also like