Supported Platforms
Related Documentation
- EX Series
- Understanding STP for EX Series Switches
- Understanding MSTP for EX Series Switches
- Understanding VSTP for EX Series Switches
- Understanding Layer 2 Protocol Tunneling on EX Series Switches
- Example: Faster Convergence and Improved Network Stability with RSTP on EX Series Switches
- Example: Configuring Faster Convergence and Improved Network Stability with RSTP on EX Series Switches
Understanding RSTP for EX Series Switches
Ethernet networks are susceptible to broadcast storms if loops are introduced. However, an Ethernet network should always include loops because they provide redundant paths in case of a link failure. Spanning tree protocols address both of these issues because they provide link redundancy while simultaneously preventing undesirable loops. Rapid Spanning-Tree Protocol (RSTP) is the default spanning-tree protocol for preventing loops on Ethernet networks.
![]() | Note: If you are using Junos OS for EX Series switches with support for the Enhanced Layer 2 Software (ELS) configuration style, you can force the original IEEE 802.1D Spanning Tree Protocol (STP) version to run in place of RSTP or VSTP by setting force-version. |
This topic describes:
- Spanning-Tree Protocols Help Prevent Broadcast Storms
- RSTP is an Enhancement of the Original STP
- Port Roles Determine Participation in The Spanning-Tree
- Port States Determine How a Port Processes a Frame
- Edge Ports Connect to Devices That Cannot Be Part of a Spanning-Tree
- BPDUs Maintain the Spanning-Tree
- When an RSTP Root Bridge Fails
- Switches Must Relearn MAC Addresses After a Link Failure
- Selecting a Spanning-Tree Protocol
Spanning-Tree Protocols Help Prevent Broadcast Storms
Spanning tree protocols intelligently avoid loops in a network by creating a tree topology (spanning-tree) of the entire bridged network with only one available path between the tree root and a leaf. All other paths are forced into a standby state. The tree root is a switch within the network elected by the STA (spanning-tree algorithm) to use when computing the best path between bridges throughout the network and the root bridge. Frames travel through the network to their destination–a leaf such as an end-user PC–along branches. A tree branch is a network segment, or link, between bridges. Switches that forward frames through an STP spanning-tree are called designated bridges.
Juniper Networks EX Series Ethernet Switches provide Layer 2 loop prevention through Spanning-Tree Protocol (STP), Rapid Spanning-Tree Protocol (RSTP), Multiple Spanning-Tree Protocol (MSTP), and VLAN Spanning-Tree Protocol (VSTP). This topic explains the spanning-tree default RSTP.
RSTP is an Enhancement of the Original STP
RSTP evolved from the original STP IEEE 802.1D protocol to provide faster spanning-tree re-convergence after a switch port, switch, or LAN failure. Where STP took up to 50 seconds to respond to topology changes, RSTP responds to changes within the timeframe of three hello BPDUs (bridge protocol data units), or 6 seconds. This is the primary reason that RSTP is the default configuration on EX Series switches. In addition, note that EX Series switches configured to use STP actually run RSTP force version 0, which is compatible with STP.
Port Roles Determine Participation in The Spanning-Tree
Each port has both a state and a role. A port’s role determines how it participates in the spanning-tree. The five port roles used in RSTP are:
- Root port—The port closest to the root bridge (has the lowest path cost from a bridge). This is the only port that receives frames from and forwards frames to the root bridge.
- Designated port—The port that forwards traffic away from the root bridge toward a leaf. A designated bridge has one designated port for every link connection it serves. A root bridge forwards frames from all of its ports, which serve as designated ports.
- Alternate port—A port that provides an alternate path toward the root bridge if the root port fails and is placed in the discarding state. This port is not part of the active spanning-tree, but if the root port fails, the alternate port immediately takes over.
- Backup port—A port that provides a backup path toward the leaves of the spanning-tree if a designated port fails and is placed in the discarding state. A backup port can only exist where two or more bridge ports connect to the same LAN for which the bridge serves as the designated bridge. A backup port for a designated port immediately takes over if the port fails.
- Disabled port—The port is not part of the active spanning-tree.
Port States Determine How a Port Processes a Frame
Each port has both a state and a role. A port’s state determines how it processes a frame. RSTP places each port of a designated bridge in one of three states:
- Discarding—The port discards all BPDUs. A port in this state discards all frames it receives and does not learn MAC addresses.
- Learning—The port prepares to forward traffic by examining received frames for location information in order to build its MAC address table.
- Forwarding—The port filters and forwards frames. A port in the forwarding state is part of the active spanning-tree.
Edge Ports Connect to Devices That Cannot Be Part of a Spanning-Tree
RSTP also defines the concept of an edge port, which is a designated port that connects to non-STP-capable devices, such as PCs, servers, routers, or hubs that are not connected to other switches. Because edge ports connect directly to end stations, they cannot create network loops and can transition to the forwarding state immediately. You can manually configure edge ports, and a switch can also detect edge ports by noting the absence of communication from the end stations.
The edge ports themselves do send BPDUs to the spanning-tree.
BPDUs Maintain the Spanning-Tree
Spanning-tree protocols use frames called bridge protocol data units (BPDUs) to create and maintain the spanning-tree. A BPDU frame is a message sent from one switch to another to communicate information about itself, such as its bridge ID, root path costs, and port MAC addresses. The initial exchange of BPDUs between switches determines the root bridge. Simultaneously, BPDUs are used to communicate the cost of each link between branch devices, which is based upon port speed or user configuration. RSTP uses this path cost to determine the ideal route for data frames to travel from one leaf to another leaf and then blocks all other routes. If an edge port receives a BPDU, it automatically transitions to a regular RSTP port.
When the network is in a steady state, the spanning-tree converges when the spanning-tree algorithm (STA) identifies both the root and designated bridges and all ports are in either a forwarding or blocking state. To maintain the tree, the root bridge continues to send BPDUs at a “hello time” interval (default 2 seconds). These BPDUs continue to communicate the current tree topology. When a port receives a hello BPDU, it compares the information to that already stored for the receiving port. One of three actions takes place when a switch receives a BPDU:
- If the BPDU data matches the existing entry in the MAC address table, the port resets a timer called “max age” to zero and then forwards a new BPDU with the current active topology information to the next port in the spanning-tree.
- If the topology in the BPDU has been changed, the information is updated in the MAC address table, “max age” is again set to zero, and a new BPDU is forwarded with the current active topology information to the next port in the spanning-tree.
- When an RSTP port does not receive a BPDU for three hello times, it reacts one of two ways. If the port is the root port, a complete rework of the spanning-tree occurs—see When an RSTP Root Bridge Fails. If the bridge is any non-root bridge, RSTP detects that the connected device cannot send BPDUs and converts that port to an edge port.
When an RSTP Root Bridge Fails
When a link to the root port goes down, a flag called a topology
change notification (TCN) is added to the BPDU. When this BPDU reaches
the next port in the VLAN, the MAC address table is flushed and the
BPDU is sent to the next bridge. Eventually, all ports in the VLAN
have flushed their MAC address tables. Then, RSTP configures a new
root port.
After a root port or a designated
port fails, the alternate or backup port takes over after an exchange
of BPDUs called the proposal-agreement handshake. RSTP propagates
this handshake over point-to-point links, which
are dedicated links between two network nodes, or switches, that connect
one port to another. If a local port becomes a new root or designated
port, it negotiates a rapid transition with the receiving port on
the nearest neighboring switch by using the proposal-agreement handshake
to ensure a loop-free topology.
Switches Must Relearn MAC Addresses After a Link Failure
Because a link failure causes all associated ports to flush their MAC address table, the network may be slower as it floods to relearn the MAC addresses. There is a way to speed up this relearning process. During TCN propagation, the Layer 2 forwarding table of switches is flushed, resulting in a flood of data packets. The ARP feature causes the switch to proactively send ARP requests for IP addresses in the ARP cache (present because of Layer 3 VLAN interface). With ARP on STP enabled, as the reply comes through, the switches builds up the Layer 2 forwarding table, thus limiting the flooding later. Enabling ARP on STP is most useful to prevent excessive flooding in large Layer 2 networks using RVIs.
Selecting a Spanning-Tree Protocol
The default factory configuration for EX Series switches is RSTP, a faster version of the original STP. To determine which spanning-tree protocol is best for your situation, see Table 1 below.
Table 1: Selecting a Spanning-Tree Protocol
Protocol | Advantages | Disadvantages |
---|---|---|
RSTP |
|
|
STP |
|
|
MSTP |
|
|
VSTP |
|
|
Related Documentation
- EX Series
- Understanding STP for EX Series Switches
- Understanding MSTP for EX Series Switches
- Understanding VSTP for EX Series Switches
- Understanding Layer 2 Protocol Tunneling on EX Series Switches
- Example: Faster Convergence and Improved Network Stability with RSTP on EX Series Switches
- Example: Configuring Faster Convergence and Improved Network Stability with RSTP on EX Series Switches
Published: 2015-04-08
Supported Platforms
Related Documentation
- EX Series
- Understanding STP for EX Series Switches
- Understanding MSTP for EX Series Switches
- Understanding VSTP for EX Series Switches
- Understanding Layer 2 Protocol Tunneling on EX Series Switches
- Example: Faster Convergence and Improved Network Stability with RSTP on EX Series Switches
- Example: Configuring Faster Convergence and Improved Network Stability with RSTP on EX Series Switches