Está en la página 1de 38

Internal

ODA040005 STP Principle


ISSUE 1.3
www.huawei.com

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Spanning Tree Protocol ( STP ) is applied to loop network to block some undesirable redundant paths with certain algorithms and prune the network into a loop-free tree, thereby avoiding the proliferation and infinite cycling of the packet in the loop network

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 1

References
Clause 8 of IEEE Std 802.1D, 1998 Edition Clause 17 of IEEE Std 802.1D, 2004 Edition Ethernet Switch Operation Manual

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 2

Upon completion of this course, you will be able to:


Understand STP Principle Understand RSTP Principle.

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 3

Chapter 1 STP Principle Chapter 2 RSTP Principle

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 4

Applications Of Transparent Bridge

Expand LAN scale Free and dynamic learning of site address information Problem: frames or packets might be forwarded circularly and continuously, resulting in network congestion

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 5

Broadcast In A Network With Loops


Site A
1

LAN 1
1 1 1

B1
3 2

B2
3 2

B3
3 2

LAN 2

Site B

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 6

Why We Need Spanning Tree Protocol?


Remove path loop that might exist in the bridging network by blocking redundant links Activate redundant backup links to restore network connection when the current active path fails
LAN D

LAN A

ROOT

LAN B LAN E

LAN C
HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 7

Basic Principle Of Spanning Tree Protocol


Transmits BPDUs (Bridge Protocol Data Unit )among network bridges and do the following jobs: Select the root. Calculate the shortest path. Select designated bridge. Select a root port. Select designated ports.

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 8

Contents Of BPDU
The content of BPDU is organized as (Root ID, Root Path Cost, Designated Bridge ID, Designated Port ID) Root ID: Identifier of root Root Path Cost: The smallest path cost from the designated bridge to the root Designated Bridge ID : Identifier of the designated bridge Designated Port ID :Identifier of the designated port

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 9

Configuration Message Format


DMA SMA L/T LLC Header Payload

DMA: Destination MAC Address SMA: Source MAC Address L/T: Frame length LLC Header: Fixed link head of configuration message Payload: BPDU Data

Domain
Protocol ID Protocol Version BPDU Type Flag Bit Root Bridge ID Root Path Cost Designated Bridge ID Designated Port ID Message Age Max Age Hello Time Forward Delay

Byte
2 1 1 1 8 4 8 2 2 2 2 2

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 10

Construct BPDU
Select the best BPDU from all the BPDUs to construct its own BPDU. Select RootID: the RootID of the BPDU with the highest priority Calculate Root Path Cost: Root Path Cost is the sum of the Root Path Cost of best BPDU and the cost of the port that receives this BPDU Select Root Port: The root port is the one that receives the best BPDU Select designated port: the ports used to forward the packets Send the new BPDU from a designated port
HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 11

How To Determine The Best BPDU?


The best BPDU has the high priority Assume there are two configuration messages C1 and C2, then: According to Root ID If above is the same, According to the Root Path Cost If above are the same, According to the Designated Bridge ID If above are the same, According to the Port ID

Principle : the smaller, the better


HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 12

An Instance Of Receiving And Calculating BPDU


B81
Port 1 Port 5 Port 3 Port 4

B32

Port 2

B123

B321

B100

B80

LAN A

B102

B23

Root
HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 13

An Instance Of Receiving And Calculating BPDU


B81
Port 1 blocking 32032 231581 2318123 231581 2314321 Port 5 blocking root 2314100 231580

Port 2 Port 3 Port 4

Select Port4 as the root select Port1 and Port2 as designated ports, and meanwhile block Port3 and Port5. Send new BPDU from Port1 and Port2: (23, 15, 81) Root ID = 23 Root Path Cost = 14+1 = 15 Root Port ID = Port4 Designated Bridge ID=81
HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 14

What To Do If Links Fail?


Hello Time The bridge cyclically sends BPDU from a designated port at the period of Hello Time. Message Age and Max Age BPDUs stored at a port have a Message Age field, which grows proportionally with time. If there is not BPDU received until the Message Age equals to the Max Age, the bridge will regard it as failure on the links connected to this port.

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 15

Processing Of Link Fault (I)


B81
Port 1 root 32032 231581 2318123 231581 2314321 231581 231580 Port 5 blocking

Port 2 Port 3 Port 4

When the message of the BPDU of Port4 is timeout, this BPDU is abandoned, and a new spanning tree are calculated, so as to select Port3 as the new root port, while the BPDU of bridge 81 remains unchanged

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 16

Processing Of Link Fault (II)


B81

Port 1 Port 2 Port 3 Port 4

Port 5

root

32032 231681

2318123 231681

231681

231681

231580

