PAPER WORK ON SPANNING TREE PROTOCOL AND RAPID SPANNING TREE PROTOCOL
PAPER WORK ON SPANNING TREE PROTOCOL
AND RAPID SPANNING TREE PROTOCOL
DONE BY
Capecisco.blog
Introduction:
Spanning Tree Protocol (802.1D):
Spanning Tree Protocol
(STP) was developed before switches were created and it used to deal with an
issue that occurred with bridges that were implemented in the network. STP serves
two purposes that are to prevent problem caused by loops on a network and when
redundant loops are planned on a network, STP deals with remediation of network
failures.
STP
is a Layer 2 protocol that passes data back and forth to find out how the
switches are organized on the network and then takes all the information it
gathers and uses it to create a logical tree. Part of the information STP
receives defines exactly how all the network switches are interconnected.
STP
builds this information by sending out network packets called Bridge Protocol
Data Units (BPDUs). These BPDUs control the way STP determines the network
topology.
In
a network, STP elects one root bridge and remaining is considered as a non-root
bridge and these elections are based on some characteristics.
STP Terms:
BPDU- ABridge Protocol Data Unit (BPDU) is a data
message transmitted across a local area network to detect loops in network
topologies. A BPDU contains information regarding ports, switches, port
priority and addresses. BPDUs contain the information necessary to configure
and maintain spanning tree topology. They are not forwarded by switches, but
the information is used by switches to calculate their own BPDUs for
information passing.
Spanning Tree State -
Indicates if the Spanning Tree Protocol is currently enabled on the switch.
Bridge ID - Identifies
a unique identifier for the switch in the spanning tree. The ID is calculated
using the defined spanning tree priority of the switch and its MAC address. The
lower the Bridge ID, the more likely the switch will act as the root.
Priority - Bridge priority is used in
selecting the root device, root port, and designated port. The device with the
highest priority becomes the STP root device. However, if all devices have the
same priority, the device with the lowest MAC address will then become the root
device.
Max Age - The
maximum time (in seconds) the switch can wait without receiving a configuration
message before attempting to reconfigure. All device ports (except for
designated ports) should receive configuration messages at regular intervals.
If the root port ages out STP information (provided in the last configuration
message), a new root port is selected from among the device ports attached to
the network. By default it is 20 seconds.
Hello Time -
Specifies the time interval (in seconds) at which the root device transmits a
configuration message. By default it is 2 seconds.
Forward Delay - The
maximum time (in seconds) the switch will wait before changing states (i.e.,
discarding to learning to forwarding). This delay is required because every
device must receive information about topology changes before it starts to
forward frames. By default it is 15 seconds.
Designated Root -
Identifies the priority and MAC address of the device in the spanning tree that
the switch has accepted as the root device.
Root Port -
Specifies the port number on the switch that is closest to the root. The switch
communicates with the root device through this port. If there is no root port,
the switch has been accepted as the root device of the spanning tree network.
Configuration Changes -
Specifies the number of times the spanning tree has been reconfigured.
STP
States:
Listening:
Initially, every bridge acts as a root bridge and
enters into the listening state to determine the active topology. In listening
state it will listen alone about the network for 15 seconds. In the listening state, no user data is being passed; however, the
port is sending and receiving BPDUs in an effort to determine the active
topology.
Learning: In learning states generally it builds the bridging table. The
learning state is a 15-second interval during which the bridge does not pass
user data frames. As the bridge receives frames, it places the source MAC
address and port of each frame into the bridging table.
Forwarding: A port in the forwarding state forwards frames across the attached
network segment. 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.
Disable: A port in the
disabled state does not participate in frame forwarding or the operation of STP because a port in the disabled
state is considered non-operational.
How the Root
Bridge and Ports are chosen?
Use
the bridge priority to control which bridge is elected as the root bridge and
also to control which bridge is elected the root bridge when the initial root
bridge fails.
The root
bridge for each spanning-tree protocol instance is determined by the bridge ID.
The bridge ID consists of a configurable bridge priority and the MAC address of
the bridge.By default, all switches use 32768 as their priority so the bridge
with the lowest bridge ID is elected as the root bridge. If the bridge
priorities are equal or if the bridge priority is not configured, the bridge
with the lowest MAC address is elected the root bridge.
You can manipulate this by adjusting the priorities, since the
default Root Bridge is likely not the one you want to act as Root. You would
decide which switch to use as root based on your layer 2 designs and where you
anticipate layer 2 traffic to travel most. The bridge priority can be set only
in increments of 4096.
The
cost of the path to root is the sum of the link costs between the port in
question and the relevant port on the root bridge. The faster the link, the lower
the cost. So ten hops to root over 1GBPS links would give a port cost of 40
(4+4+4+4+4+4+4+4+4+4), while a single 10MBPS link would be 100. So the root
port would be the one that connects to the 1GBPS links.
Let’s discuss about STP with a simple example
shown below:
Consider
the above example,
·
In the above
topology, we have to assign one switch as Root Bridge and the remaining two as
Non-root Bridge.
·
Root Bridge will
be selected on the basis of the Bridge ID.
·
For this process,
the BPDU frames are exchanged and compare the requirements to select the root
bridge.
·
Bridge ID
consists of bridge priority and Mac address.
·
Comparing the
above switches, all the switches have a same priority 32768 and then it looks
for the lowest mac address.
·
Switch 0 has the
lowest mac address so it is selected as the root bridge.
·
Ports in the root
bridge are considered to be a designated port.
·
For assigning the
root port, designated port and block port will follow the below criteria:
Ø Lowest cost to reach Root Bridge.
Ø Lowest Neighbor Bridge ID.
Ø Lowest neighbor Port ID.
·
For switch 1,
lowest cost to reach Root Bridge is through fast Ethernet 0/1 and it is
assigned as Root Port.
·
For switch 2,
lowest cost to reach Root Bridge is through fast Ethernet 0/2 and it is
assigned as Root port.
·
Now there is
conflict between switch 1 and switch 2 that which port should be assigned as
Designated Port and Block port.
·
Since switch 2
has the lowest mac address, fast Ethernet 0/1 assigned as Designated Port and
Switch 1’s fast Ethernet 0/2 assigned to be as Block Port.
·
Basically, when
the link between the switch 0 and switch 1’s link is down then it takes the
redundant path through the Block port which would be replaced as the Root port.
STP Optimization:
Port Fast: To explain the port fast we can take a example
that we have host or server connected to a switch port then there is no need
for this device to listen to BPDU’s because it is not a layer 2 device and they
will not create loops because it has a single link to the layer 2 network.
Therefore, when you configure a switch port as port fast, STP will
be disabled on that port and it will transition to forwarding state when it
comes up and will never be blocked. So, they will not go to listening and
learning state. The command to configure port fast is spanning-tree portfast.
Uplink Fast:
Uplink Fast is a feature that greatly enhances
the convergence time associated with a direct failure of an uplink attached to
a switch. If there is a link failure in a network, it detects the failure in
the network and tries to redirect to the redundant path but after the link is
down it will goes to the listening, learning state and then it goes to the
forwarding state. So, there is delay in the transition to the new path. If the
uplink fast is enabled then it will recover this problem by avoiding the
listening and learning state (30 seconds) and directly goes to the forwarding
state. By enabling Uplink Fast on the switch, the convergence time is reduced
from 30 seconds to almost 0. The command to enable uplink fast is Spanning-tree uplinkfast.
Backbone
Fast:
Uplink fast is designed for the
direct link failure and the backbone fast is designed for the indirect link
failure. Backbone fast is a pro-active using Root Link Query (RLQ) and when backbone
fast is enabled, it will reduce the max age time. By enabling this the max age
time is skipped and the delay is reduced from 50 seconds to 30 seconds. As soon
as the inferior BPDU is received, RLQ request is sent in a port in which usually
BPDU’s receive, this is to check whether that you still have connectivity to
the root through this port. Then the response will come back to this port from
the root bridge and if the two roots are same then we can conclude that
connectivity is still alive. The command to enable the backbone fast is spanning-tree backbonefast.
TCN in STP:
Need for TCN:
In
learning state when it receives the frame, a bridge create a table that
associate to a port the Media Access Control address of the host can be reached
through this port. This is used to forward the frames directly to the
destination. If there is any link failure in the network it takes about 50
second that is it has to move to listening, learning and forwarding state. And
it takes 300 MAC addresses to age out. So, it takes more time to redirect it to
the second best path i.e changing of blocking state to forwarding state. To
avoid this delay, it sends topology change notifications. All bridges become
aware of the event and reduce their aging time to 15 seconds.
TCN process with simple example:
In
the below topology, Root Bridge is the switch 0. If the link between the switch
0 and switch 1 then switch 1 send the TCN sends the TCN
message to the root bridge to aware the root bridge that there is some link
failure in the topology.
In
this topology, when there is failure occurred it will send the TCN and send it
with the bit set to 1 and when it reach the root bridge then it will send the
TCN Acknowledgement packet with set bit as 1. Then when the root bridge came to
know about the failure, it will aware all the device in the topology by
relaying the TCN BPDU’s set both TCN and TCN acknowledge bit to 1 and it can
reduce its aging time to forward delay. Bridges receive topology change BPDUs
on both forwarding and blocking ports.
In
this TCN, there is some problem occur in this process. When the root bridge
relay the TCN BPDU’s to all the devices that includes the end devices also. So
the end device also have to wait for 35 sec and since it goes up and down when
every there is change in the topology. To avoid this error, we use port fast to
overcome this problem. So, that it will not enter into listening and learning
state for the end devices.
Introduction:
Rapid Spanning-Tree Protocol (RSTP):
Rapid
Spanning Tree Protocol (802.1w) provides significantly faster spanning tree
convergence than the legacy spanning tree. Since, in legacy spanning tree if
there is link failure it takes 50 seconds to change the block state to the
forwarding state.
But
with STP optimization by introducing the uplink fast port fast and backbone
fast these delay has been overcome. But in 802.1w that is Rapid spanning tree
has the ability of fast convergence. Hence, the delay during the topology
change is overcome in RSTP.
RSTP
was designed to be backwards-compatible with standard STP. While STP can take
30 to 50 seconds to respond to a topology change, RSTP is typically able to
respond to changes within 3 × Hello times or within a few
milliseconds of a physical link failure. Standard IEEE 802.1D-2004 incorporates
RSTP and obsoletes the original STP standard. Detection root switch failure can
be done within 6 seconds in RSTP. The main feature in RSTP is by default it
avoid the 30 seconds delay due to listening and learning state that occur when
there is change in the topology.
RSTP over STP:
The main
difference between RSTP (802.1W) and STP (802.1D) is that Rapid Spanning Tree Protocol (RSTP
IEEE 802.1W) assumes the three STP ports
states listening, learning and forwarding. Hence RSTP includes new state called
discarding state.
In
Spanning tree protocol bridges would only sent out a BPDU when they received
one on their root port but in RSTP enabled send out BPDU’s for every hello time
containing current information.
Spanning
Tree Protocol includes two ports root port and designated port. In RSTP
includes two additional ports referred as alternate ports and backup ports.
An
alternate port is a port provides the alternate path when the link goes down
but is currently in a discarding state which is considered as the unused port.
RSTP bridge port roles:
- Root - A
forwarding port that is the best port from non root-bridge to Root Bridge.
- Designated - A
forwarding port for every LAN segment.
- Alternate - An
alternate path to the root bridge. This path is different from using the
root port.
- Backup - A
backup redundant path to a segment where another bridge port already
connects.
- Disabled - Not
strictly part of STP, a network administrator can manually disable a port.
RSTP switch port states:
The switch states are similar as like in
the Spanning tree protocol ,
- Discarding - No
user data is sent over the port.
- Learning - The
port is not forwarding frames yet, but is populating its MAC-address-table.
- Forwarding - The
port is fully operational, 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.
Topology Change Notification:
In
RSTP, there is a few changes compared to STP that is there were included the
proposal and agreement bit is used in the case of RSTP. Since, in STP when
there is change in the topology the TCN bit is send to the root bridge and it
will response it with the TCN acknowledgement bit. But in the RSTP, non-edge port changing to forwarding state will
trigger a topology change.
RSTP enabled switches do not use topology change notification
BPDU anymore, this is only used to be backward compatible with STP enabled
switches. The era for a switch to notify Root Bridge about topology change and
root bridge informs all switches about the changes is over. When a RSTP enabled
switch detects topology change, the RSTP enabled switch sets TC-while timer to
2x hello timer. RSTP enabled switch sends BPDU to its neighbor with TC bit set.
RSTP enabled switch received BPDU with TC bit set flushes their mac address
except for edge port associated mac address. This process will have BPDU
flooding until all mac addresses are re-learned, the proposal and agreement
process will be involved as well.
Proposal and Agreement:
The proposal agreement it's used for the synchronization
process in order to select a root bridge for the STP topology. This basically
means that 802.1w/RSTP sync process it's fundamental for the topology stability
and convergence, but on the other hand the TCN's on 802.1w are not always sent,
in fact there is only a possibility for a switch to generate and send TCN
messages. The only possibility is when a non-edge port moves to the forwarding
state.
The huge difference between STP and RSTP is this proposal and
agreement mechanism.
Switch A sends proposal downstream to two switches B and C.
While sending proposal to the switches Switch A ports are in designated blocking
state.
Switch B and C sends agreement to Switch A to allow Switch A
ports to transit to designated forwarding state, while during this time Switch
B and C block their downstream designated port to prevent bridging loop. This
process is known as sync, switch will block downstream non-edge designated port
during sync process.
Switch B then sends proposal to switch C. Switch C port
received a superior BPDU, changes its port to alternate port and blocking
state. Switch B does not receive agreement from Switch C will transit its port
to designated forwarding state.
References:
Thanks & regards,
Capecisco.blog | E-mail : capecisco@gmail.com
| Website : www.capecisco.blogspot.in
"Its Not your aptitude,but your attitude,that determines your altitude"
No comments:
Post a Comment
thank you for your query we will get back to you shortly !!!