0% found this document useful (0 votes)
69 views

Spanning Tree

This document discusses spanning tree protocol (STP) which prevents switching loops in a network with redundant links. STP selects one switch as the root switch and determines the least cost path to it for each switch and network segment. Ports are assigned roles like root port, designated port, and blocked port. Bridge protocol data units (BPDUs) are exchanged regularly to share information and enable switches to determine port states including blocking, listening, learning, and forwarding. STP ensures only one path exists between any two network devices to prevent broadcast storms caused by switching loops.

Uploaded by

Sarmad Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views

Spanning Tree

This document discusses spanning tree protocol (STP) which prevents switching loops in a network with redundant links. STP selects one switch as the root switch and determines the least cost path to it for each switch and network segment. Ports are assigned roles like root port, designated port, and blocked port. Bridge protocol data units (BPDUs) are exchanged regularly to share information and enable switches to determine port states including blocking, listening, learning, and forwarding. STP ensures only one path exists between any two network devices to prevent broadcast storms caused by switching loops.

Uploaded by

Sarmad Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Lab # 11

Learning loop avoidance with


Spanning Tree
Layer 2 switching loop
H2

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.

But , this causes a network problem that is


Switching Loops .
Switch 4 will forward the frame to all ports except the source
port

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.

• Spanning tree allows a network design to


include redundant links to provide automatic
backup paths if an active link fails without the
danger of switch loops, or the need for
manual enabling/disabling of these backup
links.
Protocol operation

E
B

C D
Protocol operation
• Select Root Switch.

• Determine the least cost path to the root


switch.
Least cost path from each switch.
Least cost path from each network segment.
Disable all other root paths.
Select root switch
Priority A : 10
Priority B : 10
MAC ADDRESS A
0200.0000.1111 A
MAC ADDRESS B
0200.0000.2222

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.

• The port connecting this switch to the


network segment is then the designated port.
Least cost path to root
-Least cost path from each network segment (Designated
Port)
Root
Switch

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

• After blocking state, a Root Port or a Designated


Port will move to a listening state.
• All other ports will remain in a blocked state.
• At this state, the port receives BPDUs from the network
segment and directs them to the switch system module
for processing.
• After 15 seconds, the switch port moves from the
listening state to the learning state.
Learning

• A port changes to learning state after listening


state.
• In the learning state, the port begins to process
user frames and start updating the MAC address
table.
• But the user frames are not forwarded to the
destination. After 15 seconds, the switch port
moves from the learning state to the forwarding
state.
Forwarding

• In a forwarding state, the port will


process BPDUs , update its MAC Address table
with frames that it receives, and forward user
traffic through the port.
• Forwarding State is the normal state.
• STP still monitors incoming BPDUs that would
indicate it should return to the blocking state to
prevent a loop.
• Disabled

Not strictly part of STP, a network administrator


can manually disable a port.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy