0% found this document useful (0 votes)
26 views47 pages

14 RSTP Implementation and Configuration

Uploaded by

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

14 RSTP Implementation and Configuration

Uploaded by

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

RSTP Implementation and Configuration

Page 1 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Foreword
• On an Ethernet switching network, redundant links are used to implement link backup and enhance
network reliability. The downside of this is that it may produce loops, leading to broadcast storms and an
unstable MAC address table. As a result, communication on the network may deteriorate or even be
interrupted. To prevent loops, IEEE introduced the Spanning Tree Protocol (STP), which is standardized
as IEEE 802.1d.

• The convergence speed of an STP topology slows as the number of LANs increases. Therefore, IEEE
introduced the Rapid Spanning Tree Protocol (RSTP), standardized as 802.1w, in 2001 to improve the
network convergence speed.

• This document describes the improvements of RSTP compared with STP, working mechanism of RSTP,
and RSTP configurations.

Page 2 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Objectives
• Upon completion of this course, you will be able to:
▫ Describe defects of STP technology.

▫ Describe RSTP improvements compared with STP.

▫ Describe the working mechanism of RSTP.

▫ Perform basic RSTP configurations.

Page 3 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Introduction to RSTP
▪ STP Review and Defects
▫ RSTP Overview

2. Improvements Made in RSTP


3. Working Mechanism of RSTP
4. RSTP Configurations

Page 4 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Review: STP Implementation
STP Configuration BPDUs

• STP transmits configuration BPDUs between switches to elect the


SW1 (root bridge)
root switch (or root bridge) and determine the role and status of
each switch port.

Hello Time: 2s ▫ Each switch actively sends configuration BPDUs during


initialization.

▫ After the network topology becomes stable, only the root


bridge proactively sends configuration BPDUs. Other bridges
SW2 SW3 send configuration BPDUs only after receiving configuration
BPDUs from uplink devices.
Configuration BPDU
• A configuration BPDU contains parameters such as the bridge ID,

Format of configuration BPDUs path cost, and port ID.

BPDU Root Bridge Port Message Max Hello Forward


PID PVI Flag RPC
Type ID ID ID Age Age Time Delay

Page 5 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Review: STP Tree Generation Process
Four Steps of STP Calculation

SW1 (root bridge) • Roles are elected by comparing the following four parameters:

▫ Root bridge ID, root path cost, bridge ID, and port ID
D D
1. Elect the root bridge.

▫ Elect a root bridge on a switching network.

2. Elect the root port.


R R
▫ Elect a root port on each non-root-bridge.
D
SW2 SW3
3. Elect a designated port.

▫ Elect a designated port for each network segment.

4. Block non-designated ports.

Designated Non-designated ▫ Block all the remaining non-root and non-designated ports on
R Root port D
port port switches.

Page 7 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Review: STP Port State Transition

Disabled STP Port State Transition


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

Blocking 5 2. If the port is selected as the root port or designated port, it enters the

2 Listening state.

3. The port enters the Learning state after the Forward Delay timer
4 Listening 5
expires. After another Forward Delay timer, the port enters the
3 Forward Delay: 15s
Forwarding state.
4 Learning 5
4. If a port is no longer the root port or designated port, it enters the
3 Forward Delay: 15s Blocking state.

4 Forwarding 5 5. The port is disabled or the link is terminated.

Page 8 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Disadvantages of STP
• STP ensures a loop-free network but is slow to converge, leading to service quality deterioration. If the network
topology changes frequently, connections on the STP network are frequently torn down, causing frequent service
interruption.

• STP has the following disadvantages:


▫ STP does not differentiate between port roles according to their states, making it difficult for less experienced administrators to
learn about and deploy this protocol.
▪ Ports in Listening, Learning, and Blocking states are the same for users because they are all prevented from forwarding service traffic.

▪ In terms of port use and configuration, the essential differences between ports lie in the port roles but not port states.

