AOS-CX Simulator Lab - Spanning Tree Basics Lab Guide
AOS-CX Simulator Lab - Spanning Tree Basics Lab Guide
WRITE MEM SAVED CONFIGS DON’T IMPORT CORRECTLY, READER SHOULD COPY/PASTE LAB CONFIGS FROM APPENDIX
INTO LAB IF REQUIRED.
TABLE OF CONTENTS
Lab Objective .............................................................................................................................................. 1
Lab Overview .............................................................................................................................................. 2
Lab Network Layout .................................................................................................................................... 4
Lab Tasks ................................................................................................................................................... 5
Task 1 - Lab setup ...................................................................................................................................... 5
Task 2 – Enable Spanning Tree on Switch A, B & C and review output ...................................................... 6
Task 3 – Changing Bridge priorities .......................................................................................................... 10
Task 4 – Changing port costs ................................................................................................................... 13
Appendix – Complete Configurations ........................................................................................................ 15
Lab Objective
This lab is aimed at audiences who have little knowledge of spanning-tree or wish to have a ‘refresh’ on the key spanning tree
concepts.
At the end of this workshop, you will be able to implement and understand the basic configuration to enable the Spanning Tree
Protocol (STP).
The main goal of this lab is to deploy a basic LAN Topology with redundant links, configure and enable spanning -tree and
observe the STP status and behavior under normal conditions.
The key STP concepts of spanning tree root bridge, root port, designated bridge and designated port, path cost and STP timers
are introduced to consolidate understanding.
This lab concentrates on the STP protocol leveraging MSTP with a default region 0 to simplify configuration. MSTP is backwardly
compatible with STP (based on the IEEE 802.1d standard of to eliminate loops at the data link layer in a LAN) and it this
configuration profile which is used in the lab.
In a narrow sense, STP refers to IEEE 802.1d STP. In a broad sense, STP refers to the IEEE 802.1d STP and various enhanced
spanning tree protocols derived from that protocol, such as RPVST+ and MSTP.
1
Lab Guide
Deploying basic Spanning Tree
The underlying concepts of STP apply to all Spanning tree protocols and it is these fundamental concepts that are the focus of
this lab.
Lab Overview
LANs often have redundant links as backups in case of failures, but loops are a very serious problem. Devices running STP
detect loops in the network by exchanging information with one another. They eliminate loops by selectively blocking certain
ports to prune the loop structure into a loop-free tree structure. This avoids proliferation and infinite cycling of packets that would
occur in a loop network.
In the lab, MSTP with region 0 , the default region, will be enabled on all switches to participate in the spanning-tree.
BPDUs
STP uses bridge protocol data units (BPDUs), also known as configuration messages, as its protocol packets. STP-enabled
network devices exchange BPDUs to establish a spanning tree. STP uses the following types of BPDUs:
• Configuration BPDUs: Used by the network devices to calculate a spanning tree and maintain the spanning tree
topology.
• Topology change notification (TCN) BPDUs: Use to notify network devices of network topology changes.
Root Bridge
A tree network must have a root bridge. The entire network contains only one root bridge, and all the other
bridges in the network are called leaf nodes. The root bridge is not permanent, but can change with changes
Upon initialization of a network, each switch device generates and periodically sends configuration BPDUs, with
itself as the root bridge. After network convergence, only the root bridge generates and periodically sends
Root Port
On a non-root bridge, the port which has the least cost to reach the root bridge is the root port.
2
Lab Guide
Deploying basic Spanning Tree
The root port communicates with the root bridge. Each non-root bridge has only one root port. The root
Designated port
A designated port is a not a root port but is it permitted to forward traffic . Designated ports are selected per segment based on
the ‘port’ cost on either side of the segment and used by STP for the total cost calculation back to the root bridge. If one end of a
switch link (segment) is a designated port then the other end is a root port or a ‘blocked’ port. All ports on the root bridge are
assigned as designated ports.
Alternate port
An alternate port relates to the blocking state of spanning tree (802.1D) . A blocked port is neither the root port or the designated
port.
Path cost
Path cost is a reference value used fo link selection in STP. STP calculates the path costs to select the preferred links and
blocks redundant links to prune the network into a loop free tree.
3
Lab Guide
Deploying basic Spanning Tree
4
Lab Guide
Deploying basic Spanning Tree
Lab Tasks
Task 1 - Lab setup
MAC addressing and forwarding states will vary between labs and are presented as examples for illustration along with the
interface forwarding states..
SwitchA
SwitchA#
END OF TASK1
5
Lab Guide
Deploying basic Spanning Tree
• Identify the current root bridge within the topology using the ‘sh spanning-tree’ command
Enable spanning-tree
SwitchA(config)# spanning-tree
On all switches
sh spanning-tree
Example output –
SwitchA
SwitchA# sh spanning-tree
MST0
MAC-Address: 08:00:09:1a:7c:31
MAC-Address: 08:00:09:fb:91:8b
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
SwitchB
SwitchB# sh spanning-tree
6
Lab Guide
Deploying basic Spanning Tree
MST0
MAC-Address: 08:00:09:1a:7c:31
MAC-Address: 08:00:09:1a:7c:31
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
SwitchC
SwitchC# sh spanning-tree
MST0
MAC-Address: 08:00:09:1a:7c:31
MAC-Address: 08:00:09:d6:0c:85
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
Bridge Priorities
7
Lab Guide
Deploying basic Spanning Tree
Every switch participating spanning tree has a bridge priority. The switch with the lowest bridge priority becomes the ‘root’ bridge.
The default bridge priority is 37268 and all switches in this example have the default bridge priority of 32768.
• The tie break if each spanning tree switch ‘bridge’ has the same bridge priority is the bridge mac address.
• If all switches have the same spanning tree bridge priority the switch with the lowest bridge mac address becomes the
root bridge.
In the example, Switch A,B & Switch C output is shown. All switches have the same bridge priority, but Switch B has a lower
bridge mac address and becomes the root bridge.
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
Port 1/1/1 is in the ‘root ‘ port role and is in the forwarding state to the root bridge – to Switch B
Port 1/1/2 is in the ‘Alternate’ role and is in the ‘blocking’ state – to Switch C
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
------------ -------------- ---------- -------------- ---------- ---------- ----- ----- ---------- ---------- ----------
Ports 1/1/1 & 1/1/2 are both in the ‘Designated’ port role and are forwarding to Switch A and Switch C respectively
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
------------ -------------- ---------- -------------- ---------- ---------------- ---------- ---------- ---------- ----------
Port 1/1/2 is the root forwarding port. The port with the least cost to the root bridge.
Switch A port 1/1/2 is in the alternate blocking state to provide a loop free network.
The spanning tree topology in this example will look like the example below(exact port forwarding states in other labs may vary
from this example):-
8
Lab Guide
Deploying basic Spanning Tree
• The STP root bridge will have all STP ports in the ‘designated forwarding’ Role.
• Other switches, non-root bridges, participating in STP will have 1 port designated as the ‘Root Port Forwarding’. This is
the port which has the least cost to reach the root bridge and is the root port
• Other ports on non-root bridges will either be in the ‘Designated Port Forwarding ‘ role which is a non-root port but
permitted to forward traffic or in the alternate port ‘blocking’ state to prevent a bridging ‘loop’.
END OF TASK2
9
Lab Guide
Deploying basic Spanning Tree
On Switch A change the spanning priority to make Switch A the ‘root’ bridge by changing the ‘bridge priority’. Switch A may
already be the root bridge by having the lowest mac address.
Enter
SwitchA# sh spanning-tree
The root bridge priority will change to 4096 and Switch A will become the ‘root’ bridge and interfaces 1/1/1 and 1/1/2 will both be
in the ‘designated forwarding’ role.
The CX-OS spanning priorities range from 0-15. Each number has a value of ‘4096’ . The default bridge priority id 32768 ,
equaling the value 8, as the default spanning priority (8*4096=32768)
Switch A
SwitchA# sh spanning-tree
MST0
MAC-Address: 08:00:09:fb:91:8b
MAC-Address: 08:00:09:fb:91:8b
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
------------ -------------- ---------- -------------- ---------- ---------------- ---------- ---------- ---------- ----------
Enter the ‘sh spanning-tree’ command on switch B & C and identify which port is in the ‘alternate port blocking’ state
Each switch bridge should recognize a change in the STP root bridge priority, a change in the root bridge mac address and the
STP port role state will change on each switch for each port participating in STP.
10
Lab Guide
Deploying basic Spanning Tree
Switch B
SwitchB# sh spanning-tree
MST0
MAC-Address: 08:00:09:fb:91:8b
MAC-Address: 08:00:09:1a:7c:31
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
------------ -------------- ---------- -------------- ---------- ---------------- ---------- ---------- ---------- ----------
Switch C
SwitchB# sh spanning-tree
MST0
MAC-Address: 08:00:09:fb:91:8b
MAC-Address: 08:00:09:1a:7c:31
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
------------ -------------- ---------- -------------- ---------- ---------------- ---------- ---------- ---------- ----------
11
Lab Guide
Deploying basic Spanning Tree
The spanning tree topology in this example will now look like the example below(exact port forwarding states in other labs ma y
vary from this example):-
END OF TASK3
12
Lab Guide
Deploying basic Spanning Tree
There may be situations where the forwarding root port may not be the preferred interface to forward data and the alternate
blocking or designated forwarding ports maybe the preferable STP ‘root’ forwarding port on a switch. Port costs can be changed
on each interface which can alter the forwarding/blocking STP roles.
• On Switch C, change the ‘root’ port forwarding interface cost from the default cost of 20000 (10Gbps) to 2000000
(10mbps). This will be on the interface directly connect to the root bridge.(interface 1/1/1)
An example below on Switch C with Switch A as root using the default port costs:-:
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
------------ -------------- ---------- -------------- ---------- ---------------- ---------- ---------- ---------- ----------
On Switch C
Change interface 1/1/1 to reflect a port cost of 2000000 (to reflect a low speed 10mbps link)
Review the changed port cost with the ‘sh spanning-tree’ command
Port Role State Cost Priority Type BPDU-Tx BPDU-Rx TCN-Tx TCN-Rx
------------ -------------- ---------- -------------- ---------- ---------------- ---------- ---------- ---------- ----------
The STP port roles are now reversed as interface 1/1/1 is now perceived to be further away from the root bridge with a higher
path cost back to the root even though it is directly connected to the root bridge.
By default, a port cost is defined by the speed at which the port operates and is directly related to the ports associated
bandwidth. A port with the lowest accumulated cost to the root bridge will become the ‘root ‘ forwarding port. If an interface cost
is not configured, the cost is determined by the interface link speed and the number of ‘hops’ to the root bridge.
13
Lab Guide
Deploying basic Spanning Tree
14
Lab Guide
Deploying basic Spanning Tree
Current configuration:
!export-password: default
hostname SwitchA
led locator on
vlan 1
spanning-tree
spanning-tree priority 1
interface mgmt
no shutdown
ip dhcp
interface 1/1/1
no shutdown
no routing
vlan access 1
interface 1/1/2
no shutdown
no routing
vlan access 1
!
https-server vrf mgmt
15
Lab Guide
Deploying basic Spanning Tree
SwitchB
Current configuration:
!export-password: default
hostname SwitchB
vlan 1
spanning-tree
interface mgmt
no shutdown
ip dhcp
interface 1/1/1
no shutdown
no routing
vlan access 1
interface 1/1/2
no shutdown
no routing
vlan access 1
!
https-server vrf mgmt
SwitchC
SwitchC# sh runn
Current configuration:
16
Lab Guide
Deploying basic Spanning Tree
!export-password: default
hostname SwitchC
led locator on
vlan 1
spanning-tree
interface mgmt
no shutdown
ip dhcp
interface 1/1/1
no shutdown
no routing
vlan access 1
interface 1/1/2
no shutdown
no routing
vlan access 1
!
https-server vrf mgmt
17
Document type
Headline text
END OF DOCUMENT
www.arubanetworks.com
3333 Scott Blvd. Santa Clara, CA 95054
1.844.472.2782 | T: 1.408.227.4500 | FAX: 1.408.227.4550 | [email protected]
18