sat07 stp
TRANSCRIPT
-
7/27/2019 SAT07 stp
1/40
HUAWEI
Training objective
Understand the background of the creation ofthe STP protocol
Understand STP working principle
Understand RSTP workingprinciple
Use Huawei STP protocol commandsskillfully
-
7/27/2019 SAT07 stp
2/40
HUAWEI
Training content
Applications of transparent network bridges;
Why introduce spanning tree protocols?
Spanning tree protocol working principle;
Performance of spanning tree protocol;
Why introduce fast spanning tree protocolFast spanning tree protocol working principle;
What are the differences between spanning trees and fast spanning trees?Configuration and common commands of spanning trees;
-
7/27/2019 SAT07 stp
3/40
HUAWEI
Expand LAN abilityAddress information of free dynamic studying web site
Question:Ordinary transparent network bridges will not make any sign for forwarded messages. As aresult, if there is a loop in the network, messages might be forwarded circularly and continuously, leading
to network congestion
Applications of Transparent Network Bridges
A DCB
-
7/27/2019 SAT07 stp
4/40
HUAWEI
Occurrence of Path Loops
A'
LAN 1
LAN 2
A
B1 B2 B3
-
7/27/2019 SAT07 stp
5/40
HUAWEI
Why introduce spanning tree protocol?
Remove path loops that might exist in the bridging network by disconnecting redundant links
Activate redundant backup links to restore network connection when the current active path fails
LAN A
LAN D
LAN C
LAN B
ROOTLAN E
-
7/27/2019 SAT07 stp
6/40
HUAWEI
Basic principle of spanning tree protocol
Basic idea: transmit special information among network bridges (configurationinformation) and contain the following information to do the following:
Select one from all network bridges in the network to be used as the root bridge;
Calculate the shortest path fromthe local bridge to the root bridge;
For eachLan first select a bridge nearest to that network bridge as a designated bridge,to handle the data forward on its Lan;
For the network bridge, select a root port, and the path given from this port will be theoptimal path from this bridge to the root bridge;
Select ports (designated ports) contained on the spanning tree except the root port.
-
7/27/2019 SAT07 stp
7/40
HUAWEI
Configuration message is also called bridge protocol data unit(BPDU)Main content includes:
Identifier of root bridge (Root ID)
The smallest path cost from a designated network bridge to a root bridge(RootPathCost)
Identifierof a designated network bridge
Identifierof a designated port of a designated network bridge
I.e., (RootID, RootPathCost,DesignatedBridgeID, DesignatedPortID)
Contents of short messages
-
7/27/2019 SAT07 stp
8/40
HUAWEI
on gura on messageformat
DMA SMA L/T LLC Header payload
0x0180c2000000 0x01000010 BPDU data
Domain Seizure byte
Protocol ID 2
Protocol version 1
BPDU type 1
Flag bit 1
Root bridge ID 8
Root path cost 4
Designatedbridge ID
8
Designatedport ID
2
Message Age 2
MaxAge 2
HelloTime 2
ForwardDelay 2
Destination MACaddress
The destinationaddress of aconfigurationmessage is afixed groupbroadcasting
address
Source MACaddress
The
source MACaddress is theMAC address ofthe bridge
sending this
configurationmessage
Fixed link headof configuration
message
Framelength
-
7/27/2019 SAT07 stp
9/40
HUAWEI
Compare the configuration messages received from every port with its own configuration
message to obtain the configuration message of the highest priority so as to replace its ownconfiguration message. This mainly includes:
Select RootID of the root bridge : the RootID of the configuration message with thehighest priorityCalculate the overhead of the shortest path to the root bridge RootPathCost: if it is the
root bridge itself, then the shortest path overhead is 0; otherwise, that overhead is the sumbetween the RootPathCost of optimal configuration message it receives and the
overhead of the port that receives this configuration message
Select Root Port: if it is the root bridge itself, then the root port is 0; otherwise, the rootport is the one that receives the optimal configuration message
Select designated port: including other ports in the Forwarding status on the spanning tree
Send new configuration message from a designated port
rocess ng con gura onmessages
-
7/27/2019 SAT07 stp
10/40
HUAWEI
Assume there are two configuration messagesC1 and C2, then:
If RootID of C1 is less than RootID of C2, then C1 is prior to C2
If RootID of C1 and C2 is the same, but if the RootPathCost of C1 is less than C2, then C1 isprior to C2
If RootID and RootPathCost of C1 and C2 are the same, but if the TransmitID of C1 is lessthan C2, then C1 is prior to C2
If RootID, RootPathCost, and TransimitId of C1 and C2 are the same, but if the PortID of C1
is less than C2, then C1 is prior to C2
optimal configuration
message?Configuration message prioritycomparison rules:
-
7/27/2019 SAT07 stp
11/40
HUAWEI
B92
Port1
Port4Port3
Port2
Port5
81,0,81 41,19,12541,12,315
41,12,111
41,13,90
Blocking
Blocking
Select Port4 as the root port according to the priority of the configuration messagereceived, select Port1 and Port2 as designated ports, and meanwhile block Port3 andPort5.
Send new configuration messages from Port1 and Port2: (41, 13, 92), among of them:
RootId = 41RootPathCost = 12+1 = 13
RootPort = Port4
An instance of receiving and processingconfiguration messages
-
7/27/2019 SAT07 stp
12/40
HUAWEI
What to do if links fail?
Hello TimeThe network bridge cyclically sends configuration messages from a designated port at the
period ofHello Time
Message Age and Max AgeConfiguration messages stored at a port have aMessage Agefield, which growsproportionally with time. Each time one configuration message with a shorter message age isreceived, its own configuration message is updated. Whenthe message age reaches the
Max Ageand when no configuration message whatever is received in a period oftime, the network bridge will regard it as failure on the links connected to this port, and will startfailure processing
-
7/27/2019 SAT07 stp
13/40
HUAWEI
Processing I of link fault
When the message age of the configurationmessage of Port4 is timeout, thisconfiguration message is abandoned, and a
new spanning tree are calculated, so as toselect Port3 as the new root port, while theconfiguration message of network bridge 92remains unchanged
B92
Port1
Port4Port3
Port2
Port5
41,13,9241,12,315
41,12,11141,13,90
41,13,92
41,13,92
Blocking
-
7/27/2019 SAT07 stp
14/40
HUAWEI
B92
Port1
Port4Port3
Port2
Port5
41,12,31541,12,111
41,13,90
41,14,92
41,14,9241,14,92
41,14,92
Processing II of link fault
When the message age of the configurationmessage of Port3 is timeout, thisconfiguration message is abandoned, and a
new spanning tree are calculated, so as toselect Port5 as the new root port, while theconfiguration message of network bridge 92changes to 41 14 92
-
7/27/2019 SAT07 stp
15/40
HUAWEI
Processing III of link fault
When the message age of the configurationmessage of Port5 is timeout, thisconfiguration message is abandoned, and it
is taken itself as the root bridge to send theconfiguration message (92 0 92) till aconfiguration message of a higher priority isreceived from any port
B92
Port1
Port4Port3
Port2
Port5
41,12,31541,12,111
41,13,90
92,0,92
92,0,9292,0,92
92,0,92 92,0,92
-
7/27/2019 SAT07 stp
16/40
HUAWEI
Problems of temporary loops
When the topology structure changes, newconfiguration messages are broadcast to thewhole network only after a certain delay.
Before all bridges get the message of thischange,
if ports at the Forwarding status in the originaltopology structure have not realized that they
should stop forward- ing in the new topology,temporary loops might exist;
if ports blocked in the original topologystructure have not realized that they should
ow o avo emporary
-
7/27/2019 SAT07 stp
17/40
HUAWEI
ow o avo emporaryloops?
Ports will go through a certain delay to change from
the blocked status to the Forwarding status. Thistime should at least be twice the maximum time forconfiguration messages to be broadcast to thewhole network
Forward Delay Maximum delay for configurationmessage to be broadcast to the whole network
Design interim status: ports at the interim statusmerely learns address info of sites, but does notforward any data
Ports enter the interim status from the blocked staafter the Forward Delay;
Then enter the Forwarding status after the ForwarDelay
-
7/27/2019 SAT07 stp
18/40
HUAWEI
Port status Port ability
Disabled Not receive/send any message
Blocking Not receive/forward data, receive but nottransfer BPDUs, and not learn addresses
Listening Not receive/forward data, receive andtransfer BPDUs, but not learn addresses
Learning Not receive/forward data, receive andtransfer BPDUs, and start to learn addresses
Forwarding Receive and forward data, receive andtransfer BPDUs, and learn addresses
Statuses of ports
-
7/27/2019 SAT07 stp
19/40
HUAWEI
Port status shift
Disabled
Forwarding
Learning
Listening
Blocking
(1,2)
(2)(1)
(3) (5)
(5)
(4)
(4)
(4)
(2)
(1)
(1,2)
(1,2)
1) port enabled
2) port disabled
3) port is selected as root port ordesignated port
4) port is selected as backup port( blocked)
5) Forward Delay
ge o a ress
-
7/27/2019 SAT07 stp
20/40
HUAWEI
ge o a ressinformation
Topology structure change can enable shifts of the
relative position of sites in the spanning tree, so ththe MAC address info the network bridge originallylearnt might be incorrect. So, the learnt MACaddress info should also have an age, and if theaddress is not proven to be correct within this age,the address info is then discarded.
There are two ages in the spanning tree protocol:
A longer survival age is used when the topology istable
A shorter age is used when the topology changesWhen the topology changes, not all network bridgewill discover this change. So the topology changeinfo should be broadcast to the whole network
e re a ve pos on o s es
-
7/27/2019 SAT07 stp
21/40
HUAWEI
e re a ve pos on o s eschange
LAN A
LAN D
LAN C
LAN B
ROOT
LAN E1
2
3
B2
B1
B3
B4
roa cas o opo ogy
-
7/27/2019 SAT07 stp
22/40
HUAWEI
Topo logy change no t im es s age
T opo l ogy c hange r es pm es s age
T opo l ogy c hange m es
ROOT
B
B
B
B
B
roa cas o opo ogychange message
na equacy o spann ng ree
-
7/27/2019 SAT07 stp
23/40
HUAWEI
na equacy o spann ng reeprotocol
It takes a port twice the Forward Delay tochange from the blocked status to theForwarding status, so after change of
network topology structure, it takes at leasttwice the Forward Delay to restoreconnectivity
Using a single spanning tree instance in the
whole switching network might lead to alonger convergence time and more frequenttopology changes. In switching networks that
Note:network diameter means that themaximum value of quantity of switch passcommunication between random two terminaldevices
-
7/27/2019 SAT07 stp
24/40
HUAWEI
Fast spanning tree protocol
The fast spanning tree protocol evolved fromthe spanning tree protocol, and shares thesame basic concepts;
A fast spanning tree has all functions of aspanning tree;
The purpose of improving a fast spanningtree is to try to restore network connectivityas soon as possible when the networktopology structure changes
mprovemen o as
-
7/27/2019 SAT07 stp
25/40
HUAWEI
mprovemen o asspanning trees
In the new topology structure, a new root port canimmediately enter the Forwarding status, if the original rootport has entered the blocked status, and the designated portof the opposite side switch connected to the new root port is
in the Forwarding status
LAN
A
LAN
A
LAN
A
TO ROOT
Rootport
LANA
LANA
LANA
T O R O O T
RootportF
F
Designatedport
Designatedport
Designatedport
Designatedport
F FFF
mprovemen o as
-
7/27/2019 SAT07 stp
26/40
HUAWEI
mprovemen o asspanning trees
The designated port can make a handshakewith the connected bridge so as to enter theForwarding status quickly
Handshake request
Handshakeresponse
LANA
LAN B
TO ROOT
Rootroot
Designatedport
F
Att ti !
-
7/27/2019 SAT07 stp
27/40
HUAWEI
Attention!
Two points for attention:Handshakes must occur on point to point links.
After the first handshake, the non-edge designated port of theresponding bridge will change into the discarding status, andwill continue to initiate handshakes to adjacent bridges.
L A N A
Non-point topoint link
LAN C
LAN A
LAN B
Designatedport
F
Designatedport
Designatedport
D D
Handshakediffusion
mprovemen o as
-
7/27/2019 SAT07 stp
28/40
HUAWEI
mprovemen o asspanning trees
Ports at the edge of a network, i.e., thosedirectly connected to terminals but not toother bridges can directly enter the
forwarding status, without any delay.LAN
A
LAN
ALANA
TO ROOT
RootportLANA
Edge port
F
er ormance o as
-
7/27/2019 SAT07 stp
29/40
HUAWEI
er ormance o asspanning tree
Effect of the first improvement: it takes onlyseveral microsends from finding topology changeto restoring connectivity, and without transfer ofany configuration message.
Effect of the second improvement: networkconnectivity can be restored within the time whentwo configuration messages are exchanged, i.e.,the handshake delay; in the worst case, networkconnectivity is restored only after handshake
starts from one side of the network, and spreadsto bridges at the other edge of the network. Forinstance, when the network diameter is 7, 6handshakes are required.
-
7/27/2019 SAT07 stp
30/40
HUAWEI
What are the differences between spanningtrees and fast spanning trees?
Different in protocol versions
Different in port status change mode
Different in configuration message format
Different in broadcasting modes of topologychange messages
Note: a fast spanning tree also uses a single spanning tree instance in wholeswitching network, and cannot solve the performance deterioration problem
caused by enlargement of network scope. It is recommended to keep thenetwork diameter less than 7
Config re spanning tree
-
7/27/2019 SAT07 stp
31/40
HUAWEI
Configure spanning tree
Spanning tree function is closed in default in a switch; if path loops possibly exist in network,commands should be used to start the spanning tree function
Quidway(config)#spanning-tree enable
If it is certain that no loops exist in connections at a port, then commands can be used to close the
spanning tree function of this port:Quidway(config-if-ethernet0/1)#spanning-tree disable
We can also close the spanning tree function of a switch according to requirements, or start thespanning tree function of a port
on gura e parame ers o
-
7/27/2019 SAT07 stp
32/40
HUAWEI
g pa spanning tree
Configurable parameters of a spanning treeinclude:
Bridge priority
Port priorityPath cost of a link corresponding to the port
Three important timerparameters:HelloTime/Max Age/ForwardDelay
BridgeDiameter of whole switched network
e au va ues o
-
7/27/2019 SAT07 stp
33/40
HUAWEIconfigurable parameters
Parameter nameDefault
valueDomain Configuration mode
BridgePriority32768
0-61440 (steplength:4096)
Whole officeconfiguration mode
PortPriority128 0-1024 (step length:16)
Interfaceconfiguration mode
PortPathCost
200,000 1-200,000,000Interface
configuration mode
Max Age20s 6-40
Whole officeconfiguration mode
Hello Time2s 1-10
Whole officeconfiguration mode
Forward Delay15s 4-30
Whole officeconfiguration mode
Bridge Diameter7 -----
Whole officeconfiguration mode
Note: parameters in the interface configuration mode can beconfigured either at a specific port, or at a group of ports
e ec a su a e roo r ge
-
7/27/2019 SAT07 stp
34/40
HUAWEI
gthrough configuration
Network bridge ID consists of two parts:
BridgePriority+BridgeMacAddress
If all switches in the network are in default
configuration, then according to theconfiguration message contrast rule, the switchwith the smallest MAC address is selected asthe root bridge. However, this switch is maybe
not an ideal root bridge. So, commands can beused to configure the Bridge Priority so as toelect a suitable switch to be the root bridge
Configuration port overhead
-
7/27/2019 SAT07 stp
35/40
HUAWEI
Configuration port overhead
Link rate Recommendedvalue
Recommended domain Value domain
-
7/27/2019 SAT07 stp
36/40
HUAWEI
Configuration port priority
According to the configuration message contrastrule, port ID sometimes will be compared
Port ID consists of two parts:
PortPriority+PortID, the port priority part isconfigrable:
Quidway(config-if-ethernet0/1)#spanning-treepriority [value]
Parallellink
LAN
Multiple ports connected toone network segment
on gure e e o me o
-
7/27/2019 SAT07 stp
37/40
HUAWEI
gthe port
Configuration of hello time requires attention tothe following:
Longer hello time can reduce the overhead of
spanning tree calculations; shorter hello timecan increase the robustness of spanning treeswhen the message loss rate is high.
But longer hello time will cause wrong
judgment of link failure; shorter hello time willcause sending configuration messagesfrequently , thus increasing CPU and networkload.
ax ge o con gura on
-
7/27/2019 SAT07 stp
38/40
HUAWEI
g gport
Configuration of max age requires attention tothe following:
Too long a Max Age will cause link failure to
fail to be detected in time;Too short a Max Age will let the switch wronglytake it as link failure during network congestion,leading to frequent spanning tree
recalculations.Command format
Quidway(config)#spanning-tree maxage [value]
orwar e ay o
-
7/27/2019 SAT07 stp
39/40
HUAWEIconfiguration port
Configuration of forward delay requiresattention to the following:
Too long a Forward Delay will cause too slow a
spanning tree convergence;Too short a Forward Delay will introducetemporary path loops when the topologychanges.
Command format:Quidway(config)#spanning-tree forwarddelay[value]
Note: configuration of parameters above are all in whole globalconfiguration mode , and the unit of time parameter is second.
on gur ng ne wor
-
7/27/2019 SAT07 stp
40/40
HUAWEIdiameter Bridge Diameter
Network diameter is defined as:
Maximum switches passed between any twoterminal devices
Change of network diameter can indirectlyaffect the values of two parameters: Max Ageand Forward Delay. And such impact is moreobjective than direct manual configuration of
the two parametersSo, adding switches to the network can adapt tonetwork status by changing the network