▫ The STP algorithm does not determine topology changes until the timer expires, delaying network convergence.

▫ The STP algorithm requires the root bridge to send configuration BPDUs after the network topology becomes stable, and other
devices process and spread the configuration BPDUs through the entire network. This also delays convergence.

Page 10 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
STP Dependency on Timers
Initialization Terminal Access
SW1 (root bridge)
SW1 (root bridge)
D D
D D

R R
R R D
D SW2 SW3
SW2 SW3
New access device
HostA
In the STP environment, after a terminal or server is connected to the network,

STP uses a timer to prevent temporary loops. After STP elects a port role, even if the port needs to switch from the Disabled state to the Blocking, Listening,

the port is a designated port or a root port, it still needs to wait for two intervals Learning, and Forwarding states in sequence. In this case, HostA needs to wait

of the Forward Delay timer (30s) before forwarding packets. for two intervals of the Forward Delay timer before accessing the network

service.

Page 11 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Slow STP Reconvergence
Direct Link Fault Indirect Link Fault

SW1 (root bridge) SW1 (root bridge)

D D
D D

R R R
D
SW2 SW3
SW2

• Because the blocked port does not receive BPDUs with a higher priority, the port
• The blocked port changes from the Blocking state to the Listening and Learning
changes from Blocking to Listening, Learning, and Forwarding in sequence after 20s.
states in sequence, and finally enters the Forwarding state.
• If the indirect link is faulty, the recovery time is about 50s, which is equal to the value
• If the directly connected link is faulty, the port status changes to Forwarding after of the Max Age timer plus twice the value of the Forward Delay timer.

30s.

Page 12 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
STP Topology Change Mechanism
The STP topology change mechanism transmits topology change information to the root bridge, and then the root bridge
floods the topology change information to downlink devices.
Root bridge Root bridge

n
the DU atio
Delete MAC address entries

et
B P i gu r

it s
DU

to C b
nf
BP

Co

T
1
U on
N

3.
Delete MAC address entries
th PD urati
TC

it

th
to A b

wi
Delete MAC
g
1.

nfi

set e TC

address entries
1
Co
B
th
2.
wi

Delete MAC address Delete MAC address Delete MAC address


entries entries entries

New switch New switch TCN BPDU

Send TCN BPDUs and configuration BPDUs with Root bridge sends configuration BPDUs with the Configuration BPDU with the
the TCA bit set to 1 TC bit set to 1 TCA bit set to 1
Configuration BPDU with
the TC bit set to 1

Page 13 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Introduction to RSTP
▫ STP Review and Defects

▪ RSTP Overview

2. Improvements Made in RSTP


3. Working Mechanism of RSTP
4. RSTP Configurations

Page 14 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
RSTP Overview
• RSTP defined in IEEE 802.1w was developed based on STP. RSTP optimizes STP in many aspects,
provides a faster convergence speed, and is compatible with STP.

• RSTP has the following improvements:


▫ Defines additional port roles to simplify the learning and deployment of STP.

▫ Redefines port states.

▫ Changes the configuration BPDU format and uses the Flags field to describe port roles.

▫ Processes configuration BPDUs differently from STP.

▫ Provides fast convergence.

▫ Adds protection functions.

Page 15 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
RSTP Application on a Campus Network

Internet

Layer 3 network

Layer 2 network
RSTP
... ... ...

Page 16 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Introduction to RSTP
2. Improvements Made in RSTP
3. Working Mechanism of RSTP
4. RSTP Configurations

Page 17 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 1: Port Role
RSTP defines additional port roles to simplify the learning and deployment of the protocol.

Alternate port Backup port


R Root port R Root port
SW1 (root bridge) SW1 (root bridge)
D Designated port D Designated port
D D A Alternate port
D D B Backup port

R R R R
SW2 SW3 SW2 SW3
D A D B

The alternate port is blocked after learning a configuration BPDU sent by The backup port is blocked after learning a configuration BPDU sent by itself.

