1 of 32

Spanning Tree Protocol

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

Page 0

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

2 of 32

  • As the enterprise network expands, multi-switched networks are introduced to provide link layer communication between a growing number of end systems. As new interconnections are formed between multiple enterprise switches, new opportunities for building ever resilient networks are made possible, however the potential for switching failure as a result of loops becomes ever more likely. It is necessary that the spanning tree protocol (STP) therefore be understood in terms of behavior in preventing switching loops, and how it can be manipulated to suit enterprise network design and performance.

Foreword

Page 1

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

3 of 32

  • Upon completion of this section, you will be able to:
    • Describe the issues faced when using a multi-switched network.
    • Explain the loop prevention process of the spanning tree protocol.
    • Configure parameters for managing the STP network design.

Objectives

Page 2

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

4 of 32

  • Redundancy in a switching network minimizes connection failure but generates potential switching loops.

Layer 2 Redundancy

Switch A

Switch B

Switch D

Switch C

Switch E

Page 3

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

5 of 32

  • Switching loops allow for broadcast storms to occur and duplication of frames to be received by end stations.

Broadcast Storms

00-01-02-03-04-AA

00-01-02-03-04-BB

Switch A

Switch B

Switch C

Host A

Host B

G0/0/3

G0/0/2

Page 4

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

6 of 32

  • Receiving previously forwarded frames generates false MAC entries, and instability within the MAC address table.

MAC Instability

MAC

Interface

00-01-02-03-04-AA

G0/0/3

00-01-02-03-04-AA

G0/0/2

00-01-02-03-04-AA

00-01-02-03-04-BB

Switch A

Switch B

Switch C

Host A

Host B

G0/0/2

G0/0/3

Page 5

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

7 of 32

  • Loops are eliminated by restricting traffic flow over redundant paths.

Resolving Layer 2 Redundancy Issues

00-01-02-03-04-AA

00-01-02-03-04-BB

Switch A

Switch B

Switch C

Host A

Host B

G0/0/2

G0/0/3

Page 6

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

8 of 32

  • An inverted tree architecture is created as a result of STP.
  • The root bridge represents the base of the spanning tree.

The Spanning Tree Root Bridge

Root

Non-Root

Non-Root

Non-Root

Non-Root

Non-Root

Page 7

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

9 of 32

  • Bridge Identifiers are used to elect the root bridge.
  • The bridge priority can be manipulated to force root selection.

Bridge ID

Page 8

Root

Root

4096 00-01-02-03-04-AA

32768 00-01-02-03-04-BB

32768 00-01-02-03-04-CC

32768 00-01-02-03-04-DD

32768 00-01-02-03-04-EE

32768 00-01-02-03-04-FF

Page 8

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

10 of 32

Bridge Protocol Data Unit

PID

PVI

BPDU Type

Flags

Root ID

RPC

Bridge ID

Port ID

Message

Age

Max Age

Hello Time

FwdDelay

Configuration

TCN

BPDU

BPDU

Root

Page 9

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

11 of 32

  • Root path cost is carried in the BPDU and used to determine the shortest path to the root.

Path Cost

20000

20000

20000

20000

20000

20000

20000

Root

20000

RPC 20000

RPC 20000

RPC 0

RPC 0

RPC 20000

RPC 20000

20000

Page 10

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

12 of 32

  • STP supports various path cost standards.
  • The 802.1t is the default standard used by Huawei switches.

Path Cost Standards

Port Speed

802.1D

802.1t

Path Cost Legacy

10 Mbps

99

1999999

1999

100 Mbps

18

199999

199

1 Gbps

4

20000

20

10 Gbps

2

2000

2

Page 11

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

13 of 32

  • Spanning tree supports designated, root and alternate port roles.
  • The root path cost enables port roles to be determined.

Spanning Tree Port Roles

Page 12

D

D

D

D

D

D

R

R

A

Root

Root

R

R

R

RPC 20000

RPC 20000

RPC 0

RPC 0

RPC 20000

RPC 20000

Page 12

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

14 of 32

  • Where the root path cost is equal, a port identifier is used to determine the active and alternate paths to the root.

Port ID

Root

RPC 0

RPC 0

4096 00-01-02-03-04-AA

32768 00-01-02-03-04-BB

32768 00-01-02-03-04-CC

D

D

D

A

D

R

128.1

128.2

128.3

128.2

128.1

A

R

Page 13

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

15 of 32

  • The MAX Age represents the aging timer of a BPDU.
  • BPDU are discarded when Message Age exceeds MAX Age.

Timers

BPDU Interval

(2 seconds)

MSG Age: 0

MAX Age: 20

MSG Age: 1

MAX Age: 20

MSG Age: 2

MAX Age: 20

MSG Age: 2

MAX Age: 20

MSG Age: 1

MAX Age: 20

Page 14

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

16 of 32

  • All STP switches advertise BDPU to peers with self as root.

Root Election Process

Switch A

32768 00-e0-fc-41-42-59

32768 00-e0-fc-41-43-69

32768 00-e0-fc-16-ee-43

BPDU

BPDU

BPDU

BPDU

BPDU

BPDU

Switch C

Switch B

Page 15

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

17 of 32

  • The Bridge ID and Root Path Cost are used to elect port roles.

Port Role Establishment Process

Root

G0/0/1

G0/0/2

G0/0/1

G0/0/2

G0/0/2

G0/0/1

A

D

Root Port

Root Port

D

D

Switch A

Switch C

Switch B

RPC 20000

RPC 20000

RPC 0

RPC 0

32768 00-e0-fc-41-42-59

