Vous êtes sur la page 1sur 19

73

Chapter 8

Spanning Tree Protocol


This chapter describes redundant topologies and how important they are for maintaining
networks. In addition, this chapter describes the functionality of both the Spanning Tree
Protocol (STP) and Rapid Spanning Tree Protocol (RSTP).
Having redundancy in a network is important. Redundancy allows networks to be fault-
tolerant. Redundant topologies protect against network downtime due to the failure of a
single link, port, or networking device. Redundant topologies based on switches and
bridges are susceptible to broadcast storms, multiple-frame transmissions, and media
access control database instability.
The Spanning Tree Protocol is a Layer 2 link-management protocol used to maintain a
loop-free network. STP was developed by the Digital Equipment Corporation (DEC). The
DEC spanning-tree algorithm was subsequently revised by the IEEE 802 committee and
published in the IEEE 802.1d specification. The DEC and the IEEE 802.1d algorithm are
not the same, nor are they compatible. The Cisco switches, such as the Catalyst 1900 and
the 2950, use the IEEE 802.1d STP.
The Spanning Tree Protocol defined in the IEEE 802.1d standard has been found to be
too slow in converging on a new topology for today’s networks. A new standard, IEEE
802.1w, the Rapid Spanning Tree Protocol, has been defined to overcome known
limitations.

Concept Questions
Demonstrate your knowledge of these concepts by answering the following questions in
the space provided.
1. Describe the goals of redundant topologies.

The goal of redundant topologies is to eliminate network outages caused by a single point of
failure. All networks need redundancy for enhanced reliability. The network of roads is a
redundant topology. If one road is closed for repair there is another way to the destination
Consider a small suburb separated by a river from the town center. If there is only one bridge
across the river there is only one way into town. The topology has no redundancy. If the bridge is
flooded or damaged by an accident, travel to town across the bridge is impossible. Building a
second bridge across the river creates a redundant topology. The town is not cut off from the town
center if one bridge is impassable.

2. Define the role that Spanning Tree Protocol plays in switched networks.

The purpose of STP is to maintain a loop-free network topology. A loop-free topology is


accomplished when the switch or bridge recognizes a loop in the topology and logically blocks one
or more redundant ports automatically.
The Spanning Tree Protocol continually probes the network so that a failure or addition of a link,
switch, or bridge, is responded to. An example is shown in Figure 8-6. When the network topology
74

changes, the switches and bridges running STP automatically reconfigure their ports to avoid loss
of connectivity or creation of loops.
Physical layer loops can cause serious problems in switch based internetworks. Broadcast storms,
multiple frame transmissions and media access control database instability can make such
networks unusable.
The Spanning Tree Protocol is used in switched networks to create a loop free logical topology
from a physical topology that has loops. Links, ports, and switches that are not part of the active
loop free topology do not participate in the forwarding of data frames.

3. Describe the stages of selecting a root bridge.

With the Spanning Tree Protocol, the root bridge is the bridge with the lowest bridge ID (BID).
The BID includes the priority and MAC address of the bridge.
Switches and bridges running the spanning-tree algorithm exchange configuration messages with
other switches and bridges at regular intervals (every two seconds by default) using a multicast
frame called the bridge protocol data unit (BPDU). One of the pieces of information included in the
BPDU is the bridge ID.
Spanning tree calls for each bridge to be assigned a unique identifier (bridge ID). Typically, the
bridge ID is made up of a priority value (two bytes) and the bridge MAC address (six bytes). The
default priority, in accordance with IEEE 802.1d, is 32,768 (1000 0000 0000 0000 in binary, or
0x8000 in hex), which is the midrange value. The root bridge is the bridge with the lowest bridge
ID.
When a switch first starts up, it assumes it is the root switch and sends “inferior” BPDUs. These
contain the switch MAC address in both the root and sender BID. All switches see the BIDs sent.
As a switch receives a BPDU with a lower root BID it replaces that in the BPDUs it sends out. All
bridges see these and decide that the bridge with the smallest BID value will be the root bridge.
An administrator can influence the decision by setting the switch priority to a smaller value than
the default. This makes the bridge ID smaller.
A network administrator may want to influence the outcome of an election for the root bridge. This
is often the case when the traffic flow in the network is well understood.

