Spanning Tree
Spanning Tree
Switch 2
Switch 3
Switch 4
H1
Why Redundant connections ?
Why Redundant connections ?
The network will not fail completely if one of
the connected link fails.
Why Redundant connections ?
The network will not fail completely even one if
the connected link fails.
H2
Switch 2
Switch 3
Switch 4
H1
Switch 1 and 3 will forward the frame to all ports except source
port
H2
Switch 2
Switch 3
Switch 4
H1
Switch 1 – Switch 3 – Switch 4 Switch 3 – Switch 1 – Switch 4
H2
Switch 2
Switch 3
Switch 4
H1
• This leads to a switching loop and
the frame will start circulating in the network
in a loop.
• Host 2 will receive multiple copies of the same
frame arriving via different paths, which leads
to additional overhead.
• Layer 2 Switching loops cause serious
problems to network performance.
Spanning Tree Protocol
• STP is a link layer protocol that ensures a loop
free topology for any switched LAN.
E
B
C D
Protocol operation
• Select Root Switch.
E
B
C D
Protocol operation
Root
A Switch
E
B
C D
Least cost path to root
-Least cost path from each switch (Root port)
Root
Switch
A
4 4
E
B
4 4
C D
4
Least cost path from each network
segment (Designated Port)
• The switches on a network segment
collectively determine which switch has the
least cost path from the network segment to
the root.
S1 A S5
4 4
E
B
4 4
S2 S4
C D
4
S3
Root node’s both ports are designated ports by default
Root
Switch
D A D
S1 4 4 S5
E
B
4 4
S2 S4
C D
4
S3
The port will be root or designated. If a port is
neither root nor designated port then it will be
considered as Blocked port (BP)
Segment 2
Root
Switch
D A D
S1 4 4 S5
E
B
4 D 4
S2 S4
C D
4
S3
Switch C : cost 12
Segment 3
Switch D : cost 12
MAC C : 0200 0000 3333 Root
MAC D : 0200 0000 4444 Switch
D A D
S1 4 4 S5
E
B
4 D 4
S2 S4
D B
C D
4
S3
Segment 4
Root
Switch
D A D
S1 4 4 S5
E
B
D D
4 4
S2 S4
D B
C D
4
S3
Bridge Protocol Data Units
• The rules for determining spanning tree
require knowledge of the entire network.
• The switches have to determine the root
switch and compute port roles ( root,
designated, blocked)
• Bridge Protocol data units are used to
exchange information about switch ID’S and
root cost path.
Types
There are three types of BPDUs :
Configuration BPDU (CBPDU) used for
spanning tree computation
Topology Change Notification (TCN) BPDU,
used to announce changes in the network
topology
Topology Change Notification
Acknowledgment (TCA).
• BPDUs are exchanged regularly ( every 2
seconds by default ) and enable switch to keep
track of network changes and to start and stop
forwarding at ports as required.
Spanning tree port states
The ports on a switch with enabled Spanning Tree
Protocol (STP) are in one of the following five port
states.
• Blocking
• Listening
• Learning
• Forwarding
• Disabled
• Blocking
When STP is enabled, every switch in the
network starts in the blocking state and later
changes to the listening and learning states.
Listening