Tuning the Port ID
The fourth criteria of an STP decision is the port ID. The port ID value that a switch uses is actually a 16-bit quantity: 8 bits for the port priority and 8 bits for the port number. The port priority is a value from 0 to 255 and defaults to 128 for all ports. The port number can range from 0 to 255 and represents the port's actual physical mapping. Port numbers begin with 1 at port 0/1 and increment across each module. (The numbers might not be consecutive because each module is assigned a particular range of numbers.)
TIP Port numbers are usually intuitive on a fixed configuration switch, such as a 48-port Catalyst 3560. The STP port number is simply the interface number, from 1 to 48. However, it is not easy to find the STP port number in a switch with many modules and many ports. Notice how GigabitEthernet 3/16 is also known as port number 144 in the following example:
Switch# show spanning-tree interface gigabitEthernet 3/16
Vlan Role Sts Cost Prio.Nbr Type
VLAN0010 Desg FWD 4 128.144 Edge P2p
VLAN0100 Desg FWD 4 128.144 Edge P2p
VLAN0200 Desg FWD 4 128.144 Edge P2p
Switch#
The entire port ID consists of the port priority followed by the port number. In the preceding example output, the port ID is 128.144. As a 16-bit quantity in hex, it is 8090. In addition, ports that are bundled into an EtherChannel or Port-channel interface always have a higher port ID than they would if they were not bundled.
Obviously, a switch port's port number is fixed because it is based only on its hardware location or index. The port ID, however, can be modified to influence an STP decision by using the port priority. You can configure the port priority with this interface-configuration command:
Switch(config-if)# spanning-tree [vlan vlan-list] port-priority port-priority You can modify the port priority for one or more VLANs by using the vlan parameter. The VLAN numbers are given as vlan-list, a list of single values or ranges of values separated by commas. Otherwise, the port priority is set for the port as a whole (all active VLANs). The value of port-priority can range from 0 to 255 and defaults to 128. A lower port priority value indicates a more preferred path toward the Root Bridge.
As an example, you can use the following command sequence to change the port priority of GigabitEthernet 3/16 from 128 (the default) to 64 for VLANs 10 and 100:
Switch(config)# interface gigabitethernet 3/16 Switch(config-if)# spanning-tree vlan 10,100 port-priority 64
You can confirm the changes with the show spanning-tree interface command, as demonstrated in Example 9-5.
Example 9-5 Confirming STP Port Priority Values After Configuration
|
Switch# Vlan |
show spanning-tree interface gigabitEthernet 3/16 Role Sts Cost Prio.Nbr Type |
|
|
VLAN0010 |
Desg FWD 4 |
64.144 Edge P2p |
|
VLAN0100 |
Desg FWD 4 |
64.144 Edge P2p |
|
VLAN0200 |
Desg FWD 4 |
128.144 Edge P2p |
|
Switch# |
||
Continue reading here: Tuning Spanning Tree Convergence
Was this article helpful?
Readers' Questions
-
Saare1 year ago
- Reply