STP Principle
Prepared by :
Md. Ali Emrose Khan
Department of Information & Communication Engineering
Faculty of Engineering and Technology
Islamic University, Bangladesh
Kushtia-7003, Bangladesh
[Link]
Chapter 1 STP Principle
Chapter 2 RSTP Principle
Page 2
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
Page 3
Broadcast In A Network With Loops
Site A
1
LAN 1
1 1 1
B1 B2 B3
3 2 3 2 3 2
LAN 2
Site B
Page 4
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
Page 5
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.
Page 6
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
Page 7
Configuration Message Format
DMA SMA L/T LLC Header Payload
• DMA: Destination MAC Address Domain Byte
• SMA: Source MAC Address Protocol ID 2
Protocol Version 1
• L/T: Frame length BPDU Type 1
Flag Bit 1
• LLC Header: Fixed link head of Root Bridge ID 8
Root Path Cost 4
configuration message 8
Designated Bridge ID
2
• Payload: BPDU Data Designated Port ID
Message Age 2
Max Age 2
Hello Time 2
Forward Delay 2
Page 8
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
Page 9
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
Page 10
Port Status
Port Status Port Ability
Disabled Not receive/send any message
Blocking Not receive/forward data, receive but not
transfer BPDUs, and not learn addresses
Listening Not receive/forward data, receive and transfer
BPDUs, but not learn addresses
Learning Not receive/forward data, receive and transfer
BPDUs, and start to learn addresses
Forwarding Receive and forward data, receive and
transfer BPDUs, and learn addresses
Page 11
Disadvantages of STP
• Recovery time is too long: two Forward Delay
• Network diameter should be less than 7.
Page 12
Chapter 1 STP Principle
Chapter 2 RSTP Principle
Page 13
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
Page 14
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
Page 15
STP vs. RSTP (Port States)
STP port state RSTP port state
Disabled Discarding
Blocking Discarding
Listening Discarding
Learning Learning
Forwarding Forwarding
Page 16
Improvement Of Rapid
Spanning Tree (I)
TO ROOT TO ROOT
LAN A LAN A
Designated Port F F Designated Port Designated Port F F Designated Port
LAN A LAN A LAN A LAN A
Blocked Port F Root Port Root Port F 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.
Page 17
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 F
Handshake request
4 1
Handshake response
LAN B
3 2
Root Port
Page 18
Attention
• Handshakes must occur on point to point links.
Designated Port F
LAN A
LAN A
Designated Port F F Designated Port
LAN B LAN C
Non Point to Point Links Handshake Diffusion
Page 19
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
F LAN D
Edge Port
Page 20
Thank You