Download as pdf or txt
Download as pdf or txt
You are on page 1of 68

STP RSTP MSTP

Principles and
Configuration

www.huawei.com

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved.


Foreword
 Generally, redundant links are used on an Ethernet switching
network to provide link backup and enhance network reliability.
The use of redundant links, however, may produce loops,
causing broadcast storms and rendering the MAC address table
unstable. As a result, communication quality deteriorates, and
communication services may even be interrupted.

 To solve these problems, the Spanning Tree Protocol (STP) is


used. STP deployed on the Ethernet prevents loops and
provides link redundancy using topology calculation.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 2
Objectives
 Upon completion of this course, you will be able to:
 Describe STP functions.

 Describe STP implementation.

 Describe RSTP improvement compared with STP.

 Describe MSTP calculation.

 Configure MSTP on S series switches.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 3
Contents
1. STP Overview
1.1 STP Functions

1.2 STP Implementation

1.3 RSTP Overview

2. MSTP Overview

3. MSTP Application Environment

4. MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 4
Switch Forwarding Process

1 Destination MAC Destination


PCA
SWA Address Port
00-0D-56-BF-88-10 00-0D-56-BF-88-10 GE0/0/2
GE0/0/2 00-0D-56-BF-88-20 GE0/0/3
GE0/0/3 ..... .....
..... .....
2

GE0/0/5
3 Destination MAC Destination
Address Port
GE0/0/6 00-0D-56-BF-88-10 GE0/0/5
SWB
PCB 00-0D-56-BF-88-20 GE0/0/6
..... .....
00-0D-56-BF-88-20
..... .....

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 5

 A switch forwards packets based on MAC addresses. A MAC address table defines
mapping between destination MAC addresses and destination ports.

 Switch forwarding process:

 PCA sends a frame to PCB. The destination MAC address of the frame is PCB's MAC
address 00-0D-56-BF-88-20. After SWA receives the frame, it searches the MAC
address table for the outbound port. SWA forwards the frame from GE0/0/3.

 After SWB receives the frame, it searches the MAC address table for the outbound
port. SWA forwards the frame from GE0/0/6. The frame remains unchanged.
Loop Issue—Broadcast Storms
Causing Network Breakdown
PCA 1 SWA

00-0D-56-BF-88-10 GE0/0/4 4
GE0/0/2
2
GE0/0/3 GE0/0/7
2
SWC
3
GE0/0/5 GE0/0/8
3
3
GE0/0/6
GE0/0/6
SWB
PCB

00-0D-56-BF-88-20

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 6

 When a switch receives a broadcast data frame from a port, it forwards the frame to all
the other ports except the receive port. If loops occur on the switching network, the frame
is forwarded endlessly, causing broadcast storms.

 As shown in the preceding figure:


 PCA sends a broadcast data frame to SWA.

 After SWA receives this frame, it broadcasts the frame to all the other ports except
GE0/0/2.

 SWB receives the data frame from GE0/0/5 and broadcasts the data frame from
GE0/0/6.

 SWC receives the data frame from GE0/0/7 and broadcasts the data frame from
GE0/0/6.

 SWB receives the data frame from GE0/0/6 and broadcasts the data frame from
GE0/0/5.

 SWC receives the data frame from GE0/0/8 and broadcasts the data frame from
GE0/0/7.

This process repeats. Consequently, network resources are exhausted and the network
breaks down.
Loop Issue—Instable MAC Address
Table Destination MAC Destination
Address Port

00-0D-56-BF-88-10 GE0/0/2
PCA 00-0D-56-BF-88-10 GE0/0/4
1 SWA

00-0D-56-BF-88-10 GE0/0/4 4 Incorrect destination


GE0/0/2 port
2
GE0/0/3 GE0/0/7
2
SWC
3
GE0/0/5
GE0/0/8

GE0/0/6
GE0/0/6
SWB
PCB

00-0D-56-BF-88-20

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 7

 A switch generates a MAC address table based on source addresses of received data
frames and receive ports.
 As shown in the preceding figure:
 PCA sends out a data frame. This example assumes that the destination MAC
address of the data frame does not match any entry in MAC address tables of all the
switches on the network. After receiving the data frame, SWA generates a MAC
address 00-0D-56-BF-88-10, which maps GE0/0/2.

 The destination MAC address of the data frame does not match any entry in the
MAC address table on SWA, so SWA forwards the data frame to GE0/3 and GE0/0/4.

 Assuming SWB receives the data frame from GE0/0/5, the data frame is forwarded
from GE0/0/6 to SWC because the destination MAC address of the data frame does
not match any entry in the MAC address table on SWB.

 After SWC receives the data frame from GE0/0/8, it sends the data frame from
GE0/0/7 because the destination MAC address of the data frame does not match
any entry in the MAC address table on SWC. SWA deletes the original entry in the
MAC address table and generates a new MAC address 00-0D-56-BF-88-10 mapping
GE0/0/4.In this situation, the MAC address table becomes instable and an incorrect
MAC address is generated.
STP Implementation

PCA
SWA

GE0/0/4
GE0/0/2
GE0/0/3 GE0/0/7

SWC
GE0/0/5 GE0/0/8

GE0/0/6
GE0/0/6
SWB
PCB

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 8

 Switches running STP exchange STP BPDUs to discover loops on the network and block
some ports to prune the network into a loop-free tree network. STP prevents infinite
looping of packets to ensure packet processing capabilities of switches. When an active
link is faulty, STP activates a blocking port to ensure non-stop service transmission.
 In the preceding figure, GE0/7 on SWC is blocked to prevent broadcast storms caused by
