Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

STP - Forwarding and Blocking Modes 1

Status
Not open for further replies.

skk391

Technical User
Mar 3, 2009
332
0
0
GB
Hello Guys

Im just studying to my ICDN2 exam and have come across STP. Im a little confused. I throught that STP elects a root bridge through an election and then STP puts ports into forwarding and blocking mode. The root bridge will have all trunk ports into forwarding mode all the time to help speed up convergence in the case of a trunk/port going bad. Therefore all other switches on the network should have 1 trunk in forwarding mode and then all other trunks in blocking mode, shouldnt it? so that no switching loops are formed, but when I carry out the following command on my production network I get the following result....


#show spanning-tree vlan 1

VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address 0003.e3e6.fb40
Cost 23
Port 21 (FastEthernet0/21)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 000f.24d9.f2c0
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 15

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3 Desg FWD 19 128.3 P2p
Fa0/5 Desg FWD 19 128.5 P2p
Fa0/11 Desg FWD 19 128.11 P2p
Fa0/13 Desg FWD 19 128.13 P2p
Fa0/16 Desg FWD 19 128.16 P2p
Fa0/21 Root FWD 19 128.21 P2p
Fa0/22 Desg FWD 19 128.22 P2p


Maybe I got myself a little confused on the matter, but this switch according to the output is not the root switch, so therefore shouldnt only one of the above interfaces be in forwarding mode and the rest in blocking???

Many Thanks in Advance

 
Trying to think how to explain this so it makes sense. Don't think of spanning-tree as a trunking only protocol. Basically, spanning tree is going to run on all ports. For access-layer ports (ports going to end devices) you will want to have port-fast configured so that the port goes immediately to a forwarding state.

I always like to try and think like I'm a packet. The packet needs to be able to flow through the network to get from point A to point B. If a port is blocked, I can't get through, and have to find another route. So, by what you are saying, if there was a computer on Fa0/3, and it was blocking, basically, that computer couldn't talk to any thing else.

 
Thanks for the reply lerdalt, but im still confused. I havent configured any ports with portfast. So I dont know why these ports are showing up in forwarding state. As far as I know these ports are connecting this switch to other switches and therefore should be in blocking mode ( in theory anyway) I have got the theory right, havent I??

Thanks

 
They won't necessarily be blocking even if connected to another switch. They still may have gone through the election and be the path back to the root, and will then need to be forwarded.

I would suggest mapping out the topology first, make certain those ports are neighboring switches. As long as everything is Cisco and you haven't disabled it, "show cdp neighbor" is your friend, and should tell you what port has a Cisco device on it.

Sometimes it's hard to understand the theory from a live network without seeing the whole picture first to start to apply it to.

Don't worry about the portfast stuff. If you haven't read about it yet, all it does is tells an interface to not participate in the spanning-tree states, and go immediately to forwarding. With the older STP version, it can take 45seconds to go through the steps, and that is more than enough time for DHCP to time out and a workstation would not pull an IP address.

Sadly, I can't find a production switch that is not running rapid spanning-tree, so I can't give a better example....yet.
 
One tip...when I was going through my CCNA/NP studies, it really helped me to grab 3 switches out of our spares, to setup in a lab. Turn on some debugs for spanning-tree and watch what happens as a port comes up.

PLUS...you can change stuff and not screw up a production network.

The other nice thing is that you can draw it out first, get the necessary information off the switches, and try and figure out who is going to get elected as root. Then go look and see if you are correct.

Would suggest if you do setup a lab, enable whatever console program you are using to write output from the screen to a log file. Sometimes that's easier to go back through.

 
Thanks again, I have a lab at home that Im gng to test on with 2 * 2950's. I was just written and pulled the output on a production network at work and just wanted to put it pass someone on this forum. I think that I will take your advise and map the network and actually see what device the port connect to.

Thanks
 
I'll take a stab at explaining.. maybe it will help. In addition to what lerdalt said....if you have say 3 switches




Rootswitch connected to SwitchA.
SwitchA connected to SwitchB
SwitchB connected back to Rootswitch.

So you have a redundant network. With all Default settings and 100mb ports....

Rootswitch will put all ports (access included) into fwd state.

SwitchA puts its link to the rootswitch in fwd state as its Designated port. (as well as all ports to hosts).

SwitchB puts its link to the rootswitch in fwd state as its Designated port. (as well as all ports to hosts).

The link from A and B will be in a Fwd state on one side (SwitchA) and a block state on the other side (switchB). They both advertise a cost of 19 on the link to one another. (as the cost to reach root) because of a tie the switch with the lowest priority/systemID (switchA) in this case places its port to SwitchB in a fwd state and SwitchB places its port to SwitchA into block state. So 3 switches and only 1 port is in block state.

**Remember all ports will advertise a BPDU on each segment. The switch port that advertises the lowest BPDU cost to reach rootswitch on that segment will become a designated port and settle to a fwd state.
***Switch ports connected to hosts will settle to a Fwd state(designated port) because the switch is the only thing advertising BPDU's on the segment.
 
Maybe a little overkill, but I just went thru this for my BMSCN prep (heavy on STP topic). What worked for me was:
(1) draw out a paper net of 3 switches in a full-mesh network (triangle config). Work out the process, from Root Bridge Election, to selecting Root Ports on each node, then selection of Designated Ports on each link. Redraw your final config.
---To make sure you understand this, X-out one of your links, and understand how the network would re-converge. Then cure the link, and understand how it would come back.

(2) Re-start with 4 switches in a full mesh. Do the same thing.

(3) Cement your knowledge with a 6-plus node config. I used a network I was comfortable with: SF-LA-Denver-Dallas-StLouis-Chic-ATL-Orlando-DC-NY-Boston -- but that's just me.

The process takes a few hours, but you'll understand it firmly, as opposed to the 3-node "toys" that all the review guides show. AND -- trying to debug the packets is usually too fast and verbose to really gain anything by it in terms of initial learning.
 
Trick for the debugging then is use a terminal emulation program that has logging to a file built in. That way you can pump all the output to a text file and review it later.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top