STP: Spanning Tree Protocol Part 2
OK, just to recap on what we have discussed on the previous blog: We've covered basically what STP does in our network and how it helps us in our design for redundancy. We've covered in detail regarding the BPDUs and the BID that are found in the BPDUs. We've also discussed how STP uses the STA (spanning-tree algorithm) to select the shortest/best path to the root bridge without creating a loop.
Now, what we're gonna talk now is about a little bit of port roles and BPDU timers. After which we'll go ahead and start discussing PVST (per VLAN spanning-tree). We'll end with some important CLI commands to configure and verify STP on our switches.
If you had read Part 1 my STP blog, you are pretty much knowledgable about STP. I agree some things could be left out, but then again, more knowledge means you can make decisions better. Let's start with port roles.
Ok, I've written before that there are four roles that a port could be playing, but I'll just put in key points about each roles.
1. root port - the switch port that is the best path to the root bridge
- there could only be one root port per bridge
- could populate the MAC address table
2. designated port - the switchport that forward frames to the root bridge
- there could only be one per segment
- all ports of the root bridge are designated ports
- exists on both root and non-root bridge
- could populate the MAC address table
3. non-designated port - the switchport that blocks frames
- could not populate the MAC address table
4. disabled port - the interface has the 'shutdown' configuration, it's administratively down
Now you ask, how does the switch know what roles to assign to a port? The STA does that. It tells the switch what port is the closest to the root port, and the port closest to the root bridge is the root ports. The rest of the ports that participates in STP are either designated ports or non-designated ports. The best path is chosen by the number of hops going to the root bridge multiplied by the port cost (refer to part 1). The lowest path cost will be chosen.
Now let's discuss port states. You might ask, what's the difference? Well port roles is how we redundant ports should behave. While port states are what the ports are doing. Example, the port is a root port(port role) so it should be forwarding(port state). Another example would be, the port is a non-designated port(port role) so it should be blocking(port state). Get it? Ok. There are five port states: forwarding, learning, blocking, listening, and disabled. Ports transitions to these different states in order to have a loop free network.
- forwarding - port is able to forward frames
- learning - port is ready to participate in frame forwarding, populating MAC table
- listening - port has just been determined that it could participate in frame forwarding. prepares to go to learning state
- blocking - port is cannot forward frames, but can receive BPDU frames to know where the root bridge and the other port roles
- disabled - port is not active, adminstratively down
Now we're done with port roles and port states, we'll head over to a short discussion of the BPDU timers, and why are they significant.
There are three timers we need to focus on: the hello time, forward delay, and the maximum age. The hello time is the time interval before the port sends another BPDU frame. The default is 2 seconds and can be tuned from 1 to 10 seconds. The forward delay timers are generally the time a port spends in the listening and learning state. The default is 15 seconds, but can be tuned to 4 to 30 seconds. The use of the forward delay timer is to allow all switches to decide the correct port roles to have a loop free network. The maximum age timer is to tell the switch how long it should keep the BPDU information. The default is 20 seconds and can be tuned from 6 to 40 seconds.
Just a note: STP only functions on networks with the diameter size of seven. Diameter is the number of switches a frame has to travel to reach another node. With that note, it brings me telling you that though we could tune all of these timers, it is advised not to, since it is already optimized by default with the network diameter size of 7 so that you wouldn't mess up the convergence(state where in STP has already calculated the best path and all ports are in their proper roles).
To view or verify the spanning-tree status type in show spanning-tree on the privelage mode of the switch CLI (command line interface). There you will see the following:
- the root bridge ID (you will know if the switch your accessing is the root bridge because it will indicate there: "this bridge is the root".
- priority value
- MAC address
- BPDU timers
- the bridge ID
- priority value
- extended systed id
- MAC address
- BPDU timers
- the interfaces that participates in STP, you will be able to see:
- the roles they are currently on
- the path cost going to the root bridge
- the status that the port currently have
To configure STP on a switch, we must be in the global-configuration mode of the switch
1. change BID of the switch
- spanning-tree vlan
2. change switch priority
- spanning-tree vlan
3. change cost of a port (you must be in the interface-configuration mode of that port)
- spanning-tree cost
4. setting the STP diameter
- spanning-tree vlan
5. changing the port priority (you must be in the interface-configuration mode of that port)
- spanning-tree port-priority <0-240,>
OK boy and girls, I think my brain can't take anymore writing at the moment. Forgot that I have to do my labs and my thesis paper still. Yes, I'm not done discussing PVST and some scenarios to help your network design. Guess there would be a part 3 for STP. It'll take some time for me to finish on STP part 3, since I've got to read about stuff related to my thesis. Anyway, it's another review day for me.
For any CCNA or Cisco knowledgable peeps who are reading this, please do check if what I wrote is correct (including typos or wrong grammar haha). And if you guys have any questions regarding STP, please do ask, I'll be glad to help and find the answers.
0 comments:
Post a Comment