Re: STP and Preferences

From: Ivan Kuchin (ivan@iip.net)
Date: Tue Apr 04 2006 - 05:08:44 GMT-3


cost calculate "cost of path". Cost increment at incoming interface and it
depends of link bandwidth. On root switch path length is always zero, because
root switch is originatorh path. Therefore cost is useless on root switch.
I find some experiment Henk de Tomb. May be it help.

-------------------------------------------
Link to configuring port-priority:
http://www.cisco.com/univercd/cc/td/doc/product/lan/c3550/12225sec/3550scg/s
wstp.htm#wp1020470

Link to configuring cost:
http://www.cisco.com/univercd/cc/td/doc/product/lan/c3550/12225sec/3550scg/s
wstp.htm#wp1105354

The cost and port-priority both have the same goal, make one link more
attractive than the other(s). The thing you have to watch out for is where
you use these commands.

The cost command is used on NON ROOT bridges. If all interfaces have the
same cost value, spanning tree puts the interface with the lowest interface
number in the forwarding state and blocks the other interfaces.

Look at the show commands below, port gi1/0/13 is in forwarding state. This
switch is a secondary root switch because it has some ports in blocking
state.

Rack1SW2(config)#do sh span vl 3

VLAN0003
  Spanning tree enabled protocol ieee
  Root ID Priority 32771
             Address 000d.295f.6380
             Cost 4
             Port 13 (GigabitEthernet1/0/13)
             Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge ID Priority 32771 (priority 32768 sys-id-ext 3)
             Address 000d.edbc.5480
             Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
             Aging Time 15

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- --------
--------------------------------
Gi1/0/13 Root FWD 4 128.13 P2p
Gi1/0/14 Altn BLK 4 128.14 P2p
Gi1/0/15 Altn BLK 4 128.15 P2p

To make e.g. port Gi1/0/15 forwarding frames for this VLAN, we have to
change the port cost.

Rack1SW2(config)#int gig 1/0/15
Rack1SW2(config-if)#spanning-tree vlan 3 cost 3
Rack1SW2(config-if)#
Rack1SW2(config-if)#do sh span vl 3

VLAN0003
  Spanning tree enabled protocol ieee
  Root ID Priority 32771
             Address 000d.295f.6380
             Cost 3
             Port 15 (GigabitEthernet1/0/15)
             Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge ID Priority 32771 (priority 32768 sys-id-ext 3)
             Address 000d.edbc.5480
             Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
             Aging Time 15

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- --------
--------------------------------
Gi1/0/13 Altn BLK 4 128.13 P2p
Gi1/0/14 Altn BLK 4 128.14 P2p
Gi1/0/15 Root FWD 3 128.15 P2p

You can see that port Gi1/0/15 is in forwarding state right now, and ports
1/0/13 and 1/0/14 are in Alternate state. Changing the port-priority command
at a NON ROOT switch doesn't have any effect because the port-priority value
is advertised in BPDU packets. Since Rack1SW2 is a NON ROOT switch it
doesn't send BPDU packets, the switch only receives them.

Let's take a look at the port-priority command. Below is a show span vlan 3
output at the ROOT switch. You can see that all ports are in forwarding
state, this is expected behaviour for a root switch. I've changed the
port-priority on port 1/0/15 from 128 to 96.

Rack1SW1(config-if)#do sh span vl 3

VLAN0003
  Spanning tree enabled protocol ieee
  Root ID Priority 32771
             Address 000d.295f.6380
             This bridge is the root
             Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge ID Priority 32771 (priority 32768 sys-id-ext 3)
             Address 000d.295f.6380
             Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
             Aging Time 15

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- --------
--------------------------------
Gi1/0/3 Desg FWD 19 128.3 P2p
Gi1/0/13 Desg FWD 4 128.13 P2p
Gi1/0/14 Desg FWD 4 128.14 P2p
Gi1/0/15 Desg FWD 4 96.15 P2p

A "show span vlan 3" on the secondary root switch shows the following
output.

Rack1SW2(config-if)#do sh span vl 3

VLAN0003
  Spanning tree enabled protocol ieee
  Root ID Priority 32771
             Address 000d.295f.6380
             Cost 4
             Port 15 (GigabitEthernet1/0/15)
             Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

  Bridge ID Priority 32771 (priority 32768 sys-id-ext 3)
             Address 000d.edbc.5480
             Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
             Aging Time 300

Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- --------
--------------------------------
Gi1/0/13 Altn BLK 4 128.13 P2p
Gi1/0/14 Altn BLK 4 128.14 P2p
Gi1/0/15 Root FWD 4 128.15 P2p