another bridge. It is a backup of the root port and provides an alternate path It is a backup of the designated port and provides a backup path from the root

from the designated bridge to the root switch. switch to the corresponding network segment.

Page 18 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 2: Port States
RSTP defines three states, depending on whether a port forwards user traffic and learns MAC addresses.
▫ Discarding: The port does not forward user traffic or learn MAC addresses.

▫ Learning: The port does not forward user traffic but learns MAC addresses.

▫ Forwarding: The port forwards user traffic and learns MAC addresses.

STP Port State RSTP Port State Port Role


Forwarding Forwarding Root port or designated port
Learning Learning Root port or designated port
Listening Discarding Root port or designated port
Blocking Discarding Alternate port or backup port
Disabled Discarding Disabled port

Page 19 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 3: Configuration BPDU
— RST BPDU
• RSTP configuration BPDUs use the Flag field in STP BPDUs to determine the port role.

• RSTP has the following changes except that the format of RSTP is the same as that of STP:
▫ The value of the Type field is changed from 0 to 2. Devices running STP will discard configuration BPDUs sent from devices running RSTP.

▫ The Flags field uses the six bits reserved in STP. This configuration BPDU is called a Rapid Spanning Tree Bridge Protocol Data Unit (RST
BPDU).

• RST BPDU format:


0x02
BPDU Root Bridge Port Message Max Hello Forward
PID PVI Flag RPC
Type ID ID ID Age Age Time Delay

Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0


TCA Agreement Forwarding Learning Port Role Proposal TC

Topology Change Port Role= 00 Unknown Topology Change Flag


Acknowledgment Flag 01 Alternate/Backup port
10 Root port
11 Designated port
Page 20 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 4: Configuration BPDU Processing
(1)
Configuration BPDU Transmission After the
SW1 (root bridge)
Topology Becomes Stable

RSTP improves the transmission mode of configuration BPDUs.

▫ RSTP allows non-root bridges to send configuration BPDUs at an


Hello Time: 2s Hello Time: 2s
interval of Hello Time after the topology becomes stable, regardless

of whether they have received configuration BPDUs from the root

bridge.
SW2 SW3
In STP, the root bridge sends configuration BPDUs at an interval of
Hello Time: 2s
Hello Time after the topology becomes stable. Non-root bridges send

configuration BPDUs only after they receive configuration BPDUs


RST BPDU from uplink devices. This complicates the STP calculation and slows

down network convergence.

Page 21 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 4: Configuration BPDU Processing
(2)
NK

SW1 (root bridge) Shorter BPDU Timeout Interval


LI

If a port does not receive any configuration BPDU from the


uplink device within the timeout interval (three intervals of
the Hello timer), the device considers that the negotiation
Unidirectional
link fault with the neighbor fails.

STP needs to wait for the time specified by the Max Age
SW2 SW3
timer.
After 6s, the device
considers the neighbor
invalid and sends its own
RST BPDU.

RST BPDU

Page 22 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 4: Configuration BPDU Processing
(3)
Processing an Inferior BPDU
SW1 (root bridge)

• When a port receives an RST BPDU from the uplink


designated bridge, the port compares the cached RST BPDU
Link fault with its own RST BPDU.

• If the number of RST BPDUs cached on the port is superior


to the received RST BPDU, the port discards the received
SW2 SW3 RST BPDU and immediately responds with the cached RST

1. If SW2 does not receive any 2. After receiving an inferior BPDU. This speeds up network convergence.
RST BPDU from the uplink BPDU, SW3 compares it with
device, it considers itself as the the cached RST BPDU and
root bridge and sends its own immediately responds with its In STP, only the designated port can process the inferior
BPDU. own RST BPDU.
BPDU immediately.

RST BPDU

Page 23 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 5: Fast Convergence Mechanism (1)
Fast Switchover of the Root Port Fast Switchover of the Designated Port
R Root port R Root port
SW1 (root bridge) SW1 (root bridge)
D Designated port D Designated port
D D D D
A Alternate port B Backup port