loops.
 When the link between SWA and SWB is down, the blocking port is activated through STP
calculation. This ensures non-stop service transmission.
Contents
1. STP Overview
1.1 STP Functions

1.2 STP Implementation

1.3 RSTP Overview

2. MSTP Overview

3. MSTP Application Environment

4. MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 9
STP Packet Format

DMAC SMAC Length Data FCS

Configuration
01-80-C2-00-00-00 LLC Header
BPDU

DSAP SSAP
Control
01000010 01000010

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 10

 The parameters used for SPT are encapsulated into configuration BPDUs and exchanged
between switches.
 A configuration BPDU is encapsulated into an Ethernet frame in standard LLC format. Its
destination MAC address is a multicast MAC address 01-80-C2-00-00-00. This
configuration BPDU cannot be forwarded by switches. The value of the Length field is the
MAC data length. The Data field contains the LLC header and configuration BPDU. As
defined in the IEEE standard, the values of DSAP and SSAP are 0x42. The BPDU header
follows the LLC header.
BPDU
 Configuration BPDU is used for SPT calculation and SPT
topology maintenance.

 TCN BPDU is used to notify network topology change.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 11

 Configuration BPDUs are heartbeat packets. STP-enabled ports send BPDUs at intervals specified by
the Hello timer.
 Configuration BPDUs are used in the following scenarios:

 STP-enabled ports send configuration BPDUs at intervals specified the hello timer.

 When a root port receives a configuration BPDU, the device where the root port is located
sends a copy of the configuration BPDU to each designated port.

 When a designated port receives a configuration BPDU with a lower priority than its
configuration BPDU, it immediately sends its own configuration BPDU to the downstream
device.

 A TCN BPDU has only three fields:

 Protocol Identifier,

 Protocol Version Identifier,

 BPDU Type. (The BPDU Type field has a fixed value of 0x80 and is of four bytes.)

 TCN BPDUs are transmitted by each device to its upstream device to notify the upstream device of
network topology change, until they reach the root bridge. A TCN BPDU is generated in one of the
following scenarios:

 The port enters the Forwarding state and at least one designated port is located on the
device.

 A designated port receives a TCN BPDU and sends a copy to the root bridge.
Switch Roles On The STP Network
 Root bridge: the device with the smallest network bridge ID
 An STP network has only one root bridge and the root bridge
changes along with the change of network topology.

 After route convergence, the root bridge generates and sends a


configuration BPDU at intervals. Other devices only forward the
configuration BPDU and notify the topology change to ensure
stable network topology.

 Non-root bridge: Except for the root bridge, switches on the


STP network are non-root-bridge switches.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 12

 STP prunes a network into a loop-free tree network. Every tree network must have a root.
The root bridge is the root of the STP network.
Root Switch Election—Bridge ID
 Bridge ID, BID for short, Defined in IEEE 802.1D, the bridge ID
(BID) consists of the bridge priority and bridge MAC address.
The bridge priority occupies the leftmost 16 bits and the bridge
MAC address occupies the rightmost 48 bits.

 BID format:

Network bridge Network bridge MAC address


priority
2-byte 6-byte

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 13

 The bridge priority can be configured and the value ranges from 0 to 65535. The default
value is 32768.
Switch Port Roles on the STP Network
Port Role Description
Root port Among the multiple paths, the path from the root port to
the root switch is the shortest.
Designated port The designated port forwards data from the local segment
to the root switch, and receives data from the root switch.
Alternate port Except designated ports and root port, all other ports are
called alternate ports. Alternate ports do not forward data
and are blocked.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 14

 STP blocks a port to prune a network into a tree network. Ports on the STP network
contain the root port that sends data to the root bridge, designated port that sends data
to network segments, and alternate ports.
Root Port Election—Path Cost
 Every non-root device should elect a port as root port and this
root port should be unique.

 Root port is on the path from it to the root switch is the


shortest. This is measured by root path cost. That means a port
with the smallest root path cost is root port.
Path cost: 200 Path cost: 200
SWA SWB SWC
GE0/0/1

Root Bridge The path cost of GE0/0/1 on


SWC is 400 (200+200).

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 15

 Each port has a port cost, which indicates the cost of sending data from this port. A higher
bandwidth on a port indicates a smaller cost of the port. In VRP, the cost of a 100M port
is 200. There may be multiple paths from a non-root switch to the root switch. Each path
has a total cost, which is the sum of all port costs on this path. According to STP, there is
no cost of receiving data on a port.

 The smallest total cost from the non-root switch to the root switch is the root path cost.
Designated Port Election—Port ID
 The designated port forwards data from the local segment to the root
switch, and receives data from the root switch. Switch with
designated port is called designated switch in this local segment.

 Sometimes port ID are used in selection of the designated port and


designated switch.

 The port ID consists of the 1-byte port priority and 1-byte port
number.

Port Priority Port Number


1 byte 1 byte

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 16

 The port priority can be set and the default value is 128.
Switch Port Status On The STP
Network
Port Status Function Remarks
Forwarding A port in the Forwarding state can Only the root port or
forward BPDUs and user traffic. designated port can enter the
Forwarding state.
Learning When a port is in the Learning state, a This is a transition state, which
device creates a MAC address table is designed to prevent
based on the received user traffic but temporary loops.
does not forward user traffic.

Listening When a port is in the Listening state, This is a transition state.