Port 1/0/15 is in forwarding state, because the ROOT switch "advertised" a
lower port-priority values for port 1/0/15 than port 13 & 14.

There is one more option to consider when we are talking about changing port
and priority values o
-------------------------------------------

> I am not quite sure why changing the port cost would NOT have any affect on
> the selection if done on the root bridge..Can you elaborate on this just a
> bit?
>
> Thanks,
>
> wayne
>
> -----Original Message-----
> From: Arun Arumuganainar [mailto:aarumuga@hotmail.com]
> Sent: Tuesday, April 04, 2006 12:55 AM
> To: Marius Venter; 'CCIE KH49279'; ccielab@groupstudy.com
> Subject: Re: STP and Preferences
>
> Hi Wayne ,
>
> Some additional notes !!! From the point of view of Exam !!!
>
> Pls. see my reply inline
>
> Thanks and Regards
> Arun
>
> -----Original Message-----
>
> > From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf
> > Of
>
> CCIE
>
> > KH49279
> > Sent: Tuesday, April 04, 2006 5:58 AM
> > To: ccielab@groupstudy.com
> > Subject: STP and Preferences
> >
> > Group,
> >
> > I just want to make sure I am understanding something. I am sure I do,
> > but the warm fuzzy is necessary right now.
> >
> > For STP on a 3550.
> >
> >
> > Root Bridge
> >
> > If I have a two trunk links between sw1 and sw2 and I want a
> > particular bridge (in this case sw1) to be root
> > 1) I could use the 'spanning-tree vlan x,y,z root primary command to
> > make the bridge root bridge for the vlans x,y,z.
> > 2)I can also use the 'spanning-tree vlan x,y,z priority n' global
> > command
>
> to
>
> > assign a value to influence the natural election process for the root
> > bridge.
>
> [arun]
>
> Use the first one if you are not sure of what is the priority configured on
> the other switches and you are not bothered to find priority of other
> switches .
>
> Use the second one if you clearly know the priority configured on all the
> other switches or will to find out their priorities .
>
> Note : From the exam point of view both are same and valid , unless and
> untill you specifically asked not use the priority command !!!
> [arun]
>
> > Port Preference
> >
> > I will assume that I have three ways to make a particular port
> > prefered
>
> over
>
> > another.
> > 1) interface command spanning-tree port-priority n to influence the
>
> natural
>
> > selection
> > 2) interface command spanning-tree cost n to influence the natural
>
> selection
>
> > 3) allow the tie-breaker to occur being lowest mac address for the
> > interface.
>
> [arun]
>
> If you want make a port blocking or root port you can follow the above
> techniques . In doing so we can keep the following rules in mind ...
>
> 1) If you are changing the port priority change it on Root Bridge . If you
> do it on non-root bridge you will not achive any thing from it .
>
> Note : Default port priority is 128. Lower prioriy will be preferred .
>
> 2) If you are changing port cost that do it on non-root bridge .If you do
> it on root bridge you will not achive any thing from it .
>
> Note : Default depends on Bandwidth ( For fast ethernet it is 19 )... Lower
> cost will be prefered .
>
> 3) I am not sure Mac address could influence the blocking port-rootport
> selection .
>
> 4) If the question says do not modify priority or cost ...than think of
> changing the Bandwidth ( using the command "bandwidth <bw> " ) on the
> non-root bridge . This will have in-direct effect on cost thus can control
> the root-port & blocking port selection .
>
> [arun]
>
> > TIA,
> >
> > Wayne
> >
> >
> > Dream as if you'll live forever. Live as if you'll die today. - James
> > Dean
> >
> > ______________________________________________________________________
> > _ Subscription information may be found at:
> > http://www.groupstudy.com/list/CCIELab.html
> >
> > ______________________________________________________________________
> > _ Subscription information may be found at:
> > http://www.groupstudy.com/list/CCIELab.html
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html

-- 
iWAN kU^IN (mail to: ivan@iip.net)
NOC iip.net 
137-31-04


This archive was generated by hypermail 2.1.4 : Mon May 01 2006 - 11:41:56 GMT-3