R R R R
SW2 SW3 SW2 SW3
D A D B
R D

If a root port fails, the best alternate port becomes the root port and If a designated port fails, the best backup port becomes the
enters the Forwarding state. This is due to the fact that the network designated port and enters the Forwarding state. A backup port
segment connected to this alternate port has a designated port that backs up a designated port and provides a backup path from the
can access the root bridge. root bridge to the related network segment.

Page 24 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 5: Fast Convergence Mechanism (2)

Edge Port
SW1 (root bridge)

• RSTP introduces the edge port. If a port is located at the


edge of a network and directly connects to a terminal, it can
be configured as an edge port.

• An edge port does not participate in RSTP calculation and


can directly enter the Forwarding state from the Discarding

SW2 SW3 state.


E
• An edge port becomes a common STP port once it is
connected to a switching device and receives a
configuration BPDU. The spanning tree needs to be
E Edge port recalculated, which leads to network flapping.

Page 25 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 5: Fast Convergence Mechanism (3)

P/A Mechanism
Rapidly enter the
SW1 (root bridge)
Forwarding state
D
• The Proposal/Agreement (P/A for short) mechanism enables
Proposal=1
the uplink port to quickly transition to Forwarding state.
Agreement=1
• In RSTP, after a port is elected as the designated port, the

R port enters the Discarding state and then rapidly enters the

SW2 SW3 Forwarding state through the P/A mechanism.

Rapidly enter the


Forwarding state
In STP, the port enters the Forwarding state after at least one
interval of Forward Delay (Learning state).
RST BPDU

Page 26 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
P/A Mechanism (1)

Root bridge Root bridge


SW1 SW1 D

1 Add a link 2 Send RST BPDUs

D
SW2 SW2
A D E A D E

• A link is added between root bridge SW1 and SW2. • The two ports between SW1 and SW2 become

• The three downlink ports of SW2 are the alternate port, designated ports and send RST BPDUs.

designated port in Forwarding state, and edge port,


respectively.

Page 27 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
P/A Mechanism (2)

Root bridge Root bridge


SW1 SW1
D D

Proposal=1 3 SW1 and SW2 compare the Agreement=1


received RST BPDUs.
The downlink port enters the
R R
SW2 SW2 4 synchronization state, and the
root port enters the Forwarding
A D E A D E
state.
(Port status not (Blocked (Port status not
changed) port) changed)

• SW2’s port connected to SW1 receives a superior RST BPDU, so the • After receiving the RST BPDU with the Proposal bit set to 1 from the root
port becomes a root port and stops sending RST BPDUs. bridge, SW2 starts to synchronize all its ports.

• The designated port of SW1 enters the Discarding state and sends an • After all ports are synchronized, all downlink ports (except edge ports)
RST BPDU with the Proposal bit set to 1. enter the Discarding state, and the uplink root port enters the Forwarding
state and returns an RST BPDU with the Agreement bit set to 1 to SW1.

Page 28 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
P/A Mechanism (3)

Root bridge Root bridge


SW1 SW1 D
D
The designated port
5 immediately enters the
Forwarding state.
R R
SW2 SW2
A D E A D E
The downlink device
6 continues the P/A
process.

The RST BPDU with the Agreement bit set to 1 received by SW1 The downlink device continues P/A negotiation.
is a response to the sent RST BPDU with the Proposal bit set to 1
on SW1. Therefore, the designated port immediately enters the
Forwarding state.

Page 29 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 6: Topology Change Mechanism
RSTP considers that the network topology has changed when a non-edge port transitions to the Forwarding
state. Topology Change Mechanism
SW1 (root bridge)
5. Perform steps 2
and 3.
• When detecting a topology change, RSTP devices react as follows:
D D
▫ The local device starts a TC While timer on each non-edge designated port and
1. A link fails.
root port. The TC While timer value is twice the Hello Time value. Within the
TC While time, the local device deletes MAC address entries learned on ports
whose states have changed.