the root bridge, root port, and
designated port are to be selected.
Blocking A port in the Blocking state receives This is the final state of a
and forwards only BPDUs, but does not blocked port.
forward user traffic.
Disabled The port in the Disabled state does not The port is Down.
forward BPDUs or user traffic.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 17

 After a port is started, it first enters the Listening state and starts to calculate the spanning
tree.

 If the port needs to be configured as the alternate port after calculation, the port
immediately enters the Blocking state.

 If the port needs to be configured as the root port or designated port after calculation, the
port enters the Learning state from the Listening state after twice the Forward Delay. The
port then enters the Forwarding state from the Learning state after the Forward Delay.
STP State Transitions of a Port

Disabled or Down

1
5
Blocking

2
4 5
Listening

3
4 5
Learning

3
4 5
Forwarding

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 18

 1:The port is initialized or enabled, and enters the Blocking state.

 2:The port is selected as the root or designated port, and enters the Listening state.

 3:When the time for keeping the port in a temporary state is reached, the port enters the
Learning or Forwarding state. The port is selected ad the root or designated port.

 4:The port is not the root or designated port, and enters the blocking state.

 5:The port is disabled or the link fails.


STP Timer
 Hello Time: An STP-enabled device sends configuration BPDUs to
neighboring devices at intervals of the hello time to check whether
links are faulty.

 Forward Delay determines the interval for port status transition。

 Forward Delay Timer specifies the period during which a port


retains in Listening or Learning state. The default value is 15s.

 Max Age specifies the aging time of BPDUs. You can use a command
on the root bridge to change the aging time.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 19
STP Calculation
 Step 1:Root bridge selection. This procedure is based on
Bridge ID.

 Step 2:Root port selection, each non-root-bridge must select


one root port. The path from the root port to the root switch is
the shortest.

 Step 3:Designated Port selection. The designated port


forwards data from the local segment to the root switch, and
receives data from the root switch

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 20
STP Calculation—Root Bridge Election

SWA
Root Bridge
32768.00e0-fc16-ee43

LANA LANB

SWB SWC
32768. 32768.
00e0-fc41-4259 LANC 00e0-fc41-43b9

LAND LANE

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 21

 Devices first compare bridge priorities. A smaller bridge priority indicates a higher priority
of the device. If devices have the same bridge priority, they compare bridge MAC
addresses. A smaller MAC address indicates a higher priority of the device.

 The process is as follows:

 As each bridge considers itself the root bridge, the value of the root BID field in the
BPDU sent by each port is recorded as its BID.

 When a port receives a BPDU with a priority higher than that of itself, the port
extracts information from the BPDU and synchronizes its own information with the
obtained information. The port stops sending the BPDU immediately after saving the
updated BPDU.

 When sending a BPDU, each device fills in the Sender BID field with its own BID.
When a device considers itself the root bridge, the device fills in the Root BID field
with its own BID. This process repeats until all devices consider the same device as
the root bridge. This indicates that the root bridge is selected.

 As shown in the preceding figure, Switches have the same bridge priority and SWA‘s MAC
address is the smallest, so SWA is selected as the root switch.
STP Calculation—Root Port Election

SWA
Root Bridge
32768.00e0-fc16-ee43

Root Port LANA LANB Root Port

SWB SWC
32768. 32768.
00e0-fc41-4259 LANC 00e0-fc41-43b9

LAND LANE

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 22

 Among the multiple paths, the path from the root port to the root switch is the shortest. If
two ports have the same path costs, the port connected to the switch with the smaller
bridge ID is the root port. If two ports have the same path costs and the same bridge IDs,
the port connected to the port with the smaller port identifier is the root port.

 In this example, all ports are 100M ports and the port costs are 200. The two ports closest
to the root bridge are root ports.
STP Calculation—Designated Port
Election
SWA
Root Bridge
32768.00e0-fc16-ee43
LANA designated LANB designated
port port
LANA LANB

SWB SWC
32768. 32768.
00e0-fc41-4259 LANC 00e0-fc41-43b9

LANE
LAND LANC Alternate designated
designated designated port port port
port LAND LANE

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 23

 To select the designated port and designated switch, the port with the smallest path cost
is the root port. If two ports have the same path costs, the port connected to the switch
with the smaller bridge ID is the designated port. If two ports have the same path costs
and the same bridge IDs, the port connected to the port with the smaller port identifier is
the designated port.
STP Calculation—After The Topology
Becomes Stable
SWA
Root Bridge
32768.00e0-fc16-ee43
LANA LANB
designated port designated port
LANA LANB

Root port SWC Root port


SWB
32768. 32768.
00e0-fc41-4259 LANC 00e0-fc41-43b9

LANE
LAND LANC Alternate designated
designated designated port port
port port
LAND LANE

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 24

 After the topology becomes stable, the root bridge still sends configuration BPDUs at
intervals of the Hello timer. Each non-root-bridge forwards the received configuration
BPDUs from its designated port. If the priority of the received BPDU is higher than that on
the non-root-bridge, the non-root-bridge updates its own BPDU based on the information
carried in the received BPDU.
STP Topology Changes—Root Bridge
Faulty (1/2)
SWA
Root Bridge
32768.00e0-fc16-ee43
LANA LANB
designated port designated port
LANA LANB

Root port SWC Root port


SWB
32768. 32768.
00e0-fc41-4259 LANC 00e0-fc41-43b9

LANE
LAND LANC Alternate designated
designated designated port port
port port
LAND LANE

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 25

 The root bridge SWA becomes faulty, SWB and SWC will reselect the root bridge. SWB
