evaluating the root ID field in the BPDUs that it
receives. The unique BID is carried in the Root ID field of the
BPDUs sent by each switch in the tree. When a switch first
boots and begins sending BPDUs, it has no knowledge of a root
ID, so it populates the Root ID field of outbound BPDUs with
its own BID. The switch with the lowest numerical BID assumes
the role of root bridge for that spanning tree instance. If a
switch receives BPDUs with a lower BID than its own, it places
the lowest value into the Root ID field of its outbound BPDUs.
Spanning tree operation requires that each switch have a unique
BID. In the original 802.1D standard, the BID was composed of
the Priority Field and the MAC address of the switch, and all
VLANs were represented by a CST. Because PVST requires that a
separate instance of spanning tree run for each VLAN, the BID
field is required to carry VLAN ID (VID) information, which is
accomplished by reusing a portion of the Priority field as the
extended system ID. To accommodate the extended system ID, the
original 802.1D 16-bit Bridge Priority field is split into two
fields, resulting in these components in the BID :
- Bridge Priority: A 4-bit field that carries the
bridge priority. Because of the limited bit count, priority is
conveyed in discrete values in increments of 4096 rather than
discrete values in increments of 1, as they would be in a full
16-bit field. The default priority, in accordance with IEEE
802.1D, is 32,768, which is the mid-range value.
- Extended System ID: A 12-bit field that carries the
VID for PVST.
- MAC address: A 6-byte field with
the MAC address of a single switch.
By virtue of
the MAC address, a BID is always unique. When the priority and
extended system ID are appended to the switch MAC address, each
VLAN on the switch can be represented by a unique BID. If no
priority has been configured, every switch has the same default
priority and the election of the root for each VLAN is based on
the MAC address. This is a fairly random means of selecting the
ideal root bridge and, for this reason, it is advisable to
assign a lower priority to the switch that should serve as root
bridge. Only four bits are used to set the bridge priority.
Because of the limited bit count, priority is configurable only
in increments of 4096. A switch responds with the possible
priority values if an incorrect value is entered:
Switch(config)#spanning-tree vlan 1 priority 1234
%
Bridge Priority must be in increments of 4096.
% Allowed
values are:
0 4096 8192 12288 16384 20480 24576 28672
32768 36864 40960 45056 49152 53248 57344 61440 If no priority
has been configured, every switch will have the same default
priority of 32768. Assuming all other switches are at default
priority, the spanning-tree vlan vlan-id root
primary command sets a value of 24576. Also, assuming all
other switches are at default priority, the
spanning-tree vlan vlan-id root
secondary command sets a value of 28672. The switch with
the lowest BID becomes the root bridge for a VLAN. Specific
configuration commands are used to determine which switch will
become the root bridge. A Cisco Catalyst switch running PVST
maintains an instance of spanning tree for each active VLAN
that is configured on the switch. A unique BID is associated
with each instance. For each VLAN, the switch with the lowest
BID becomes the root bridge for that VLAN. Whenever the bridge
priority changes, the BID also changes. This results in the
recomputation of the root bridge for the VLAN. To configure a
switch to become the root bridge for a specified VLAN, use the
spanning-tree vlan vlan-ID root
primary command. CAUTION: Spanning tree
commands take effect immediately, so network traffic is
disrupted while the reconfiguration occurs. A secondary root is
a switch that may become the root bridge for a VLAN if the
primary root bridge fails. To configure a switch as the
secondary root bridge for the VLAN, use the command
spanning-tree vlan vlan-ID root secondary.
Assuming that the other bridges in the VLAN retain their
default STP priority, this switch will become the root bridge
in the event that the primary root bridge fails. This command
can be executed on more than one switch to configure multiple
backup root bridges. BPDUs are exchanged between switches, and
the analysis of the BID and root ID information from those
BPDUs determines which bridge is selected as the root bridge.
and In the example shown, both switches have the same priority
for the same VLAN. The switch with the lowest MAC address is
elected as the root bridge. In the example, switch X is the
root bridge for VLAN 1, with a BID of 0x8001:0c0011111111.
Content 3.1 Describing STP 3.1.6
Describing Port Roles On a nonroot bridge, the spanning
tree determines each port’s role in the topology and the most
desirable forwarding path for data frames as the switch
receives BPDUs on the ports. There are four 802.1D port roles.
and . Each Layer 2 port on a switch running STP exists in one
of these five port states : - Blocking: The Layer 2 port
is a nondesignated port and does not participate in frame
forwarding. The port receives BPDUs to determine the location
and root ID of the root switch and which port roles (root,
designated, or nondesignated) each switch port should assume in
the final active STP topology. By default, the port spends 20
seconds in this state (max age).
- Listening: Spanning
tree has determined that the port can participate in frame
forwarding according to the BPDUs that the switch has
received. At this point, the switch port is receiving BPDUs and
also transmitting its own BPDUs and informing adjacent switches
that the switch port is preparing to participate in the active
topology. By default, the port spends 15 seconds in this state
(forward delay).
- Learning: The Layer 2 port prepares
to participate in frame forwarding and begins to populate the
CAM table. The port is still sending and receiving BPDUs. By
default, the port spends 15 seconds in this state (forward
delay).
- Forwarding: The Layer 2 port is considered
part of the active topology. It forwards frames and also sends
and receives BPDUs.
- Disabled: This is not really an
STP state; rather it is the state resulting from
administratively shutting down a switch port. In this state,
the Layer 2 port does not participate in spanning tree and does
not forward frames.
STP uses timers to determine how
long to transition ports. STP also uses timers to determine the
health of neighbor bridges and how long to cache MAC addresses
in the bridge table. The timers operate as follows:
- Hello timer: Determines how often root bridge sends
configuration BPDUs. The default is 2 seconds.
- Maximum Age (Max Age): Tells the bridge how long to
keep ports in the blocking state before listening. The default
is 20 seconds.
- Forward Delay (Fwd Delay):
Determines how long to stay in the listening state before going
to the learning state, and how long to stay in the learning
state before forwarding. The default is 15 seconds.
The root bridge informs the nonroot bridges of the time
intervals to use and the STP timers can be tuned based on
network size. The default parameters give STP ample opportunity
to ensure a loop-free topology. Mistuning the parameters can
cause serious network instability. Nonroot bridges place
various ports in their proper roles by listening to BPDUs as
they come in on all ports. Receiving BPDUs on multiple ports
indicates a redundant path to the root bridge. The switch looks
at the following components in the BPDU to determine which
switch ports forward data and which block data :
- Lowest path cost
- Lowest sender BID
- Lowest sender port ID
The switch looks at the
path cost first, which is calculated on the basis of the link
speed and the number of links the BPDU has traversed. Ports