R R ▫ These ports send out RST BPDUs with the TC bit set to 1. When the TC
D A While timer expires, the ports stop sending RST BPDUs.
SW2 SW3
▫ When other switches receive RST BPDUs, they clear MAC address entries
4. Clear the MAC 3. Send RST BPDUs 2. Enable the timer and learned on all their ports except the ports that receive the RST BPDUs. These
addresses learned by with the TC bit set clear the MAC
all ports except the to 1. addresses learned by switches also start a TC While timer on each non-edge designated port and
receive port. the port. repeat the preceding process.

• In this manner, RST BPDUs are flooded on the network.


RST BPDU, TC=1 Delete MAC addresses

Page 30 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 7: Protection Functions (1)
SW1 (root bridge)
BPDU protection

• On an RSTP network, an edge port does not receive RST


Enable BPDU
BPDUs in normal situations. If a switching device receives
protection
malicious RST BPDUs on an edge port, the switching device
automatically sets the edge port to a non-edge port and
SW2 SW3
E performs STP calculation. This causes network flapping.

New device's • BPDU protection enables a switch to set the state of an edge
RST BPDU
port to Error-Down if the edge port receives an RST BPDU. In
this case, the port remains as the edge port, and the switch sends
Device occupied by a a notification to the NMS.
RST BPDU malicious user

Page 31 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 7: Protection Functions (2)

Root protection
SW1 (root bridge)
Enable root
protection • If root protection is enabled on a designated port, the port
D D
role cannot be changed.
Superior
RST BPDU • Once a designated port that is enabled with root protection
receives superior RST BPDUs, the port enters the
Discarding state and does not forward packets. If the port
does not receive any superior RST BPDUs within a
SW2 SW3
Device occupied by a specified period (two intervals of the Forward Delay timer
malicious user
by default), the port automatically enters the Forwarding
state.
RST BPDU • Root protection ensures that the role of the root bridge does
not change due to network problems.

Page 32 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 7: Protection Functions (3)

Loop Prevention

LI
NK
• If the root port or alternate port does not receive BPDUs
SW1 (root bridge) from the uplink device for a long time, the device enabled
D D 1 with loop prevention sends a notification to the NMS. If the
The unidirectional link is
faulty, and packets sent by root port is used, the root port enters the Discarding state
SW1 cannot reach SW3.
and becomes the designated port. If the alternate port is
Loop used, the alternate port keeps blocked and becomes the
3 Enable loop
R R prevention designated port. In this case, loops will not occur.
D A
• After link congestion is cleared or unidirectional link
SW2 SW3 failures are rectified, the port receives BPDUs for
2 The alternate port of SW3 becomes the root port and
enters the Forwarding state. The root port is switched negotiation and restores its original role and status.
to the designated port.
RST BPDU

Page 33 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Improvement 7: Protection Functions (4)

TC BPDU attack defense


SW1 (root bridge)

D D • After enabling TC BPDU attack defense on a switching


device, you can set the number of TC BPDUs that the

Enable TC BPDU device can process within a given period of time.


attack defense
• If the number of TC BPDUs that the switching device
R R
receives within a given time period exceeds the specified
D A
SW2 SW3
threshold, the switching device processes only the specified
Device occupied by a
2. Frequently deleting 1. Send a large number number of TC BPDUs.
MAC address entries
malicious user
of RST BPDUs with
causes a heavy burden the TC bit set to 1. • After the time period expires, the device processes all the
on the device.
excess TC BPDUs in a batch. In this way, the switching
device does not need to frequently delete MAC entries.
RST BPDU, TC=1

Page 34 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Introduction to RSTP
2. Improvements Made in RSTP
3. Working Mechanism of RSTP
4. RSTP Configurations

Page 35 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
RSTP Topology Convergence Process (1)

BID: 32768.0c-00-00-0a-00-01

