Uni fiee ci 2016 01 sesion 10 modelos deterministicos de propagacion
008 stp principle issue1.3bx1
1. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved
www.huawei.com
Internal
ODA040005 STP
Principle
ISSUE 1.3
2. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 1
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
3. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 2
References
Clause 8 of IEEE Std 802.1D, 1998
Edition
Clause 17 of IEEE Std 802.1D, 2004
Edition
Ethernet Switch Operation Manual
4. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 3
Upon completion of this course, you
will be able to:
Understand STP Principle
Understand RSTP Principle.
5. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 4
Chapter 1 STP Principle
Chapter 2 RSTP Principle
6. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 5
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
7. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 6
Broadcast In A Network With Loops
LAN 1
LAN 2
1
1 1 1
2 2 23 33
Site A
Site B
B1 B2 B3
8. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 7
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
ROOT
LAN B
LAN C
LAN D
LAN E
LAN A
9. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 8
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.
10. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 9
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
11. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 10
Configuration Message Format
DMA: Destination MAC Address
SMA: Source MAC Address
L/T: Frame length
LLC Header: Fixed link head of
configuration message
Payload: BPDU Data
DMA LLC HeaderSMA L/T Payload
Domain Byte
Protocol ID 2
Protocol Version
BPDU Type
Flag Bit
Root Bridge ID
Root Path Cost
Designated Bridge ID
Designated Port ID
Message Age
1
1
1
8
4
8
2
2
Max Age
Hello Time
Forward Delay
2
2
2
12. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 11
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
13. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 12
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
14. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 13
An Instance Of Receiving And Calculating BPDU
Port 1
Port 2
Port 3 Port 4
Port 5
B81
LAN A
B23
Root
B80B100B321
B32
B123
B102
15. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 14
An Instance Of Receiving And Calculating BPDU
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
Port 1
Port 2 Port 3 Port 4
Port 5
blocking
blocking
32,,,,0,,,,32 23,,,,18,,,,123 23,,,,14,,,,321 23,,,,14,,,,100 23,,,,15,,,,80
root
23,,,,15,,,,81
B81
23,,,,15,,,,81
16. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 15
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.
17. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 16
Processing Of Link Fault (I)
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
23,,,,18,,,,123
Port 1
Port 2 Port 3 Port 4
Port 5
blocking
23,,,,14,,,,321 23,,,,15,,,,8023,,,,15,,,,81
root
32,,,,0,,,,32
23,,,,15,,,,81 23,,,,15,,,,81
B81
18. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 17
Processing Of Link Fault (II)
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 (23,16,81)
Port 1
Port 2 Port 3 Port 4
Port 5
23,,,,15,,,,8023,,,,16,,,,81
root
23,,,,16,,,,8132,,,,0,,,,32 23,,,,18,,,,123
23,,,,16,,,,81 23,,,,16,,,,81
B81
19. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 18
Processing Of Link Fault (III)
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
(81,0,81) till a BPDU of a higher priority is received from any port
Port 1
Port 2 Port 3 Port 4
Port 5
81,,,,0,,,,81 81,,,,0,,,,81 81,,,,0,,,,8181,,,,0,,,,81 81,,,,0,,,,81
B81
20. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 19
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
21. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 20
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
22. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 21
Port Status
Port Ability
Not receive/send any messageDisabled
Blocking
Listening
Learning
Port Status
Forwarding
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
23. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 22
Port Status Transition
Disabled
Listening
Blocking
Forwarding
Learning
1)interface enabled
2)interface disabled
3)interface is selected as root port or designated port
4)interface is selected as backup interface ( blocking)
5)Forward Delay
((((1)))) ((((2))))
((((1,,,,2))))
((((1,,,,2))))
((((1,,,,2))))
((((1))))
((((2))))
((((4))))
((((4)))) ((((5))))
((((4))))
((((5))))((((3))))
24. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 23
LAN A
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
LAN B
LAN C
LAN E
LAN D
ROOT
B1
B2
B3
B4
26. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 25
Disadvantages of STP
Recovery time is too long: two Forward Delay
Network diameter should be less than 7.
27. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 26
Questions
What is the working mechanism of STP?
How to select the best BPDU?
28. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 27
Chapter 1 STP Principle
Chapter 2 RSTP Principle
29. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 28
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
30. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 29
STP vs. RSTP (Port Types)
STP types of port RSTP types of port
Designated Port Designated Port
Root Port Root Port
Disabled Port Disabled Port
Alternate Port
Backup Port
31. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 30
STP vs. RSTP (Port States)
STP port state RSTP port state
Disabled Discarding
Blocking Discarding
Listening Discarding
Learning Learning
Forwarding Forwarding
32. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 31
Improvement Of Rapid Spanning Tree (I)
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.
LAN A
TO ROOT
LAN A
LAN A LAN A
F F
F
LAN A LAN A
F F
F
TO ROOT
Designated Port
Root PortBlocked Port Root Port Blocked Port
Designated Port Designated Port Designated Port
33. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 32
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 B
LAN A
F
1
23
4
Handshake request
Handshake response
Designated Port
Root Port
34. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 33
Attention
Handshakes must occur on point to point links.
LAN A
LAN B LAN C
LAN A
F
F F
Non Point to Point Links Handshake Diffusion
Designated Port
Designated Port Designated Port
35. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 34
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.
LAN B LAN C
LAN A
Edge Port
LAN DF
TO ROOT
Blocked PortDesignated Port
36. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 35
Questions
Tell the port state of RSTP ?
Describe the three improvements of RSTP in simple words ?
37. HUAWEI TECHNOLOGIES CO., LTD. All rights reserved Page 36
The functions of STP & RSTP
Basic principles of STP & RSTP
Summary
Slide Modify
Archiving Notice(stp).xls