and SWC exchange configuration BPDUs to select the root bridge.
STP Topology Changes—Root Bridge
Faulty (2/2)
Original root SWA
bridge
32768.00e0-fc16-ee43
LANA LANB
designated port designated port
New root LANA LANB
bridge
SWB SWC
32768. LANC 32768.
00e0-fc41-4259 00e0-fc41-43b9

LAND LANE
LANC Root port
designated designated
designated
port port
port
LAND LANE

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 26
STP Topology Changes—Designated
Port Faulty (1/2)
SWA
Root bridge
32768.00e0-fc16-ee43
LANA LANB
designated port designated port
LANA LANB

SWB SWC
32768. 32768.
00e0-fc41-4259 LANC 00e0-fc41-43b9

LAND LANC LANE


designated designated Alternate Port designated
port port port
LAND LANE

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 27

 The designated port of the root bridge LANB becomes faulty. The original alternate port
on SWC becomes the root port after SWB and SWC exchange configuration BPDUs.
STP Topology Changes—Designated
Port Faulty (2/2)
SWA
Root bridge
32768.00e0-fc16-ee43
LANA
designated port
LANB designated
LANA LANB port
Root Port
SWB SWC
32768. 32768.
00e0-fc41-4259 LANC 00e0-fc41-43b9

LAND LANC LANE


designated designated Root Port designated
port port port
LAND LANE

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 28
Contents
1. STP Overview
1.1 STP Functions

1.2 STP Implementation

1.3 RSTP Overview

2. MSTP Overview

3. MSTP Application Environment

4. MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 29
Advantages of RSTP Over STP

STP RSTP
Network convergence is slow Using port state changing, RSTP
provides fast convergence

STP is a kind of passive algorithm. There is Feedback mechanism Proposal-


no feedback mechanism to fast recognize Agreement is used
network change
5 Port States :Disabled,Listening, 3 Port States:Forwarding、
Blocking,Learning,Forwarding Learning、Discarding

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 30
Possible Temporary Loop
SWA SWB
Root
GE0/0/1
LANB
Designated port
GE0/0/2

New Alternate port


LANC Continue forwarding
LANA temporarily

Root port

GE0/0/1

GE0/0/2 New designated port


New LAND
Root
SWC SWD
Alternate port
New root port

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 31

 When the port role and status changes, temporary loops may be formed. In this example,
SWA is the root bridge initially. Among all switches, only SWD has an alternate port
GE0/0/2 and the port is in non-Forwarding status.

 Assume that the priority of SWC is changed so that SWC becomes the new root switch. In
this case, GE0/0/2 of SWD will become the new root port and switch to Forwarding state.
GE0/0/1 of SWD will become the new designated port and switch to Forwarding state.
GE0/0/2 of SWB should become the new alternate port and switch to non-forwarding
state.

 If GE0/0/2 of SWD switches from non-Forwarding state to Forwarding state


before GE0/0/2 of SWB switches from Forwarding state to non-Forwarding state,
temporary loop is formed in the network.

 To avoid temporary loops, a port (for example, GE0/0/2 of SWD) must wait
enough time before switching from non-Forwarding state to Forwarding state.
Therefore, the ports that need to switch to non-Forwarding state have enough
time to calculate the spanning tree and switch to non-Forwarding state.
Proposal-Agreement
SWA SWB
Root
D GE0/0/2 R
R
GE0/0/1
D A D

Proposal Agreement

Enter into
forwarding Keep
forwarding
status D
GE0/0/2 GE0/0/2 status
R Agreement R D
Discarding New
GE0/0/1 GE0/0/1
Root
D A
SWC R Proposal D SWD
Keep forwarding Enter into
status forwarding status

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 32

 RSTP adopts the “Proposal-Agreement” negotiation mechanism to speed up the process


that a non-edge root switches from Discarding state to Forwarding state after the port
becomes the root port.

 In this example, assume that the priority sequence of the switches in the network is
SWA>SWB> SWC>SWD. Thus, SWA is the root bridge; GE0/0/1 of SWD is the alternate
port and is in Discarding state. If the priority of SWD is changed and the priority sequence
of the switches changes to SWD>SWA>SWB>SWC, the negotiation process is as follows:

 1. SWD becomes the root bridge ,then GE0/0/1 and GE0/0/2 of SWD becomes the
designated port immediately. GE0/0/2 remains in Forwarding state. GE0/0/1 sends out a
Proposal message, which is an RST BPDU with a flag. This BPDU also contains the
parameters for calculating the spanning tree.

 2. After SWC receives the Proposal, it calculates the spanning tree. GE0/0/1 of SWC
becomes the root port and remains in Forwarding state. GE0/0/2 of SWC becomes the
designated port. If the Proposal is received by the new root port, all non-edge designated
ports switch to the Discarding state and send out new Proposal messages. If all non-root
ports need to switch to Discarding state or become the edge port, the root port that
receives the Proposal message sends the Agreement message. In this example, GE0/0/2 of
SWC switches to Discarding state and sends a new Proposal message.

 3. After SWA receives the Proposal, it calculates the spanning tree. GE0/0/1 of SWA
becomes the designated port and GE0/0/2 becomes the root port. If the port that receives
Please Put the Title Here

the Proposal needs to switch to Discarding state, this port sends the Agreement message
after the status changes.
Contents
1. STP Overview

2. MSTP Overview
2.1 Disadvantages of a Single Spanning Tree

2.2 MSTP Idea

2.3 MSTP Concepts

2.4 MSTI Calculation

3. MSTP Application Environment

4. MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 33
Some Paths on The VLAN Are Blocked

D Allow all VLANs R


Switch1 Switch2

D D
Root VLAN2
VLAN2
Forwarding failure
VLAN3 in VLAN 3
R A
Switch3 Discarding
D D

VLAN2 VLAN3

D: designated port
R: root port LANA LANB
A: alternate port

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 34

As shown in the preceding figure:

 Switch3 connects to network segments and connect to two aggregation switches Switch1
and Switch2 through two uplinks. Traffic in VLAN 2 is sent through two uplinks and traffic
in VLAN 3 is sent through only one link. To prevent loops in VLAN 2, run a spanning tree.
If a single spanning tree is used and the port connecting Switch2 and Switch3 is the
alternate port in the Discarding state, the path of VLAN 3 is disconnected and traffic in
VLAN 3 cannot be sent to Switch2.
Traffic Cannot Be Load Balanced

D R
Switch1 Switch2

D D
Root VLAN2
Path disconnected
VLAN3
R A
Switch3 Discarding
D D

VLAN2 VLAN3

D: designated port
R: root port LANA LANB
A: alternate port

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 35

As shown in the preceding figure:

 Switch3 connects to network segments and connect to Switch1 and Switch2 through two
uplinks. Dual-system hot standby is enabled Switch3.

 To implement dual-system hot standby, two uplinks on Swtich3 are configured as trunks
and allow traffic from all VLANs. The link between Switch1 and Switch2 is also configured
as a trunk and allows traffic from VLANs. The Layer 3 interface of VLAN 2 is configured on
Switch1 and the Layer 3 interface of VLAN 3 is configured on Switch2. Traffic in VLAN 2
and VLAN 3 is required to reach the corresponding Layer 3 interfaces through different
links. If there is only one spanning tree, the port of Switch 1 connected to Switch3
becomes the alternate port in the Discarding state. Traffic in VLAN 2 and VLAN 3 can
reach Switch1 through only one uplink. Traffic cannot be load balanced.
Contents
1. STP Overview

2. MSTP Overview
2.1 Disadvantages of a Single Spanning Tree

2.2 MSTP Idea

2.3 MSTP Concepts

2.4 MSTI Calculation

3. MSTP Application Environment

4. MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 36
MSTP Idea
D R
Switch1 Switch2
R D
D D D D

Root switch in Root switch in


MSTI 1 MSTI 2
A R
R A
MSTI 1: containing VLAN 2 Switch3 MSTI 2: containing VLAN 3

D D

VLAN 2 VLAN 3

D: designated port
LANA LANB
R: root port
A: alternate port

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 37

 To fix the defect of STP and RSTP, the IEEE released 802.1s in 2002, defining the Multiple
Spanning Tree Protocol (MSTP). MSTP implements fast convergence and provides multiple
paths to load balance VLAN traffic.

 MSTP divides a switching network into multiple regions, each of which has multiple
spanning trees that are independent of each other. Each spanning tree is called a multiple
spanning tree instance (MSTI) and each AS is called a multiple spanning tree (MST) region.

 in this example, two MST instances are configured on the network. VLAN 2 is mapped to
MST instance 1 and VLAN 3 is mapped to MST instance 2. To configure switches as the
root switches with different MST instances, change the switches' priorities. In this example,
configure Switch1 as the root switch of MSTI 1 and Switch2 as the root switch of MSTI 2.
After multiple spanning trees are configured, data from VLAN 2 is directly sent to Switch1
and data from VLAN 3 is directly sent to Switch2. Load balancing can be implemented in
this way and the problem of unreachable VLAN path can be solved.
Contents
1. STP Overview

2. MSTP Overview
2.1 Disadvantages of a Single Spanning Tree

2.2 MSTP Idea

2.3 MSTP Concepts

2.4 MSTI Calculation

3. MSTP Application Environment

4. MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 38
MST Region and MSTI (1/2)
 An MST(Multiple Spanning Tree) region consists of several
switching devices on the switching network and the network
segments between the switches.

 Each spanning tree is called an MSTI (MST Instance). The VLANs


in a region are allocated into different groups. Each group has
certain topology. Then multiple MST instances are configured.
MSTP maps one or multiple VLANs to each MSTI.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 39

 Devices in an MST region have the same features:

 MSTP configuration

 MST region name

 Mapping between VLANs and MSTIs

 MSTP revision level


MST Region and MSTI (2/2)

Switch A MSTI 1
Root: Switch B

MSTI 2
Switch D
Root: Switch D

Switch B
MSTI 0: IST
Root: Switch A

Switch C
MSTI 1: Vlan 1
MSTI 2: Vlan 2, Vlan 3
MSTI 0: Other Vlans

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 40
CST
A common spanning tree (CST) is a spanning tree that connects
all the MST regions on a switching network.
SST switch

CST

Supporting
STP/RSTP R D
D
D
D R Root
D D A R

MSTI
regional root R A RegionA

MSTI 1: VLAN 2

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 41

 If each MST region is considered as a node, the CST is calculated by using STP or RSTP
based on all the nodes.
IST
R D

D D

A R

RegionA R D
D R
D D D
D

MSTI CIST Regional Root


Regional Root R A R
A

Instance 1:VLAN2 IST:Instance 0

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 42

 IST: An internal spanning tree (IST) is located in an MST region.

 As shown in the figure, Region A generates MST IST 0. All the switches, ports, and
network segments in an MST region belong to Instance 0 no matter whether Instance 0
contains the VLANs allowed by ports.

 IST calculation is independent from MSTI calculation. That is, two trees are generated in
