Spanning-tree cost

Answered Question
Jun 16th, 2009

I'm practicing spanning-tree with two 2950 switches (Ver 12.1). I have 3 trunks and 3 vlans. I try to change the cost of the interface (for the 3 vlans) and only 2 vlans change the value after I apply the command. The command is "spanning-tree cost 1" in interface mode. Is there any explanation as why only two of the vlans change the cost? I hope to be clear on the scenario.

I have this problem too.
0 votes
Correct Answer by thotsaphon about 7 years 7 months ago

Francisco,

That's what I'm talking about.

interface FastEthernet0/7

spanning-tree vlan 3 port-priority 128

spanning-tree vlan 3 cost 19

spanning-tree cost 1

!

Obvoiusly, F0/7 has cost 19 for vlan 3 (grin). That's why it was in BLK state. When you configure port cost for a particular vlan it will override what you configured for all vlans.

spanning-tree vlan 3 port-priority 128 This doesn't help you to adjust things for downstream switch. (grin)

I know that you're familiar with SPT now. Have fun mate!!!

Toshi

Correct Answer by Giuseppe Larosa about 7 years 7 months ago

Hello Toshi, Francisco,

we can see that fas0/7 is the root port for vlan 1,2 but not for vlan 3.

the change in port cost has effects on path cost for vlan 1 and 2 but not for vlan3 that uses f0/5 as its root port with default cost 19.

We can guess that fas0/5 may be an access port in vlan3 and it has been selected as the root port for its lower port id 128.5 to be compared to 128.7 for fas0/7.

root bridge id is :

32770:0005.dccb.0580 for vlan2

32771:0005.dccb.0580 for vlan3

this clearly indicates the root bridge is the same device (the other switch).

probably fas0/7 doesn't carry vlan3 and it is a trunk but if so it shouldn't appear in sh spanning-tree vlan 3 output

you can post config and also sh ver of switches.

Hope to help

Giuseppe

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
thotsaphon Tue, 06/16/2009 - 10:06

Francisco,

You have to make sure that the root switch is acting as a root of all vlans in your case. When you configure a "spanning-tree cost" command on the switch. That will affect on the local switch. Properly be on the downstream switch to adjust cost to root.

HTH,

Toshi

Giuseppe Larosa Tue, 06/16/2009 - 11:38

Hello Francisco,

as Toshi has explained STP calculstes the cost to the root bridge but it does it by adding the local port cost that receives the BPDU to the path cost in the BPDU.

A switch advertises out its ports not in STP blocking state a BPDU modified in the following manner:

the sender bridge id is that of the local switch

the port id is that of the outgoing port

the total cost to reach the root bridge is:

cost received on root port + cost of root port

notice that only port-id changes from port to port.

This is different from what happens with routing protocols where the cost is added on the outgoing interface.

So as Toshi notes if one device is the root bridge for one vlan the cost (actually 0) doesn't change if you change the cost of one of its ports.

Hope to help

Giuseppe

fjcardenas-1 Wed, 06/17/2009 - 05:52

I am attaching my "show spanning-tree" command after I applied the following:

config t

int fa 0/7

spanning-tree cost 1

As you can see only vlan3 didn't change the port cost to 1....... why only vlan 3 if I applied the general command for all vlans to change cost to 1?

Attachment: 
thotsaphon Wed, 06/17/2009 - 06:09

Francisco,

It's kinda weird. Please post a "sh interface trunk" command on both switches. I want to make sure that they are forwarding vlan3. However,it's a good idea to post configuration as well.

HTH,

Toshi

fjcardenas-1 Wed, 06/17/2009 - 09:57

Hey Toshi, I just found out by looking at my running-config that port fa 0/7 had the following:

interface FastEthernet0/7

spanning-tree vlan 3 port-priority 128

spanning-tree vlan 3 cost 19

spanning-tree cost 1

!

I thought that setting cots 1 to all vlans in fa 0/7 would override the previous value configured for vlan 3 in that port. I guess it doesn't work that way and you have to erase whatever port cost previously configured..... is that how it works?

I erased line "spanning-tree vlan 3 cost 19" and now vlan 3 porf fa 0/7 has cost 1 and is forwarding.

Thanks.

Correct Answer
thotsaphon Wed, 06/17/2009 - 10:58

Francisco,

That's what I'm talking about.

interface FastEthernet0/7

spanning-tree vlan 3 port-priority 128

spanning-tree vlan 3 cost 19

spanning-tree cost 1

!

Obvoiusly, F0/7 has cost 19 for vlan 3 (grin). That's why it was in BLK state. When you configure port cost for a particular vlan it will override what you configured for all vlans.

spanning-tree vlan 3 port-priority 128 This doesn't help you to adjust things for downstream switch. (grin)

I know that you're familiar with SPT now. Have fun mate!!!

Toshi

Correct Answer
Giuseppe Larosa Wed, 06/17/2009 - 09:59

Hello Toshi, Francisco,

we can see that fas0/7 is the root port for vlan 1,2 but not for vlan 3.

the change in port cost has effects on path cost for vlan 1 and 2 but not for vlan3 that uses f0/5 as its root port with default cost 19.

We can guess that fas0/5 may be an access port in vlan3 and it has been selected as the root port for its lower port id 128.5 to be compared to 128.7 for fas0/7.

root bridge id is :

32770:0005.dccb.0580 for vlan2

32771:0005.dccb.0580 for vlan3

this clearly indicates the root bridge is the same device (the other switch).

probably fas0/7 doesn't carry vlan3 and it is a trunk but if so it shouldn't appear in sh spanning-tree vlan 3 output

you can post config and also sh ver of switches.

Hope to help

Giuseppe

Actions

This Discussion