Sunday, March 15, 2015

Spanning Tree Protocol

What is spanning tree?
------------------------------------
Spanning tree protocol, also known by the acronym STP, is a Local Area Network protocol which is used to prevent bridging loops in local segments of the network.   This is done through an election process of a root bridge on the LAN segment. The root bridge is the logical center of the segment and can see all traffic that is traversing its network. 

What is a Bridge Protocol Data Unit?
--------------------------------------
Configuration BPDU is used by Spanning tree protocol to provide and exchange information between all switches on the local segment.  The information in the frame will consist of the physical MAC address of the source port (originating switch port) and the multicast address destination of 01:80:C2:00:00:00.  The BPDU allow the switches to elect a root bridge for the segment and designate port states that will create a single functioning path back to the root bridge.

The information contained in the Bridge Protocol Data Unit consists of the BPDU Type, Root ID and the Root Path Cost.  The type communications if the BPDU is a configuration BPDU or a topology change BPDU.  The Root ID communicates to the other switches what the priority is for the source switch and what the physical address (MAC Address) are for the root bridge on the segment.  The root cost field is used to calculate the lowest cost back to the root bridge.

Port election states
-------------------------------------
Physical links between the switches are then designated either a forwarding port or a blocking port.  The goal of STP is to create a single patch back to the root bridge, therefore eliminating multiple paths to the root bridge.
Blocking – A blocked port is a port that would cause a bridging loop if it was in a forwarding state.  No user data is sent or received over a blocking port, but it may go into forwarding mode if the other links in use fail and the spanning tree algorithm determines the port may transition to the forwarding state. BPDU data is still received in blocking state.
Listening - The port is processing BPDUs and awaiting possible new information that would cause it to return to the blocking state. It does not populate the MAC address table and it does not forward frames.
Learning – A port which is not yet forward frames.  It does learn source addresses from frames received and adds them to the filtering database (switching database). It populates the MAC Address table, but does not forward frames.
Forwarding - A forwarding port receives and sends data under normal operation.

Disabled – A disabled port can be manually disabled by the network administrator.