When the message of the BPDU of Port3 is timeout, this BPDU is abandoned, and a new spanning tree are calculated, so as to select Port5 as the new root port, while the BPDU of bridge 81 changes to 231681

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 17

Processing Of Link Fault (III)


B81
Port 1 Port 5

Port 2 Port 3 Port 4

81081

81081

81081

81081

81081

When the message of the BPDU of Port5 is timeout, this BPDU is abandoned, and it is taken itself as the root bridge to send the BPDU (81081) till a BPDU of a higher priority is received from any port

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 18

Temporary Loops Or Disconnection


If the ports at the Forwarding status have not realized that they should stop forwarding, temporary loops might exist. If ports blocked have not realized that they should start forwarding, it might lead to temporary disconnection. ROOT

ROOT

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 19

How to avoid temporary loops?


Forward Delay: Maximum delay for configuration message to be broadcasted to the whole network Design interim status: ports at the interim status merely learns address info of sites, but does not forward any data Ports enter the interim status from the blocked status after the Forward Delay, then enter the Forwarding status after the Forward Delay Ports will go through a certain delay to change from the blocking status to the forwarding status. This time should at least be twice the forward delay

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 20

Port Status
Port Status Disabled Port Ability Not receive/send any message Not receive/forward data, receive but not transfer BPDUs, and not learn addresses Not receive/forward data, receive and transfer BPDUs, but not learn addresses Not receive/forward data, receive and transfer BPDUs, and start to learn addresses Receive and forward data, receive and transfer BPDUs, and learn addresses
All rights reserved Page 21

Blocking

Listening Learning

Forwarding

HUAWEI TECHNOLOGIES CO., LTD.

Port Status Transition


Disabled
1 2 12

Listening
3 4 1 5

Blocking
2 4

Learning
5

12

Forwarding
12

1interface enabled

4interface is selected as backup interface ( blocking)

5Forward Delay 2interface disabled 3interface is selected as root port or designated port
HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 22

Two Timers about the MAC Address Table


There are two timers used to update the MAC address info: A bigger timer is used when the topology is stable A smaller timer is used when the topology changes
B4 LAN D B1

LAN E LAN B LAN A B2 LAN C


HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 23

ROOT

B3

Transmission Of Topology Change Message


ROOT

4 3

5 2 1

Topology change notice message Topology change response message Topology change message
HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 24

Disadvantages of STP
Recovery time is too long: two Forward Delay

Network diameter should be less than 7.

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 25

Questions
What is the working mechanism of STP? How to select the best BPDU?

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 26

Chapter 1 STP Principle Chapter 2 RSTP Principle

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 27

Rapid Spanning Tree Protocol


The RSTP evolved from the STP, and shares the same basic concepts; RSTP has all functions of STP; RSTP can bring down the recovery time interval when the network topology structure changes

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 28

STP vs. RSTP (Port Types)


STP types of port Designated Port Root Port Disabled Port RSTP types of port Designated Port Root Port Disabled Port Alternate Port Backup Port

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 29

STP vs. RSTP (Port States)


STP port state Disabled Blocking Listening Learning Forwarding RSTP port state Discarding Discarding Discarding Learning Forwarding

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 30

Improvement Of Rapid Spanning Tree (I)


TO ROOT TO ROOT

LAN A

LAN A

Designated Port

Designated Port

Designated Port

Designated Port

LAN A
Blocked Port

LAN A F
Root Port

LAN A
Root Port F

LAN A
Blocked Port

A new root port can immediately enter the Forwarding status, if the original root port has entered the blocked status, and the designated port of the peer connected to the new root port is in the Forwarding status.
HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 31

Improvement Of Rapid Spanning Tree (II)


The designated port can make a handshake with the connected bridge so as to enter the Forwarding status quickly
LAN A

Designated Port 4

F 1

Handshake request Handshake response

LAN B 3 2 Root Port

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 32

Attention
Handshakes must occur on point to point links.

Designated Port LAN A

LAN A

Designated Port F
LAN B

F Designated Port
LAN C

Non Point to Point Links

Handshake Diffusion

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 33

Improvement Of Rapid Spanning Tree (III)


The edge ports, i.e., those directly connected to terminals but not to other bridges can directly enter the forwarding status, without any delay.
TO ROOT

LAN A

LAN B

LAN C

Designated Port

Blocked Port LAN D F Edge Port

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 34

Questions
Tell the port state of RSTP ? Describe the three improvements of RSTP in simple words ?

HUAWEI TECHNOLOGIES CO., LTD.

All rights reserved

Page 35

Summary

The functions of STP & RSTP Basic principles of STP & RSTP

Slide Modify Archiving Notice(stp).xls


HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 36

Thank You
www.huawei.com

También podría gustarte