(1) Configuration BPDUs
(2) Topology Change Notification BPDUs (TCNs)
Using these 2 types of frames, STP does it's everything..
A BPDU frame has the following format..
Let's see a normal operation..
Configuration BPDUs are generated from the Root Bridge (Root Switch) and flow outward along the active paths and move away from the Root Bridge. Which means Non-root switches will receive these from their Root ports & Alternate ports and forwards out only from their Designated ports..
Each designated switch changes the Root Path Cost, Bridge ID & Port ID of the BPDU they receive before they send them downstream..
Following image shows the propagation of the Configuration BPDUs in a switching network..
For example, let's assume a link on S-5 (not the link connected to S-3) goes down.
Here is where the TCNs (PBDUs which can go upstream) were introduced.
TCNs are generated normally from Non-root switches and flow upstream towards the Root Bridge to inform the Root Bridge that the network topology has changed. Which means Non-root switches will forward out these only from their Root ports and receive only from their Designated ports..
The TCN is a very simple BPDU that contains absolutely no information that a bridge sends out every Hello Time seconds (this is locally configured Hello Time, not the Hello Time specified in configuration BPDUs which were set by the Root Bridge).
The designated bridge acknowledges the TCN by immediately sending back a normal configuration BPDU with the topology change acknowledgement (TCA) bit in Flag field set. The bridge that notifies the topology change does not stop sending its TCN until the designated bridge has acknowledged it.
Note that TCA is not a new BPDU.. It's just a Configuration BPDU with a bit changed..
Once the TCNs hit the Root, it also acknowledges the designated switch and it starts to send out its Configuration BPDUs with the topology change (TC) bit set.
These BPDUs are relayed by every bridge in the network with this bit set. As a result all bridges become aware of the topology change situation and it can reduce its CAM table Aging Time to Forward Delay.
Bridges receive TC BPDUs on both forwarding and blocking ports because they are actually Configuration BPDUs.
TC BPDUs are propagated like the following way.. They are also not a new BPDU type. Just the Configuration BPDUs with a bit change.
These TC BPDUs are sent for a period of Max Age + Forward Delay seconds, which is 20+15=35 seconds by default. Here is why..
We deal with 5 timers in STP..
(1) Hello Time
(2) Max Age
(3) MessageAge
(4) Forward Delay
(5) Aging Time
You can see those 4 timers in the show spanning-tree output..
Hello Time is the time frequency which the Configuration BPDUs are sent.. Default is 2s.
Max Age is the time which a BPDU is considered valid by the Root switch.. Default is 20s.
MessageAge is the BPDU's age since it was originated by the Root switch. At the root switch it is set to 0 and other switches increment this value by 1 before forwarding further..
Therefore remaining lifetime of a BPDU after receiving by a switch is (MaxAge - MessageAge)
Forward Delay is the time which it takes to move from Listening State to Learning State and Learning State to Forwarding State.. Default is 15s.
Aging Time is the time which a CAM table entry will be valid.. Switches flush the MAC Address entry from it's CAM table after this time expires.. Default is 300s.
The reason for the TC BPDUs are sent for a period of Max Age + Forward Delay is that it will force the switch to flush the old remembered BPDUs and clear the MAC address table.
You can see the CAM Aging Time changes to Forward Delay on show spanning-tree output by entering the following debug command and unplugging a port of a switch..
S-1-ROOT#debug spanning-tree events
We deal with 5 timers in STP..
(1) Hello Time
(2) Max Age
(3) MessageAge
(4) Forward Delay
(5) Aging Time
You can see those 4 timers in the show spanning-tree output..
Hello Time is the time frequency which the Configuration BPDUs are sent.. Default is 2s.
Max Age is the time which a BPDU is considered valid by the Root switch.. Default is 20s.
MessageAge is the BPDU's age since it was originated by the Root switch. At the root switch it is set to 0 and other switches increment this value by 1 before forwarding further..
Therefore remaining lifetime of a BPDU after receiving by a switch is (MaxAge - MessageAge)
Forward Delay is the time which it takes to move from Listening State to Learning State and Learning State to Forwarding State.. Default is 15s.
Aging Time is the time which a CAM table entry will be valid.. Switches flush the MAC Address entry from it's CAM table after this time expires.. Default is 300s.
The reason for the TC BPDUs are sent for a period of Max Age + Forward Delay is that it will force the switch to flush the old remembered BPDUs and clear the MAC address table.
You can see the CAM Aging Time changes to Forward Delay on show spanning-tree output by entering the following debug command and unplugging a port of a switch..
S-1-ROOT#debug spanning-tree events
Note:-
You will not see the receipt of TC BPDUs on debug, but all the switches in the network will receive them silently and change their timers and relearn the MAC addresses..
We found 4 BPDUs in the above STP process.
(1) Config BPDU
(2) TCN
(3) TCA
(4) TC
But there are actually only 2 types which are Config BPDUs & TCNs. TCAs & TCs are just Config BPDUs with only a bit changed in the Flag field of the frame..
We found 4 BPDUs in the above STP process.
(1) Config BPDU
(2) TCN
(3) TCA
(4) TC
But there are actually only 2 types which are Config BPDUs & TCNs. TCAs & TCs are just Config BPDUs with only a bit changed in the Flag field of the frame..
Excellent explanation!
ReplyDelete