Hi! We are now moving to STP protocols. At last, I am able to write a blog post over again. I’ve been so complacent with the goal, convenient with my workmates, doing some weekend outing and friday hang-out. I was not able to comply with my weekly goals and that makes the review stagnant with the STP. This time, I will deal the review with less overtime, less hang-out and indeed focused to CCNA professional title with firm conviction that i know the concepts and knowledge.
So let’s start the discussion:
Do you remember this?
It was the time when I was discussing about VTP, and I told you that if you configure a link as a trunk link, both of the ports of the link should be with the same VLAN. I waited for a minute or two, just for the amber or the orange light on SW0 to light up, then I realized that it must be STP concept is going on with this scenario. We highlighted on the previous post that redundancy of links is a good ideas so that if one link fails, then the other fail will be there to back up on.
Here’s how it goes:
STP is turned on by default.
So regardless if we configure the switch as STP or not, it will have that scenario that one of the ports will be on blocking state.
The problem that STP aims to resolve is the issue with broadcast storm.
Let’s just try to imagine there is no amber or orange light on the figure above and all of the ports are forwarding frames. Let’s work first on SW0, let’s say that the one of the interface of SW0 has a station that would like to communicate with station connected to the interface of SW3. So the thing here is that SW0 will learn the MAC address connected to it as source mac address and since SW0 doesn’t know the MAC address connected to SW3, SW0 will send broadcast to all its active interfaces. Same scenario will happen if ports on SW2 would like to speak with ports on SW 3 and stations connected to SW2 would like to communicate with stations connected to SW0. If you will just imagine, this is just a simple network but may lead to a very complicated explanation of broadcast domain.
Here I created just a network that demonstrates how broadcast storms visually. The path that i showed is an arrow with the head as destination and the tail as the station that would like to be connected with the destination. It should be noted that the received and transmit of the frames should be infinite, I just illustrated in the figure that it has tail and head just to show you the reason why there is a broadcast storm- for switch to learn the destination MAC address.
Effects of broadcast storm:
- Bandwidth will be overwhelmed.
- . Due to infinite transmit and receive of frames, workstations will be overwhelmed.
- The MAC address will be overwrite.
How switches detect if there are switching loops?
a.) by BRIDGE ID–> it serves as a tie breaker or the reference to determine the role of the ports.
BRIDGE ID = BRIDGE PRIORITY + MAC ADDRESS
It should be noted that bridge ID should be 32768 by default
b.) BPDU – refers to Bridge Protocol Data Unit
-it is the packet that is sent by switches which has the following.
- Root bridge ID
- Sender’s Bridge ID
- Port cost from sender to root bridge
- STP timers
Here’s how BPDU works in order for switches to detect that there is a switching loop;
Again let us remember that if the light is:
A. green – it must be on forwarding state
B. amber/ orange – in STP process or off
Remember that we are discussing on how switches will detect a switching loop by the use of BPDU packets, so we may just disregard the lights appearing on the figure.
The process is that let’s say SW0 will forward BPDU packet to SW2
SW2 will treat that BPDU packet as broadcast so it will forward the BPDU packet to SW3.
SW3 will do the same as SW does so that it will send BPDU packet back to SW2
In the event that SW2 receives the same BPDU packet that SW2 initially sent, that will determine that there is a switching loop. As a summary, once a switch received the BPDU packet that it initially sent, then switching loop detected.
So the next step that the switch should do is to block a link that may lead to switching loops. But that does require a proper selection of links to achieve network efficiency. But before we go any further, let’s discuss first some jargon or terms for STP.
1.) Operational States
a.Forwarding State- the green light, active and sending packets
b. Blocking State- the amber light which does not forward packets
2.) Transitional States
I’ll get back to those terms later when we go further. But we need to understand first that the state of the port can be either just forwarding and blocking and in the event that a port requires to be transitioned from forwarding to blocking, it must go first to transitional states. So it means to say that the transition doesn’t go for just a blink of the eye.
Our hanging question a while ago is that ” how do switch will block the port to prevent switching loops?
1.) Elect a root bridge
2.) Designate port roles
3.) one of the ports will be officially blocked.
So those are the process to block a port. But first what is a root bridge?
Root bridge is the central device in a switching network, it means to say that all traffic pass first to the root bridge.
How root bridge is elected?
All switches claim to be the root bridge at first but remember that we used Bridge ID as a reference to declare a switch as a root bridge. The switch which has the lowest bridge ID will be the elected root bridge. It should be noted that bridge ID has bridge priority and mac address. We should consider first the lowest priority before the lowest MAC address, it should be also noted that most cases, bridge priority is 32768 by default and so MAC address serve as a tie-breaker.
Designate port roles
As step 2 STP process, we need to designate port roles which are the following:
1.) Designated Port (DP)- forwarding port, a key to determine designated port is to let all ports connected to root bridge as designated port. It should be noted that a link should contain one designated port.
STP link combo : DP- RP or DP to ABP
2.) Root Port (RP)- define as the port which has the lowest port cost form sender to root bridge
3.) Alternate Blocking port (ABP)- the amber one, it is the port that drops frame.
To know the designated port will be easy so long that we already know the bridge ID, but knowing the root port will depend always to the port cost.
Always remember the following STP port cost:
10 Mbps- 100
100 Mbps – 19
1 Gbps – 4
10 Gbps -2
How to elect the root port on the diagram above?
Since we stated awhile ago, that root bridge only has designated port and each link has only one designated port and the other one can be considered as root port. It would be easier to say that the ports that is across the designated ports are root ports. But on a complicated network, we must noted that we actually depend on the lowest port costs. Since SW0 is a non root bridge switch, let’s try to designate the roles of the port. I was not able to designate the interface number of each active ports but let’s try to calculate the number of port cost of the right interface of switch and then it will be 19 +19=38. On the left side of the switch, it will be just 19 and that is the reason why it we conclude it as root port.
Alternate blocking port
According to the figure, there is only one link remaining which has no port roles yet. We can always use the lowest bridge ID as the tie-breaker to determine the better port role. Since the better port role is the designated port role compared to the blocking port, the lower bridge ID on the link will be assigned as the designated port and the higher one will be the blocking port.
Hello BPDU – 2 secs
Max Age ( hold time) – 20 secs
Listening 15 secs
Learning 15 secs
STP timers is the interval of the transitioning of a port from blocking to listening or the way around. BPDU packets are expected every 2 seconds and Max Age refers to the grace period that we can expect for the BPDU packet to be sent.
- it is the state of the port that does not transmit BPDU packet but can be a recepient of BPDU packet
- discards the MAC address learned from this interface
–> state of learning the MAC address and also it does not transmit BPDU packet but receives BPDU packet and also it does not transmit frames but receives frame.
–> After this state, the blocking state will be officially transitioned to forwarding state.
Mate, you mean to say that it takes 50 seconds for STP process to take place?
Yes, but STP was created during the time wherein 50 seconds delay can be tolerated. Enhancements of the STP and the configuration will be posted on the next post.
see you mate!
***************************END OF BLOG**************************