Region A. One is the IST (MSTI 0) and another is MSTI 1.
CIST
CIST Root
R D

D D
Only support RSTP

A R

RegionA R D
D R
D D D
D

MSTI CIST Regional Root


Regional Root R A R
A

Instance 1:VLAN2 IST:Instance 0

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 43

 The common and internal spanning tree (CIST) consists of the ISTs of all MST regions and
the CST.

 As this example, The ISTs of all MST regions and the CST form a complete spanning tree,
that is, the CIST.
Regional Root and CIST Root
 The CIST root is the root bridge of the CIST.

 Regional roots are classified into IST and the MSTI regional
roots.
 IST regional root is the switch nearest to the root.

 MSTI regional root is the root of each spanning tree. Each MSTI
has its own regional root.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 44
Contents
1. STP Overview

2. MSTP Overview
2.1 Disadvantages of a Single Spanning Tree

2.2 MSTP Idea

2.3 MSTP Concepts

2.4 MSTI Calculation

3. MSTP Application Environment

4. MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 45
MSTI Calculation (1/2)
 The calculation procedure of MST instance is similar to the
calculation procedure of RSTP.

 MSTP calculation procedure:


 Select the MSTI regional root, which is similar to the root switch is
RSTP

 Select the root port for non-root-switches in the MSTI

 Select the designated port for each segment

 Select the alternate port and backup port.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 46
MSTI Calculation (2/2)

Switch1 E1/0/15 E1/0/15


Trunk Switch2

MSTI E1/0/12 E1/0/13 MSTI


Regional Root Trunk Trunk Regional Root

E1/0/12 A A E1/0/13

Instance 1:VLAN2 Switch3 Instance 2:VLAN3


E1/0/2 E1/0/3

VLAN2 VLAN3

LANA LANB

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 47

 In this exmple, links between all switches are configured as trunks and allow traffic from
all VLANs.

 Three switches are configured in an MST region RegionA with revision level 1. MSTI 1 and
MSTI 2 are created in RegionA. MSTI 1 contains VLAN 2 and MSTI 2 contains VLAN 3.

 Switches' priorities in different MSTIs are changed so that Switch1 becomes the root
switch in MSTI 1, E1/0/13 on Switch3 becomes the alternate port in MSTI 1, Switch 2
becomes the root switch in MSTI 2, and E1/0/12 on Switch3 becomes the alternate port in
MSTI 2.

 Traffic in VLAN 2 and VLAN 3 can be load balanced and two uplinks of Switch3 back up
each other.
CIST Calculation (1/2)
 Select the switch with the highest priority as the CIST root
switch.

 Select the root port of the CST.

 Select the designated port for the network segment of the CST.

 Select the switch closest to the CIST root switch as the root
switch in MSTI 0.

 The switches (not CIST regional root switch) select root port,
designated ports, alternate ports, and backup ports.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 48
CIST Calculation (2/2)
CIST Root

8192. R D
4096.
00e0-fc41-4259 00e0-fc16-ee43
D D
Only support RSTP

A R
32768. R D 32768.
000f-e212-f896 000f-e212-f890

D D

RegionA CIST Regional Root


A R
32768.
000f-e212-f8e1 IST:Instance 0

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 49

 In this example, after CIST calculation, Switch2 becomes the root and Switch4 becomes
the CIST regional root.
Contents
1. STP Overview

2. MSTP Overview

3. MSTP Application Environment

4. MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 50
MSTP Applicable Scenario

Network

Switch1 Switch2
All VLAN

VLAN VLAN VLAN VLAN


10&20 10&20 20&30 10&20

VLAN20&40
Switch3 Switch5

MST Region

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 51

 In this example, Switch1 and Switch2 are aggregation devices; Switch3 and Switch4 are
access devices. Traffic from VLAN 10 and VLAN 30 is terminated by aggregation devices,
and traffic from VLAN 40 is terminated by the access device. Therefore, Switch1 and
Switch2 can be configured as the roots of MSTI 1 and MSTI 3, and Switch3 can be
configured as the root of MSTI 4.

 Packets from different VLANs are forwarded based on different MSTIs.


Contents
1. STP Overview

2. MSTP Overview

3. MSTP Application Environment

4. MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 52
Configuring MSTP—Networking
Requirements
Network

SwitchA RG1 SwitchB

GE0/0/2 GE0/0/2
GE0/0/1 GE0/0/1

GE0/0/3 GE0/0/3
GE0/0/2 GE0/0/2
X X
SwitchC SwitchD
GE0/0/1 GE0/0/1

VLAN2~10 MSTI1
VLAN11~20 MSTI2

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 53

 To implement redundancy on a complex network, network designers tend to deploy


multiple physical links between two devices, one of which is the master and the others are
the backup. Loops occur, causing broadcast storms or damaging MAC addresses. After the
network is planned, deploy MSTP on the network to prevent loops. MSTP blocks
redundant links and prunes a network into a tree topology free from loops.

 As shown in the figure, SwitchA, SwitchB, SwitchC, and SwitchD run MSTP. To load
balance traffic from VLANs 2 to 10 and VLANs 11 to 20, use MSTP multi-instance. You can
configure a VLAN mapping table to associate VLANs with MSTIs.

 The configuration roadmap is as follows:

 Configure basic MSTP functions on the switch on the ring network.

 Configure protection functions to protect devices or links. You can configure root
protection on the designated port of the root bridge.

 Configure Layer 2 forwarding.