4. Describe Rapid Spanning Tree Protocol.

Rapid Spanning Tree Protocol (RSTP) is designed to significantly speed the recalculation of the
spanning tree when the network topology changes. RSTP defines the additional port roles of
alternate and backup, and defines port states as discarding, learning, or forwarding.
RSTP (IEEE 802.1w) significantly reduces the time to reconverge the active topology of the
network when changes to the physical topology or its configuration parameters occur. RSTP
selects one switch as the root of a spanning-tree-connected active topology and assigns port roles to
individual ports on the switch, depending on whether the ports are part of the active topology.
RSTP provides rapid connectivity following the failure of a switch, switch port, or a LAN. A new
root port and the designated port on the other side of the bridge transition to forwarding through an
explicit handshake between them. RSTP allows switch port configuration so the ports can
transition to forwarding directly when the switch reinitializes. RSTP, specified in IEEE 802.1w,
supersedes STP specified in 802.1d, while remaining compatible with STP.
75

Vocabulary Exercise
Define the following terms as completely as you can. Use the online curriculum or Chapter
8 of the Cisco Networking Academy Program CCNA 3 and 4 Companion Guide for help.

Address Resolution Protocol (ARP) - Internet protocol used to map an IP address to a MAC
address.

Bridge Protocol Data Unit (BPDU) - Spanning Tree Protocol hello packet that is sent out at
configurable intervals to exchange information among bridges in the network.

Media Access Control (MAC) - Lower of the two sublayers of the data link layer defined by the
IEEE. The MAC sublayer handles access to shared media, such as whether token passing or
contention will be used.

Media Access Control (TTL) - Time to Live, a field in the IP header that specifies how many
more hops a packet can travel before being discarded or returned

Broadcast domain - The set of all devices that will receive broadcast frames originating from any
device within the set. Broadcast domains are typically bounded by routers because routers do not
forward broadcast frames. See also broadcast.

Collision domain - In Ethernet, the network area within which frames that have collided are
propagated. Repeaters and hubs propagate collisions; LAN switches, bridges, and routers do not.

Cost - An arbitrary value, typically based on hop count, media bandwidth, or other measures, that
is assigned by a network administrator and used to compare various paths through an internetwork
environment. Cost values are used by routing protocols to determine the most favorable path to a
particular destination: the lower the cost, the better the path.

Metric - A standard of measurement (for example, path length) that is used by routing protocols to
determine the optimal path to a destination.

Packet - A logical grouping of information that includes a header containing control information
and (usually) user data. Packets are most often used to refer to network-layer units of data. The
terms datagram, frame, message, and segment are also used to describe logical information
groupings at various layers of the OSI reference model and in various technology circles.

Path determination - The decision of which path traffic should take through the network cloud.
Path determination occurs at the network layer of the OSI reference model.

Reference point - A specification that defines the connection between specific devices, depending
on their function in the end-to-end connection.

Source address - An address of a network device that is sending data.

Spanning tree - A loop-free subset of a Layer 2 (switched) network topology.

Spanning-tree algorithm - An algorithm used by the Spanning Tree Protocol to create a spanning
tree. Sometimes abbreviated as STA.
76

Spanning Tree Protocol - A bridge protocol that utilizes the spanning-tree algorithm, enabling a
learning bridge to dynamically work around loops in a network topology by creating a spanning
tree. Bridges exchange BPDU messages with other bridges to detect loops, and then remove the
loops by shutting down selected bridge interfaces. Refers to both the IEEE 802.1 Spanning Tree
Protocol standard and the earlier Digital Equipment Corporation Spanning Tree Protocol on which
it is based. The IEEE version supports bridge domains and allows the bridge to construct a loop-
free topology across an extended LAN. The IEEE version is generally preferred over the Digital
version.

Focus Questions

1. The Spanning Tree Protocol (____) is a ________ prevention protocol. It


is a technology that allows ________ to communicate with each other to discover
________ ________ in the network. The protocol then specifies an
________________ that bridges can use to create a loop-free logical topology.

2. Usually loops in networks are the result of a deliberate attempt to provide


___________.

3. Loops can be disastrous in a bridged network for two primary reasons:


________-____________ and bridge-table _______________.

4. Bridging loops are much more/less dangerous than routing loops because
Ethernet (unlike IP) does not have a ________ field.

5. A ________-____ (____) is a single 8-byte field that is composed of two


subfields. The low-order subfield consists of a 6-byte MAC address assigned to the
switch.
The high-order BID subfield is called the ________-________. This field is a 2-
byte (16-bit) value. This field can have values that range from _______ to
________. The default bridge priority is the midpoint value, ________.

6. The key point to remember concerning STP cost values is that


___________ costs are better.
77

7. In the following table, list the new STP path cost values for the bandwidth
numbers.

Bandwidth STP Cost


4 Mbps
10 Mbps
16 Mbps
45 Mbps
100 Mbps
155 Mbps
622 Mbps
1 Gbps
10 Gbps

8. Bridges pass spanning-tree information between themselves using special


frames known as ________ ________ ________ ________ (________s).

9. A bridge uses the four-step decision sequence to save a copy of the


________ BPDU seen on every port.

10. When a bridge first becomes active, all its ports send BPDUs every ______
seconds. However, if a port hears a BPDU from another bridge that is ________
__________ than the BPDU it has been sending, the local port stops sending
BPDUs.

11. The initial convergence of STP switches can be broken into three simple
steps:

1) _______ ________ ________ ________


2) ________ ________ ________________
3) ________ ________ ________ ________

12. BPDUs are ________-to-________ traffic; they do not carry ________-________


traffic.

13. STP costs are incremented as BPDUs are ________ on a port, not as they
are ________ _____ a port.
78

14. Fill in the path costs in the balloons in Figure 8-1.

Figure 8-1 List the Path Costs

15. Each segment in a bridged network has ________ designated port. This
port functions as the ________ ________ port that both sends and receives
________ to and from that segment and the root bridge.

16. The idea behind designated ports is that if only one port handles traffic for
each link, all the ________ have been broken. The bridge containing the
designated port for a given segment is referred to as the _______________
________ for that segment.

17. Describe the STP states listed in the following table.

State Purpose
Forwarding

Learning

Listening
79

Blocking

Disabled

18. In Figure 8-2, fill in the blank boxes with the switch’s STP state.

Figure 8-2 Identify the Switch STP State

19. In the following table, fill in the purpose of and default times for each timer
in the first column.

Timer Primary Purpose Default


Hello Time _____ seconds
Forward Delay _____ seconds
Max Age _____ seconds
20. The ________ ________ controls the time interval between the sending of
configuration BPDUs.

21. ______________ _________ is how long the bridge spends in the


_________ and ________ states. This is a single value that controls both states.
The default value of ___ seconds was originally derived assuming a maximum
network size of _________ bridge hops, a maximum of _________ lost BPDUs,
and a hello-time interval of ____ seconds.

22. ______ _____ is how long a bridge stores a BPDU before discarding it.
80

23. By default, STP is _________ for every port on the switch. If for some
reason STP has been disabled, you can reenable it on a set command-based switch
with the _________ _________ _________ command.

24. To enable STP on a Cisco IOS software command-based system, what


command do you enter in global configuration mode?
_______________________________________________________________

25. _________ _______________ output can be broken into four sections:

_________ statistics for the current switch/bridge (lines 2-4)


_________-_________ statistics (lines 5-9)
_________-_________ statistics (lines 10-12)
_________ statistics (lines 13-16)

26. The following describes some of the major methods of reconciling STP and
VLANs:

___________________________ (____) is the IEEE 802.1Q solution to VLANs


and spanning tree. CST defines a single instance of spanning tree for all VLANs.
BPDU information runs on VLAN 1.

_________ ________ __________ (_________) is a Cisco-proprietary


implementation. It requires __________ encapsulation to work. It runs a separate
instance of STP for every VLAN.

_________ is a Cisco-proprietary implementation that allows CST information to


be passed correctly into PVST. A solution to the scaling and stability problems
associated with large spanning-tree networks is to create separate instances of
PVST.

27. Scaling STP involves the following tasks:

Providing for an optimal topology through the proper ____________ of the root
bridge

Providing for efficient workstation access through the use of the _________
command

Load balancing on redundant links through the use of technologies such as


_________ and ___________ ________________

Improving the convergence time of spanning tree during a network reconfiguration


through the use of __________________ and __________________.

28. The switch software can be used to configure STP operational parameters
in a network. On a set command-based switch, use the _________ __________
81

________ command to set the primary root for specific VLANs or for all the
switch’s VLANs.
82

29. To configure the STP root switch on a Cisco IOS command-based switch,
enter the following command in _________ configuration mode:
_________________________________________________________________
_____

30. Use the _________ __________________ command in privileged mode


on a set command-based switch to verify the operation and state of each port and
VLAN.

Use _________ _________________ in an IOS switch.

31. After the root bridge has been elected, all switches determine the best loop-
free path to the root. STP uses several different costs in determining the best path
to the root bridge: __________ ________, _________ _____, and _________
_________.

32. Another mechanism for redundant links in a spanning-tree environment is


_________ __________________ technology. This technology allows spanning
tree to treat _________ links as one _________ link.
In addition to providing high bandwidth, it also provides _________ _________
and __________________.

33. Fast EtherChannel and Gigabit EtherChannel use a load distribution


_________________ based on the destination _________ address.

34. A _________ is a group of links managed by the Fast EtherChannel


process. Fast EtherChannel technology provides statistical _________ _________
of connections over multiple links in a bundle.

35. _________-_________ time is the time it takes for the new address to be
relearned. Assuming that one packet sent by the source results in an instant
response, failover takes place as quickly as ______ __________________.

36. The _________ _________ _________ (_________) adds additional


features to Fast EtherChannel technology. It aids in the automatic creation of Fast
EtherChannel links.

37. When using Fast EtherChannel, configure all ports in a channel to operate
at the same _________ and _________ _________ (full or half duplex).

38. __________________ is a feature that is designed primarily to optimize


switch ports that are connected to end-station devices.
By using PortFast, these devices can be granted instant access to the Layer 2
network without going through the spanning tree ______________ and
_______________ stages.

39. __________________ allows a blocked port on a switch to almost


immediately begin forwarding when the switch detects the failure of the
83

forwarding link. __________________ must have direct knowledge of the link


failure to move a blocked port into a forwarding state.

Focus Questions Answers

1. The Spanning Tree Protocol (STP) is a loop-prevention protocol. It is a technology that allows
bridges to communicate with each other to discover physical loops in the network. The protocol
then specifies an algorithm that bridges can use to create a loop-free logical topology.

2. Usually loops in networks are the result of a deliberate attempt to provide redundancy.

3. Loops can be absolutely disastrous in a bridged network for two primary reasons: broadcast loops
and bridge-table corruption.

4. Bridging loops are much more/less dangerous than routing loops because Ethernet, (unlike IP)
does not have a TTL field.

5. A bridge ID (BID) is a single, 8-byte field that is composed of two subfields. The low-order
subfield consists of a 6-byte MAC address assigned to the switch;
The high-order BID subfield is referred to as the bridge priority. This field is a 2-byte (16-bit)
value. This field can have values that range from 0 to 65,535. The default bridge priority is the
midpoint value, 32,768.

6. The key point to remember concerning STP cost values is that lower costs are better.

7. List the new STP path cost values for the bandwidth numbers on the left:
84

8. Bridges pass Spanning-Tree information between themselves using special frames known as
bridge protocol data units (BPDUs).

9. A bridge uses the four-step decision sequence to save a copy of the "best" BPDU seen on every
port.

10. When a bridge first becomes active, all of its ports are sending BPDUs every 2 seconds. However,
if a port hears a BPDU from another bridge that is more attractive than the BPDU it has been
sending, the local port stops sending BPDUs.

11. The initial convergence of STP switches can be broken down into three simple steps:

1) Elect one root bridge.

2) Elect root ports.

3) Elect designated ports.

12. BPDUs are switch-to-switch traffic; they do not carry end-user traffic.

13. STP costs are incremented as BPDUs are received on a port, not as they are sent out a port.

14. Fill in the path costs in the balloons in the graphic.

15. Each segment in a bridged network has one designated port. This port functions as the single
bridge port that both sends and receives traffic to and from that segment and the root bridge.

16. The idea behind designated ports is that if only one port handles traffic for each link, all the loops
have been broken. The bridge containing the designated port for a given segment is referred to as
the designated bridge for that segment.
85

17. Describe the STP states in the graphic.

18. Fill in the blank boxes with the switch’s STP state.
86

19. Fill in the purpose and default times for the timers on the left.

20. The "hello time" controls the time interval between the sending of configuration BPDUs.

21. "Forward Delay" is the time that the bridge spends in the listening and learning states. This is a
single value that controls both states. The default value of 15 seconds was originally derived
assuming a maximum network size of seven bridge hops, a maximum of three lost BPDUs, and a
hello-time interval of 2 seconds.

22. "Max age" is the time that a bridge stores a BPDU before discarding it.

23. By default, STP is enabled for every port on the switch. If for some reason STP has been disabled,
you can reenable it on a set command-based switch with the set spantree enable command.

24. To enable STP on a Cisco IOS command-based system, enter the following command in global
configuration mode.
Switch(config)#spantree vlan-list

25. show spantree output can be broken down into four sections as follows:

Global statistics for the current switch/bridge (lines 2-4)


Root-bridge statistics (lines 5-9)
Local-bridge statistics (lines 10-12)
Port statistics (lines 13-16)

26. Some of the major methods for reconciling STP and VLANs are listed as follows:

Common Spanning Tree (CST) is the IEEE 802.1Q solution to VLANs and Spanning Tree. CST
defines a single instance of Spanning Tree for all VLANs. BPDU information runs on VLAN 1.

Per-VLAN Spanning Tree (PVST) is a Cisco proprietary implementation. This requires ISL
encapsulation in order to work. It runs a separate instance of STP for every VLAN.

PVST+ is a Cisco proprietary implementation that allows CST information to be passed correctly
into PVST. A solution to the scaling and stability problems associated with large Spanning-Tree
networks is to create separate instances of PVST.
87

27. Scaling STP involves the following tasks:

Providing for an optimal topology through the proper placement of the root bridge

Providing for efficient workstation access through the use of the PortFast command

Load balancing on redundant links through the use of technologies such as PortVlanPri and Fast
EtherChannel® technology

Improving the convergence time of Spanning Tree during a network reconfiguration through the
use of UplinkFast and BackboneFast

28. The switch software can be used to configure STP operational parameters in a network. On a set
command-based switch, use the set spantree root command to set the primary root for specific
VLANs or for all VLANs of the switch.

29. To configure the STP root switch on a Cisco IOS command-based switch, enter the following
command in global configuration mode:
Switch(config)#spanning-tree [vlan stp-list] priority bridge-priority

30. Use the show spantree command in privileged mode on a set command-based switch to verify the
operation and state of each port and VLAN.

Use show spanning-tree in an IOS switch.

31. After the root bridge has been elected, all switches determine the best loop-free path to the root.
STP uses several different costs in determining the best path to the root bridge as follows: Path
cost, Bridge ID, and Port priority.

32. Another mechanism for redundant links in a Spanning-Tree environment is called Fast
EtherChannel technology. This technology allows parallel links to be treated by Spanning Tree as
one physical link.
,In addition to providing high bandwidth, also provides load sharing and redundancy.

33. Fast EtherChannel and Gigabit EtherChannel use a load distribution algorithm based on the
destination MAC address.

34. A bundle is a group of links managed by the Fast EtherChannel process. Fast EtherChannel
technology provides statistical load distribution of connections over multiple links in a bundle.

35. Fail-over time is the time it takes for the new address to be relearned. Assuming that one packet
sent by the source results in an instant response, fail-over takes place as quickly as 10
microseconds.
88

36. The Port Aggregation Protocol (PAgP) adds additional features to Fast EtherChannel technology.
It aids in the automatic creation of Fast EtherChannel links.

37. When using Fast EtherChannel, configure all ports in a channel to operate at the same speed and
duplex mode (full or half duplex).

38. PortFast is a feature that is primarily designed to optimize switch ports that are connected to end-
station devices.
By using PortFast, these devices can be granted instant access to the Layer 2 network without
going through the spanning tree listening and learning stages.

39. UplinkFast allows a blocked port on a switch to almost immediately begin forwarding when the
switch detects the failure of the forwarding link. UplinkFast must have direct knowledge of the
link failure in order to move a blocked port into a forwarding state
89

CCNA Exam Review Questions


The following questions help you review for the CCNA exam. The answers appear in
Appendix A, “Answers to CCNA Exam Review Questions.”
1. The goal of redundant topologies is to eliminate network outages caused
by how many points of failure?

A. One
B. Two
C. Three
D. Four
2. What is the purpose of the Spanning Tree Protocol?

A. To maintain single-loop paths


B. To maintain a loop-free network
C. To maintain a multiloop network
D. To maintain a reduced-loop network
3. When the network topology changes, what happens?

A. You must initiate a spanning-tree recalculation.


B. You must reconfigure the top node of the spanning tree.
C. You must reconfigure all devices participating in the spanning tree.
D. The Spanning Tree Protocol reconfigures switch or bridge ports automatically.
4. On the root bridge, all ports are what?

A. Root ports
B. Blocked ports
C. Designated ports
D. Nondesignated ports
5. How does the Spanning Tree Protocol select the root port on a nonroot bridge?

A. The root port is the highest-cost path from the nonroot bridge to the root bridge.
B. The root port is the lowest-cost path from the nonroot bridge to the root bridge.
C. The root port is the lowest-cost path from the nonroot bridge to the backup root
bridge.
D. The root port is the highest-cost path from the nonroot bridge to the backup root
bridge.
90

6. Which bridge does the Spanning Tree Protocol select as the root bridge?

A. The one with the lowest priority


B. The one with the lowest bridge ID
C. The one with the highest bridge ID
D. The one with the highest MAC address
7. What comprises the Spanning Tree Protocol bridge ID?

A. Bridge priority and bridge IP address


B. Bridge priority and bridge MAC address
C. Bridge MAC address and bridge IP address
D. Bridge MAC address and Ethernet port number
8. In what state can a port populate its MAC address table but not forward user
frames?

A. Learning state
B. Blocking state
C. Listening state
D. Forwarding state
9. In the revised IEEE specification, what is the cost of a 100-Mbps link?

A. 4
B. 10
C. 19
D. 100
10. What is the definition of convergence for the Spanning Tree Protocol?

A. All the ports have transitioned to the blocking state.


B. All the ports have transitioned to the forwarding state.
C. All the ports have transitioned to either the forwarding or listening state.
D. All the ports have transitioned to either the forwarding or blocking state.
11. What is the default max_age for the Spanning Tree Protocol?

A. 2 seconds
B. 15 seconds
C. 20 seconds
D. 30 seconds
91

12. What Rapid Spanning Tree Protocol state is equivalent to the Spanning
Tree Protocol blocking state?

A. Blocking
B. Dropping
C. Discarding
D. Forwarding
13. What port role specifies a forwarding port elected for every switched LAN
segment when using the Rapid Spanning Tree Protocol?

A. Root
B. Backup
C. Alternate
D. Designated
14. How does the STP provide a loop-free network?

A. By placing all ports in the blocking state


B. By placing all bridges in the blocking state
C. By placing some ports in the blocking state
D. By placing all bridges in the forwarding state

Vous aimerez peut-être aussi