SW1
1. After RSTP is enabled on a switch, the switch considers itself as
the root bridge and sends RST BPDUs.
D D
▫ All ports are designated ports and are in Discarding state.

D D
D D
SW2 SW3

BID: 32768.0c-00-00-0a-00-02 BID: 32768.0c-00-00-0a-00-03

RST BPDU D Designated port

Page 36 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
RSTP Topology Convergence Process (2)
2. The uplink quickly enters the Forwarding state through the P/A
mechanism.
SW1 (root bridge)
▫ After receiving a superior RST BPDU, SW2 considers that SW1 is the
D D
root bridge and the port on SW2 becomes the root port instead of the
Proposal=1 designated port. Then SW2 stops sending RST BPDUs.

Uplink ▫ The port on SW1 enters the Discarding state and sends RST BPDUs
Agreement=1 with the Proposal bit set to 1. After receiving the BPDU, SW2 blocks all
R R
ports except the edge port. This process is called synchronization.
SW2 SW3
▫ After ports on SW2 synchronize information, the root port enters the

Downlink Forwarding state and sends an RST BPDU with the Agreement bit set to
1 to SW1. After SW1 receives the BPDU, the designated port
immediately enters the Forwarding state.
RST BPDU Designated port Blocked
R Root port D
port

Page 37 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
RSTP Topology Convergence Process (3)

3. The interconnection port of the downlink starts a new round


SW1 (root bridge) of P/A negotiation.

D D ▫ The downlink port of SW2 is configured as the designated port


and continuously sends RST BPDUs with the Proposal bit set to
1.
Uplink
▫ After receiving the BPDU, the downlink port of SW3 finds that
R R the received BPDU is not the optimal one. Therefore, SW3
D A
SW2 SW3 ignores the received BPDU and does not send an RST BPDU
Proposal=1 with the Agreement bit set to 1.
Downlink
▫ The downlink interface of SW2 does not receive any response
packet with the Agreement bit set to 1. SW2 enters the

Designated port Blocked Forwarding state after two intervals of the Forward Delay timer.
RST BPDU R Root port D
port

Page 38 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. Introduction to RSTP
2. Improvements Made in RSTP
3. Working Mechanism of RSTP
4. RSTP Configurations

Page 39 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic RSTP Configuration Commands (1)
1. Configure a working mode.

[Huawei] stp mode { stp | rstp | mstp }

The switch supports three working modes: STP, RSTP, and Multiple Spanning Tree Protocol (MSTP). By default, a switch
works in MSTP mode.
2. (Optional) Configure the switch as the root bridge.

[Huawei] stp root primary

By default, a switch does not function as the root bridge of any spanning tree. After you run this command, the priority value of
the switch is set to 0 and cannot be changed.

3. (Optional) Configure the switch as the secondary root bridge.

[Huawei] stp root Secondary

By default, a switch does not function as the secondary root bridge of any spanning tree. After you run this command, the
priority value of the switch is set to 4096 and cannot be changed.

Page 40 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic RSTP Configuration Commands (2)
1. (Optional) Configure the STP priority of a switch.

[Huawei] stp priority priority

The value ranges from 0 to 61440, with an increment of 4096. By default, the priority value of a switch is 32768.

2. (Optional) Configure a path cost for a port.

[Huawei] stp pathcost-standard { dot1d-1998 | dot1t | legacy }

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

[Huawei-GigabitEthernet0/0/1] stp cost cost

Set the path cost of the port.

Page 41 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic RSTP Configuration Commands (3)
1. (Optional) Configure the interface priority.

[Huawei-GigabitEthernet0/0/1] stp priority priority

The value is an integer that ranges from 0 to 240, with an increment of 16. By default, the priority of a switch port is 128.

2. Enable STP or RSTP.

[Huawei] stp enable

By default, STP or RSTP is enabled on a switch.

3. Configure the port as an STP edge port.