32768 00-e0-fc-41-43-69

32768 00-e0-fc-16-ee-43

Page 16

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

18 of 32

Port State Transition

Disabled

Forwarding

Listening

Learning

Blocking

Page 17

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

19 of 32

  • Non root bridges wait for MAX Age before assuming loss of root.
  • Re-convergence is then initiated, beginning with root election.

Root Failure

Root

MAX Age

MAX Age

Switch A

Switch B

BPDU

Switch C

BPDU

SWD

SWE

Page 18

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

20 of 32

  • Switch B begins root election, but BPDU is ignored by Switch C.
  • Root BDPU is propagated to switch B after MAX Age expires.

Indirect Link Failure

Switch A

A

Switch C

Root

BPDU

BPDU

Switch B

Page 19

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

21 of 32

  • Switch B detects failure and switches alternate port to root port.
  • STP converges after 2x forward delay (30 seconds by default).

Direct Link Failure

Switch A

Switch B

Root

RPC 0

RPC 0

4096 00-01-02-03-04-AA

32768 00-01-02-03-04-BB

32768 00-01-02-03-04-CC

A

D

D

D

R

A

D

R

128.1

128.2

Switch C

Page 20

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

22 of 32

  • Changes in the STP topology may invalidate MAC table entries.
  • MAC table entries expire only after 300 seconds by default.

Topology Change MAC Instability

MAC

Interface

00-01-02-03-04-AA

G0/0/3

00-01-02-03-04-BB

G0/0/2

A

00-01-02-03-04-AA

00-01-02-03-04-BB

Switch A

Switch B

Switch C

Host A

Host B

R

G0/0/2

G0/0/3

Page 21

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

23 of 32

  • Topology Change Notification informs root of topology change.
  • Root flushes MAC entries using BPDU with TC bit set.

Topology Change Process

Root

Root

TCN BPDU

TCN BPDU

TCN BPDU

BPDU

BPDU

BPDU

BPDU

BPDU

BPDU

Page 22

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

24 of 32

Topology Change MAC Refresh

Page 23

MAC

Interface

00-01-02-03-04-AA

G0/0/3

00-01-02-03-04-BB

G0/0/2

00-01-02-03-04-BB

G0/0/1

00-01-02-03-04-AA

00-01-02-03-04-BB

Root

Switch B

Switch C

Host A

Host B

G0/0/3

G0/0/2

D

G0/0/1

Switch A

G0/0/1

R

Page 23

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

25 of 32

STP Modes

[SWA]stp mode ?

mstp Multiple Spanning Tree Protocol (MSTP) mode

rstp Rapid Spanning Tree Protocol (RSTP) mode

stp Spanning Tree Protocol (STP) mode

[SWA]stp mode stp

Switch B

Switch C

Switch A

Page 24

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

26 of 32

  • Root can be set manually or by defining the switch as primary.

Assigning The Root

[SWA]stp priority 4096

Apr 15 2016 16:15:33-08:00 SWA DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 4, the change loop count is 0, and the maximum number of records is 4095.

4096 00-01-02-03-04-AA

Switch B

Switch C

Switch A

32768 00-01-02-03-04-BB

32768 00-01-02-03-04-CC

Page 25

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

27 of 32

Assigning Path Cost

[SWC]stp pathcost-standard ?

dot1d-1998 IEEE 802.1D-1998

dot1t IEEE 802.1T

legacy Legacy

[SWC]interface GigabitEthernet 0/0/1

[SWC-GigabitEthernet0/0/1]stp cost 2000

4096 00-01-02-03-04-AA

Switch B

Switch C

Switch A

32768 00-01-02-03-04-BB

32768 00-01-02-03-04-CC

G0/0/1

Page 26

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

28 of 32

  • Root protection prevents changes to the topology as a result of root bridge transition, caused by receiving higher priority BPDU.

Root Protection

4096 00-01-02-03-04-AA

Switch B

Switch C

Switch A

32768 00-01-02-03-04-BB

32768 00-01-02-03-04-CC

[SWA]interface GigabitEthernet 0/0/1

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

G0/0/1

Page 27

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

29 of 32

Configuration Validation

[SWA]display stp

-------[CIST Global Info][Mode STP]-------

CIST Bridge :4096 .00-01-02-03-04-BB

Bridge Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC :4096 .00-01-02-03-04-BB / 0

CIST RegRoot/IRPC :4096 .00-01-02-03-04-BB / 0

CIST RootPortId :0.0

BPDU-Protection :Disabled

TC or TCN received :37

TC count per hello :0

STP Converge Mode :Normal

Share region-configuration :Enabled

Time since last TC :0 days 0h:1m:29s

……

Page 28

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

30 of 32

Configuration Validation

[SWA]display stp

……

----[Port1(GigabitEthernet0/0/1)][FORWARDING]----

Port Protocol :Enabled

Port Role :Designated Port

Port Priority :128

Port Cost(Dot1T ) :Config=2000 / Active=2000

Designated Bridge/Port :4096.00-01-02-03-04-BB / 128.1

Port Edged :Config=default / Active=disabled

Point-to-point :Config=auto / Active=true

Transit Limit :147 packets/hello-time

Protection Type :Root

……

Page 29

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

31 of 32

    • In the event that a root bridge (switch) temporarily fails in the STP network, the next viable switch will take over as the root bridge. What will occur once the failed root bridge once again becomes active in the network?
    • What is the difference between Path Cost and Root Path Cost?

Summary

Page 30

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

32 of 32

www.huawei.com

Thank You

Page 31

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