Configuring MSTP (1/5)
 Configure SwitchA, SwitchB, SwitchC, and SwitchD in the same MST region
named RG1 and create MSTI 1 and MSTI 2.

 Configure an MST region on SwitchA.


[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name RG1
[SwitchA-mst-region] instance 1 vlan 2 to 10
[SwitchA-mst-region] instance 2 vlan 11 to 20
[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region] quit
 Configure an MST region on SwitchB.
[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name RG1
[SwitchB-mst-region] instance 1 vlan 2 to 10
[SwitchB-mst-region] instance 2 vlan 11 to 20
[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region] quit

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 54

 Run stp region-configuration, The MST region view is displayed.

 Run region-name name, The name of an MST region is configured.

 Run the instance instance-id vlan { vlan-id1 [ to vlan-id2 ] }&<1-10> command to


configure VLAN-to-instance mappings.

 Run active region-configuration, MST region configurations are activated so that the
configured region name, VLAN-to-MSTI mappings, and revision number can take effect.
Configuring MSTP (2/5)
 Configure an MST region on SwitchC.

[SwitchC] stp region-configuration


[SwitchC-mst-region] region-name RG1
[SwitchC-mst-region] instance 1 vlan 2 to 10
[SwitchC-mst-region] instance 2 vlan 11 to 20
[SwitchC-mst-region] active region-configuration
[SwitchC-mst-region] quit

 Configure an MST region on SwitchD.


[SwitchD] stp region-configuration
[SwitchD-mst-region] region-name RG1
[SwitchD-mst-region] instance 1 vlan 2 to 10
[SwitchD-mst-region] instance 2 vlan 11 to 20
[SwitchD-mst-region] active region-configuration
[SwitchD-mst-region] quit

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 55
Configuring MSTP (3/5)
 Configure the root bridge and secondary root bridge in MSTI 1.Configure
SwitchA as the root bridge in MSTI 1. Configure SwitchB as the secondary
root bridge in MSTI 1.
[SwitchA] stp instance 1 root primary

[SwitchB] stp instance 1 root secondary

 Configure the root bridge and secondary root bridge in MSTI 2. Configure
SwitchB as the root bridge in MSTI 2. Configure SwitchA as the secondary
root bridge in MSTI 2.
[SwitchB] stp instance 2 root primary

[SwitchA] stp instance 2 root secondary

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 56

 Run stp [ instance instance-id ] root primary The device is configured as the root bridge.
By default, a switch does not function as the root bridge. After the configuration is
complete, the BID of the device is 0 (this value cannot be modified). If instance is not
specified, the device in MSTI 0 is a root bridge.

 Run stp [ instance instance-id ] root secondary The device is configured as the
secondary root bridge.By default, a switch does not function as the secondary root bridge.
After the configuration is complete, the BID of the device is 4096 (this value cannot be
modified). If instance is not specified, the device in MSTI 0 is a secondary root bridge.
Configuring MSTP (4/5)
 Set the path costs of the ports to be blocked in MSTI 1 and MSTI 2 to be
greater than the default value.

 Configure to use Huawei calculation method to calculate the path cost.


[SwitchA] stp pathcost-standard legacy
[SwitchB] stp pathcost-standard legacy

 Configure SwitchC to set the path cost of GE0/0/2 in MSTI 2 to 20000.


[SwitchC] stp pathcost-standard legacy
[SwitchC] interface gigabitethernet 0/0/2
[SwitchC-GigabitEthernet0/0/2] stp instance 2 cost 20000
[SwitchC-GigabitEthernet0/0/2] quit

 Configure SwitchD to set the path cost of GE0/0/2 in MSTI 2 to 20000.


[SwitchD] stp pathcost-standard legacy
[SwitchD] interface gigabitethernet 0/0/2
[SwitchD-GigabitEthernet0/0/2] stp instance 1 cost 20000
[SwitchD-GigabitEthernet0/0/2] quit
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 57

 Run stp [ instance instance-id ] priority priority A priority is set for the switch in an MSTI.
The default priority value of the switch is 32768. If instance-id is not specified, a priority is
set for the switch in MSTI 0.

 Run stp pathcost-standard { dot1d-1998 | dot1t | legacy } A path cost calculation


method is configured. By default, the IEEE 802.1t standard (dot1t) is used to calculate the
path cost. All switches on a network must use the same path cost calculation method.

 Run stp instance instance-id cost cost A path cost is set for the port in the current MSTI.

 When the Huawei calculation method is used, cost ranges from 1 to 200000.

 When the IEEE 802.1d standard method is used, cost ranges from 1 to 65535.

 When the IEEE 802.1t standard method is used, cost ranges from 1 to 200000000.
Configuring MSTP (5/5)
 Enable MSTP globally (Take Switch A for example).
[SwitchA] stp enable

 Configure root protection on the designated port of the root bridge.

[SwitchA] interface gigabitethernet 0/0/1


[SwitchA-GigabitEthernet0/0/1] stp root-protection
[SwitchA-GigabitEthernet0/0/1] quit

[SwitchB] interface gigabitethernet 0/0/1


[SwitchB-GigabitEthernet0/0/1] stp root-protection
[SwitchB-GigabitEthernet0/0/1] quit

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 58

 The stp root-protection command enables root protection at the current port. By default,
root protection is disabled at all ports.

 Owning to incorrect configurations or malicious attacks on the network, a root bridge may
receive BPDUs with a higher priority. Consequently, the root bridge is no longer able to
serve as the root bridge, and the network topology is changed, triggering a spanning tree
recalculation. This spanning tree recalculation may transfer traffic from high-speed links to
low-speed links, causing traffic congestion.

 If a designated port is enabled with the root protection function, the port role cannot be
changed. Once a designated port that is enabled with root protection receives BPDUs with
a higher priority, the port enters the Discarding state and does not forward packets. If the
port does not receive any BPDUs with a higher priority before a period (generally two
Forward Delay periods) expires, the port automatically enters the Forwarding state.

 On a Layer 2 network running a spanning tree protocol, a port connected to terminals


does not need to participate in spanning tree calculation. If the port participates in
spanning tree calculation, the network convergence speed will be affected. In addition,
status changes of the port may cause network flapping, interrupting user traffic. To
address this problem, you can run the stp edged-port enable command to configure the
port as an edge port. Then, the port will not participate in the spanning tree calculation.
This speeds up network convergence and improves network stability.
Configuring MSTP—Verify the
configuration (1/4)
 Run the display stp brief command on SwitchA to view the status and
protection mode on the ports.
[SwitchA] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING ROOT
0 GigabitEthernet0/0/2 DESI FORWARDING NONE
1 GigabitEthernet0/0/1 DESI FORWARDING ROOT
1 GigabitEthernet0/0/2 DESI FORWARDING NONE
2 GigabitEthernet0/0/1 DESI FORWARDING ROOT
2 GigabitEthernet0/0/2 ROOT FORWARDING NONE

 In MSTI 1, GE0/0/1 and GE0/0/2 are designated ports because SwitchA is the
root bridge. In MSTI 2, GE0/0/1 on SwitchA is the designated port and
GE0/0/2 is the root port.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 59
Configuring MSTP—Verify the
configuration (2/4)
 在Run the display stp brief command on SwitchB.

[SwitchB] display stp brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING ROOT
0 GigabitEthernet0/0/2 ROOT FORWARDING NONE
1 GigabitEthernet0/0/1 DESI FORWARDING ROOT
1 GigabitEthernet0/0/2 ROOT FORWARDING NONE
2 GigabitEthernet0/0/1 DESI FORWARDING ROOT
2 GigabitEthernet0/0/2 DESI FORWARDING NONE

 In MSTI 2, GE0/0/1 and GE0/0/2 are designated ports because SwitchB is the
root bridge. In MSTI 1, GE0/0/1 on SwitchB is the designated port and
GE0/0/2 is the root port.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 60
Configuring MSTP—Verify the
configuration (3/4)
 Run the display stp interface brief commands on SwitchC.

[SwitchC] display stp interface gigabitethernet 0/0/3 brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/3 ROOT FORWARDING NONE
1 GigabitEthernet0/0/3 ROOT FORWARDING NONE
2 GigabitEthernet0/0/3 ROOT FORWARDING NONE

[SwitchC] display stp interface gigabitethernet 0/0/2 brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/2 DESI FORWARDING NONE
1 GigabitEthernet0/0/2 DESI FORWARDING NONE
2 GigabitEthernet0/0/2 ALTE DISCARDING NONE

 GE0/0/3 on SwitchC is the root port in MSTI 1 and MSTI 2. GE0/0/2 on


SwitchC is the designated port in MSTI 1 but is blocked in MSTI 2.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 61
Configuring MSTP—Verify the
configuration (4/4)
 Run the display stp interface brief commands on SwitchD.

[SwitchD] display stp interface gigabitethernet 0/0/3 brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/3 ALTE DISCARDING NONE
1 GigabitEthernet0/0/3 ROOT FORWARDING NONE
2 GigabitEthernet0/0/3 ROOT FORWARDING NONE

[SwitchD] display stp interface gigabitethernet 0/0/2 brief


MSTID Port Role STP State Protection
0 GigabitEthernet0/0/2 ROOT FORWARDING NONE
1 GigabitEthernet0/0/2 ALTE DISCARDING NONE
2 GigabitEthernet0/0/2 DESI FORWARDING NONE

 GE0/0/3 on SwitchD is the root port in MSTI 1 and MSTI 2. GE0/0/2 on


SwitchD is the blocked port in MSTI 1 and is the designated port in MSTI 2.

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 62
Summary
 STP Overview
 STP Functions, STP Implementation, RSTP Overview

 MSTP Overview
 Disadvantages of a Single Spanning Tree, MSTP Idea, MSTP
Concepts, MSTI Calculation

 MSTP Application Environment

 MSTP Hands-on Practice

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 63
Quiz
1. (Single Choice) The default bridge priority is ( ).
A. 1
B. 128
C. 32768
D. 65535

2. (Single Choice) The ( ) forwards data from the local segment to the root
switch, and receives data from the root switch.
A. Root port
B. Designated port
C. Alternate port
D. Non-root-port

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 64

 1、C

 2、B
Quiz
TRUE or FALSE

1. One or more VLANs can be mapped to the same spanning tree.


However, each VLAN belong to only one spanning tree. ( )

2. You can add multiple switches to an MST region using MSTP


configuration commands. ( )

3. The IST is a spanning tree that connects all the MST regions on a
switching network. ( )

4. The calculation procedure of MST instance is similar to the calculation


procedure of RSTP. ( )

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 65

 1、F

 2、T

 3、F

 4、T
More Information
 Huawei Learning Website
 http://support.huawei.com/learning/Index!toTrainIndex

 Cases on the Huawei enterprise support website


 http://support.huawei.com/enterprise/servicecenter?lang=zh

Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 66
Thank You
www.huawei.com

You might also like