[Huawei-GigabitEthernet0/0/1] stp edged-port enable

By default, all the ports on a switch are non-edge ports.

Page 42 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
RSTP Protection Configuration Commands (1)
1. Enable BPDU protection on an edge port of a switch.

[Huawei] stp bpdu-protection

By default, BPDU protection is disabled on a switch.

2. Configure root protection.

[Huawei-GigabitEthernet0/0/1] stp root-protection

By default, root protection is disabled on a port. Root protection takes effect only on designated ports. Root protection and loop
prevention cannot be configured on the same port.

3. Configure loop prevention on the root port or alternate port.

[Huawei-GigabitEthernet0/0/1] stp loop-protection

By default, loop prevention is disabled on a port.

Page 43 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
RSTP Protection Configuration Commands (2)
1. Configure TC BPDU attack defense.

[Huawei] stp tc-protection interval interval-value

Configure the time for a device to process the maximum number of TC BPDUs. By default, the device processes the maximum
number of TC BPDUs at an interval of the Hello timer.
[Huawei] stp tc-protection threshold threshold

Set the number of times that a switch processes received TC BPDUs and updates forwarding entries within a given period of
time. By default, the device processes only one TC BPDU within a specified period of time.

Page 44 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Case: Basic RSTP Configuration (1)
SW1 (root bridge)
Enable RSTP on SW1.

GE
1
0/

0/
[SW1] stp mode rstp
0/

0/
GE

2
[SW1] stp enable

GE
[SW1] stp root primary
1
0/

0/
0/

0/
GE

2
SW2 SW3 Enable RSTP on SW2.
GE0/0/2 GE0/0/1 E
E0/0/1
[SW2] stp mode rstp
[SW2] stp enable
P
[SW2] stp root secondary
• RSTP is configured on the three switches to eliminate Layer C
2 loops.

• The configuration roadmap is as follows: Enable RSTP on SW3.


▫ Configure SW1 as the root bridge and SW2 as the secondary root bridge.
[SW3] stp mode rstp
▫ Configure the port connected to the PC as the edge port because this port does not
[SW3] stp enable
participate in RSTP calculation.

▫ Configure root protection and BPDU protection to protect devices or links.

Page 45 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Case: Basic RSTP Configuration (2)
SW1 (root bridge)
Enable the edge port on SW3.

GE
1
0/

0/
[SW3-Ethernet0/0/1] stp edged-port enable
0/

0/
GE

2
GE
1
0/

0/
0/

0/
Enable root protection on SW1.
GE

2
SW2 GE0/0/2 GE0/0/1 SW3 [SW1-GigabitEthernet0/0/1] stp root-protection
E
E0/0/1 [SW1-GigabitEthernet0/0/2] stp root-protection

P
• RSTP is configured on the three switches to eliminate Layer C
2 loops.
Enable BPDU protection on SW3.
• The configuration roadmap is as follows:
[SW3] stp bpdu-protection
▫ Configure SW1 as the root bridge and SW2 as the secondary root bridge.

▫ Configure the port connected to the PC as the edge port because this port does not
participate in RSTP calculation.

▫ Configure root protection and BPDU protection to protect devices or links.

Page 46 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Quiz
1. (Multiple) Which of the following are RSTP port states? ( )
A. Idle

B. Discarding

C. Forwarding

D. Learning

2. (TorF) RSTP root protection must be configured on the root port of the device. ( )

Page 47 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Summary
• STP prevents loops on a LAN. Devices running STP exchange information with one another to
discover loops on the network, and block certain ports to eliminate loops. With the growth in
scale of LANs, STP has become an important protocol for a LAN.
• Based on STP, RSTP has many improvements and greatly speeds up network convergence.

• This document describes seven improvements of RSTP compared with STP, including the port
role, port status, BPDU format, BPDU processing mode, fast convergence mechanism, topology
change mechanism, and four protection features.

Page 48 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
谢谢
Thank You
www.huawei.com

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy