SPANNINIG TREE

WHAT IS SPANNING TREE




The purpose of the protocol is to have bridges dynamically discover

 a subset of the topology that is loop-free (a tree) and yet has just

 enough connectivity so that where physically possible, there is a

 path between every switch.


Several flavors:

Traditional Spanning Tree (802.1d)

Rapid Spanning Tree or RSTP (802.1w)

Multiple Spanning Tree or MSTP (802.1s)

STP Variants:

On Cisco hardware, Spanning-Tree works in proprietary mode with

 either PVST+ (Per-VLAN Spanning Tree) or PVRST+ (Per-VLAN 

Rapid Spanning Tree).

NomStandard
Spanning-Tree (STP)IEEE 802.1D
PVST+STP Cisco
Rapid Spanning-Tree (RSTP)IEEE 802.1w
PVRST+RSTP Cisco
MISTIEEE 802.1s
États Spanning-Tee (802.1d)États Rapid STP (802.1w)
Blocking                                                                                  Discarding
ListeningDiscarding
LearningLearning
ForwardingForwarding
Traditional Spanning Tree (802.1d)


Switches exchange messages that allow them to compute the Spanning Tree
These messages are called BPDUs (Bridge Protocol Data Units)
Two types of BPDUs:
Configuration
Topology Change Notification (TCN)


First Step: 

Decide on a point of reference: the Root Bridge
The election process is based on the Bridge ID, which is composed of:
The Bridge Priority: A two-byte value that is configurable
The MAC address: A unique, hardcoded address that cannot be changed.


Root Bridge Selection (802.1d)


Each switch starts by sending out BPDUs with a Root Bridge ID equal to its own Bridge ID
I am the root!
Received BPDUs are analyzed to see if a lower Root Bridge ID is being announced
If so, each switch replaces the value of the advertised Root Bridge ID with this new lower ID
Eventually, they all agree on who the Root Bridge is





Now each switch needs to figure out where it is in relation to the Root Bridge
Each switch needs to determine its Root Port
The key is to find the port with the lowest Root Path Cost
The cumulative cost of all the links leading to the Root Bridge


Each link on a switch has a Path Cost
Inversely proportional to the link speed
e.g. The faster the link, the lower the cost 





Root Path Cost is the accumulation of a link’s Path Cost and the Path Costs learned from neighboring Switches.
It answers the question: How much does it cost to reach the Root Bridge through this port?



1-Root Bridge sends out BPDUs with a Root Path Cost value of 0
2-Neighbor receives BPDU and adds port’s Path Cost to Root Path Cost received
3-Neighbor sends out BPDUs with new cumulative value as Root Path Cost
4-Other neighbor’s down the line keep adding in the same fashion



On each switch, the port where the lowest Root Path Cost was received becomes the Root Port
This is the port with the best path to the Root Bridge









 

Electing Designated Ports (802.1d)


OK, we now have selected root ports but we haven’t solved the loop problem yet, have we
The links are still active!
Each network segment needs to have only one switch forwarding traffic to and from that segment
Switches then need to identify one Designated Port per link
The one with the lowest cumulative Root Path Cost to the Root Bridge







Two or more ports in a segment having identical Root Path Costs is possible, which results in a tie condition
All STP decisions are based on the following sequence of conditions:
Lowest Root Bridge ID
Lowest Root Path Cost to Root Bridge
Lowest Sender Bridge ID
Lowest Sender Port ID







Blocking a port

Any port that is not elected as either a Root Port, nor a Designated Port is put into the Blocking State.
This step effectively breaks the loop and completes the Spanning Tree.







Spanning Tree Protocol States

Disabled
Port is shut down
Blocking
Not forwarding frames 
Receiving BPDUs
Listening
Not forwarding frames 
Sending and receiving BPDUs


Learning
Not forwarding frames
Sending and receiving BPDUs
Learning new MAC addresses
Forwarding
Forwarding frames
Sending and receiving BPDUs
Learning new MAC addresses


STP Topology Changes

Switches will recalculate if:
A new switch is introduced
It could be the new Root Bridge!
A switch fails
A link fails


Root Bridge Placement



Using default STP parameters might result in an undesired situation
Traffic will flow in non-optimal ways
An unstable or slow switch might become the root
You need to plan your assignment of bridge priorities carefully





Protecting the STP Topology



ome vendors have included features that protect the STP topology:
Root Guard
BPDU Guard
Loop Guard
UDLD
Etc.




















No comments:

Post a Comment

TCP_IP_ATTACKS