Https::jncie - Wordpress.com:wp Content:uploads:2008:09:801002 - Spanning Tree Protocol in Layer 2 Layer 3 Environments
Https::jncie - Wordpress.com:wp Content:uploads:2008:09:801002 - Spanning Tree Protocol in Layer 2 Layer 3 Environments
Table of Contents
Executive Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Spanning Tree Protocol Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
The Juniper Networks Position on Layer 2 versus Layer 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Configuration Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Configuration Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Option 1: Layer 2 Everywhere (Not Recommended) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
STP/RSTP Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
MSTP Configuration: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Option 2: Layer 3 at the Core and Between Core and Aggregation Layers; Layer 2 Between Ag-
gregation and Access Layers and at the Access Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Option 3: Layer 3 Everywhere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Spanning Tree Interoperability with Cisco Switches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
PVST+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Interoperating STP/RSTP with PVST+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Multiple Spanning Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Performance-Enabling Services and Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
About Juniper Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Executive Summary
This document is targeted at SEs and other technical audiences as an implementation guide for
configuring the Spanning Tree Protocol (STP) with EX-series Ethernet switches from Juniper Networks.
Introduction
This implementation guide will provide a basic understanding of all three versions of the Spanning
Tree Protocol, namely 802.1d-1998, RSTP (802.1w) and MSTP (802.1s), as well as background on
common enterprise networks and how to deploy EX-series switches in a mixed environment with
Juniper Networks MX-series Ethernet services routers and Cisco switches.
Spanning Tree Protocol (STP–802.1d 1998): The original version of STP (legacy STP) only
supports a single instance of Spanning Tree in a bridged network, typically referred to as
Common Spanning Tree (CST). On 802.1Q trunks that carry multiple VLANs, one VLAN—
usually the default or VLAN 1—will dictate the forwarding topology for all other VLANs.
In STP, when a port is enabled or there is any change in the STP topology, it can take up
to 50 seconds (MAX_Age + 2 x FWD_Delay, with default timers) for the bridged network
to reconverge.
Root Switch
L2 Sw L2 Sw
itch itch
Trunk
Core/Aggregation
Access Trunk Trunk
L2 Sw
itch
Forwarding for Blocking for
all VLANs all VLANs
Rapid Spanning Tree Protocol (RSTP–802.1w/802.1d 2004): Similar to legacy STP, RSTP
implements a single instance of Spanning Tree but dramatically improves the convergence
time. For example, in legacy STP, a host port coming online can take up to 30 seconds (2 x
FWD_Delay) before it begins forwarding. Direct or indirect node/link failure convergence can
even take up to 50 seconds (MAX_Age + 2 x FWD_Delay) with legacy STP. Such convergence
times are not acceptable in today’s high-performance enterprise networks.
RSTP overcomes slow convergence times by introducing new port roles (edge port, alternate
port and backup port) and new convergence behavior under specific connectivity conditions
(for example, point-to-point or shared medium). These enhancements enable RSTP to achieve
sub-second forwarding and network convergence. RSTP is backward-compatible with legacy
STP; if legacy STP BPDU is detected on a link, then an RSTP-capable bridge will revert to
legacy STP on that given port.
Trunk
Core/Aggregation
Access Trunk Trunk
L2 Sw
itch
Forwarding for Instance 1 Blocking for Instance 1
Blocking for Instance 2 Forwarding for Instance 2
Figure 2: MSTP Allows Both Links of the Access Layer Switch to be Used at the Same
Time While Maintaining a Loop-Free Network
Configuration Guide
This section covers the three-tiered core-, aggregation- and access-layer topologies commonly used in
today’s enterprise network (see Figure 3). The Juniper Networks product portfolio can be deployed in
a three-tiered network. At the core layer, for instance, network architects desire a low-latency switch
with non-blocking fabrics and wire rate linecards—solutions such as Juniper Networks MX-series
Ethernet services routers (ESRs). At the aggregation layer, depending on the connectivity choice (10
GbE or GbE), either Juniper Networks MX480 routers or EX 4200-24F (24-port 100/1000BASE-X fiber)
switches with Virtual Chassis™ technology can be used. At the access layer, EX 4200 series switches
are a perfect fit.
MX-960-1 MX9
60
MX9
60 MX-960-2
Core
MX4
EX4200 80 MX480
EX 4
2 0
E
SXe 42s0
Aggregation Serriie
es
00
Access EX 4 EX 4 EX 4
Serie200 Serie200 Serie200
s s s
Configuration Options
This section covers multiple configuration options for the topology shown in Figure 3.
STP/RSTP Configuration
Core Switches:
Since STP and RSTP configurations are similar, this section will focus on RSTP. To configure STP,
simply change the keyword from “RSTP” to “STP.”
In Spanning Tree, all enabled Spanning Tree bridges first go through a root election process. The
switch with the lowest bridge ID is declared the root. A bridge ID consists of a bridge priority and
MAC address. The root switch is the base for Spanning Tree where all of the other non-root switches
build their shortest path to the root switch and block any redundant links. The placement of the root
switch is important since the majority of traffic will pass through the root switch.
Rather than rely on chance, it is important to configure the bridge priority on the switch to make sure
that it becomes the root switch. The bridge priority defaults to 32768 but is configurable from 0 to
65536. If switches have the same bridge priority, then the bridge with the lowest MAC address wins.
In Figure 3, the MX960-1 should be the root switch, since the majority of client traffic will be to and
from the local and/or remote servers (typically server switches and/or WAN routers, not shown in the
diagram, are connected to the core switches). Therefore, MX960-1 is configured with a bridge-priority
of 4K (4096), which makes it the lowest bridge ID and, consequently, the root switch.
It is equally important to configure a backup root switch. If a root switch fails, all remaining switches
repeat the election process to select a new root switch; configuring a backup allows you to preselect
which device will take over in the case of a primary failure—in this case, the core MX960-2 switch.
Therefore, MX960-2 is configured with a bridge-priority of 8K (8192), making its bridge ID higher
than MX960-1 but lower than the other switches. This ensures that it becomes the new root switch if
the primary root switch fails.
Aggregation Switches:
Because RSTP root is already designated on the core switch, no extra RSTP configuration is required
on the switches in the aggregation layer; RSTP is enabled by default on the EX-series switches.
On the MX-series router, the same command as above (core layer) is used to enable RSTP, but without
the bridge-priority command.
Access Switches:
An Edge Port feature allows a port to transition to a forwarding state without a 30-second delay (2 x
FWD_Delay). This feature is ideal for ports that are connected to PCs/servers, routers, firewalls and so
on.
RSTP automatically incorporates Edge Port based on certain characteristics of a port such as full-
duplex mode and the fact that no BPDU has been detected, but this feature has the option to be
manually configured for an interface as well. In the case of STP, the Edge Port feature must be
manually configured for specific interfaces using the following command:
If a BPDU is detected on the Edge Port, the protocol is intelligent enough to reclassify the port as a
non-edge port. Thus if a loop is detected, the port can transition to a blocking state.
MSTP Configuration:
MSTP is the desired Spanning Tree Protocol. MSTP allows network architects to load-balance VLANs,
as well as to pass traffic through those VLANs over multiple uplinks and still maintain a loop-free
network. When configuring MSTP, the region name, revision mapping and VLAN mappings must all
be the same on all of the switches; otherwise these switches will not be part of the same region. In
the example shown in Figure 3, all switches in the enterprise network are in the same region.
The majority of enterprise networks will have no more than two Spanning Tree instances; each MSTI
will be mapped to a group of VLANs – for example, odd VLANs for Instance 1 and even VLANs for
Instance 2. To achieve MSTI load balancing, one of the core switches will be the MSTI regional root
for Instance 1 and the backup MSTI regional root for Instance 2, and vice versa for the other core
switch.
Core Switches:
Depending on port connectivity and density requirements (10 GbE or GbE), either the MX480 routers
or the EX 4200 series switches can be used at the aggregation layer.
Option 2: Layer 3 at the Core and Between Core and Aggregation Layers;
Layer 2 Between Aggregation and Access Layers and at the Access
Layer
For this option, OSPF or other routing protocols must be configured at the core and aggregation
switches. Since the focus of this document is Spanning Tree, Layer 3 configurations will not be
covered.
For Layer 2, MSTP would be ideal between the aggregation and access layers. The root switch should
be one of the two switches in the aggregation layer. Since Spanning Tree commands were covered in
the previous section, no examples will be provided here.
PVST+
On a given 802.1Q trunk, VLAN 1 BPDUs are always advertised as untagged to the well-known IEEE
Spanning Tree multicast address, 01:80:C2:00:00:00. The other VLAN(s) on the trunk advertise tagged
PVST+ BPDUs to Cisco’s reserved multicast address, 01:00:0C:CC:CC:CD. This allows Cisco to have a
per-VLAN instance that can utilize multiple redundant trunk links by load-balancing the VLANs across
them. As shown in Figure 4, odd VLANs are forwarded on one of the uplink trunks and blocked on
the other uplink trunk, and vice versa for the even VLANs.
One drawback to PVST+ is that it is Cisco proprietary and not embraced by any standard. PVST+
also places a large burden on switch resources such as CPU and memory, as each switch must
maintain a separate STP database instance and process BPDUs on a per-port per-VLAN basis. While
that might be OK with just a few VLANs, it obviously cannot scale when 4,000 VLANs are supported.
Switch 1 Switch 2
Root for Odd VLANs Root for Even VLANs
L2 Sw L2 Sw
itch itch
Trunk
Core/Aggregation
Access Trunk Trunk
L2 Sw
itc h
Forwarding for Odd VLANs Forwarding for Even VLANs
Blocking for Even VLANs Blocking for Odd VLANs
Switch 3
STP Database
ge-0/0/0 FWD
Juniper Networks ge-0/0/1 FWD
Cisco Switch EX Switch ge-0/0/2 FWD
L2 Sw L2 Sw
itc h itc h
1 and 2
by EX switch
01:00:0C:CC:CC:CD Cisco SRC MAC 1Q Tag BPDU VLAN 2
PVST+BPDUs on
VLAN2/VLAN3
01:00:0C:CC:CC:CD Cisco SRC MAC 1Q Tag BPDU VLAN n originally sent by
Cisco switch
PVST+ BPDUs
Figure 5: When EX-series Switches Receive BPDUs from a Cisco Switch, Only the
IEEE STP BPDU Is Processed; the PVST+ BPDUs Are Flooded as Regular Unknown L2
Multicast Packets
Now that it’s understood how Juniper Networks EX-series switches handle the various types of BPDUs
that Cisco switches send out, the next step will be to see how a typical Layer 2 topology forwarding
path will behave with a mixture of Juniper Networks switches running STP/RSTP and Cisco switches
running PVST+.
In Figure 6, VLANs 1 through 4 are traversing all 802.1Q trunk links. Switches 1 and 2 are Cisco
switches running PVST+. Switch 1 is the STP root for VLANs 1 and 3 with a bridge priority of 4096.
It is also the STP backup root switch for VLANs 2 and 4 with a bridge priority of 8192. Switch 2 is the
STP root switch for VLANs 2 and 4 with a bridge priority 4096 and is the STP backup root switch for
VLANs 1 and 3 with a bridge priority of 8192.
There is one additional caveat to PVST+. By default, the path cost assigned by PVST+ is based on
Cisco’s STP cost convention, not the IEEE STP cost. Therefore, the path cost needs to be changed so
that it complies with IEEE STP path cost and all similar links (like FastE, GbE) have the same link-cost
value. On the Cisco devices, the command “spanning-tree pathcost method long” must be entered to
make it compliant with IEEE STP path cost. This command will be applied to all Cisco switch ports.
Switch 3 in Figure 6 is a Juniper Networks EX-series switch running RSTP. Since RSTP only has a
single Spanning Tree instance for all VLANs across a trunk and there is no VLAN awareness, all traffic
will be forwarded or blocked based on the VLAN 1 topology. Therefore, the link between Switch 1 and
Switch 3 will be forwarding for all VLANs (VLAN 1 through 4) and the other link will be blocking for
all VLANs (VLAN 1 through 4).
The net result is that Switch 3 is blocking one of the uplinks; there is no logical L2 loop in the
topology presented in Figure 6, regardless of which Cisco switch is the root for any of the VLANs
(except VLAN 1) and regardless of the fact that these Cisco switches are running PVST+.
Switch 1 Switch 2
Root for Odd VLANs Root for Even VLANs
00:1b:d5:8a:0a:00 00:1b:d4:ce:c4:00
L2 Sw L2 Sw
itch itch
Trunk
Core/Aggregation
Access Trunk Trunk
L2 Sw
itch
Blocking for all
VLANs
Switch 3
00:19:e2:50:63:a0
Figure 6: Cisco at the Core/Aggregation Layers Running PVST+ and Juniper Networks
EX-series Switches at the Access Layer Running RSTP; Only One Link is Forwarding Traffic
The output below is taken from Switch 3. From the “show spanning-tree bridge” command, the
Juniper Networks EX-series switch properly acknowledged the root bridge is Switch 1. The “show
spanning-tree interface” command shows the port states and, based on the output, only interface
ge-0/0/0.0 is forwarding.
In Figure 7, the topology has been reversed, with the EX-series switches at the core/aggregation layers
and the Cisco switch at the access layer, supporting all four VLANs.
Switch 1 Switch 2
Root
00:19:e2:50:63:a0 00:19:e2:50:93:60
L2 Sw L2 Sw
itc h itch
Trunk
Core/Aggregation
Access Trunk Trunk
L2 Sw
itch
Blocking for all
VLANs
Switch 3
00:1b:d5:8a:0a:00
3750E#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 4096
Address 0019.e250.63a0
Cost 20000
Port 14 (GigabitEthernet1/0/14)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
VLAN0002
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- -------------------------------
Gi1/0/1 Desg FWD 20000 128.13 P2p
Gi1/0/2 Back BLK 20000 128.14 P2p
VLAN0003
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- -------------------------------
Gi1/0/1 Desg FWD 20000 128.13 P2p
Gi1/0/2 Back BLK 20000 128.14 P2p
VLAN0004
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- -------------------------------
Gi1/0/1 Desg FWD 20000 128.13 P2p
Gi1/0/2 Back BLK 20000 128.14 P2p
Also note that on the Cisco switch, when changing the native VLAN ID of a trunk to something other
than VLAN 1, the CST topology is still based on VLAN 1; this is because the Cisco device will still send
the IEEE STP BPDUs untagged with VLAN 1 parameters over an 802.1Q trunk. And for the VLAN
ID that is declared as native-vlan, the Cisco switch will send an untagged PVST+ BPDU to the Cisco
proprietary 01:00:0C:CC:CC:CD address.
In Figure 8 below, VLAN 2 is the native VLAN between Cisco and Juniper Networks. The IEEE STP
BPDU sent by the Cisco switch still contains VLAN 1 parameters and is untagged. Also note that the
BPDU for VLAN 2 is still sent on the PVST+ multicast address by the Cisco switch and is untagged.
Please note: It is imperative to match the native VLAN ID on both sides of an 802.1Q trunk.
STP Database
ge-0/0/0 FWD
Juniper Networks ge-0/0/1 FWD
Cisco Switch EX Switch ge-0/0/2 FWD
L2 Sw L2 Sw
itch itc h
1 and 2
by EX switch
01:00:0C:CC:CC:CD Cisco SRC MAC BPDU VLAN 2
PVST+BPDUs on
VLAN2/VLAN3
01:00:0C:CC:CC:CD Cisco SRC MAC 1Q Tag BPDU VLAN n originally sent by
Cisco switch
PVST+ BPDUs
Figure 8: CST is Still Based on VLAN 1, Even Though the Native VLAN is 2
Multiple Spanning Tree
MSTP helps overcome these STP/RSTP shortcomings, as well as mitigate the demanding resource
requirements and lack of standards compliance that are associated with PVST+. The benefit of
MSTP is its ability to map a group of VLANs to a Multiple Spanning Tree Instance rather than just
one VLAN per instance as seen with PVST+. Different root switches and different STP parameters
can be configured for each MSTI, resulting in a different Layer 2 forwarding topology. For example,
as shown in Figure 4, though there could be many VLANs configured between the access and core/
aggregation layers of an enterprise network, the majority of these networks have no more than
two Spanning Tree forwarding topologies. Hence, instead of maintaining X instances of STP for X
number of VLANs under PVST+, it only takes two MSTIs to achieve the same result with MSTP—half
the VLANs mapped to MSTI 1 and half the VLANs mapped to MSTI 2, as shown in Figure 9. If the
network administrator desires additional Spanning Tree topologies, more MSTIs can be added (up to a
maximum of 64).
The required MSTP configurations for the EX-series and Cisco switches shown in Figure 9 are
provided below. Note that all switches are in the same MSTP region, and the root switches for each
MSTI are on the core switches.
Switch 1 Switch 2
Root for Instance 1 Root for Instance 2
L2 Sw L2 Sw
itch itc h
Trunk
Core/Aggregation
Access Trunk Trunk
L2 Sw
itc h
Forwarding for Instance 1 Blocking for Instance 1
Blocking for Instance 2 Forwarding for Instance 2
The output below validates the configurations shown above. Switch 1 is root for MST0 and MST1
because the path cost is 0 and there is no root port, whereas the MST2 root is Switch 2.
The output below validates the configurations shown above. Switch 2 is root for MST2 because the
path cost is 0 and there is no root port, whereas Switch 1 is root for MST1 and MST0.
The output below shows that both links on the EX-series switches are being utilized. The link between
Switch 1 and Switch 3 is forwarding for MSTI 1 and blocking for MSTI 2; the link between Switch 2
and Switch 3 is forwarding for MSTI 2 and blocking for MSTI 1.
Conclusion
Juniper Networks EX-series Ethernet switches can be deployed in either a Layer 2 or Layer 3
environment. However, if a Layer 2 topology is a must, then the Spanning Tree Protocol is necessary
to prevent any unwanted L2 bridge loops. This implementation guide has covered the fundamentals
and configurations of all three standards-based Spanning Tree Protocols. By following these
guidelines, Juniper customers can confidently integrate EX-series switches into their current network
infrastructure without compromising desired STP stability, functionality and flexibility.
CORPORATE HEADQUARTERS EUROPE, MIDDLE EAST, AFRICA EAST COAST OFFICE ASIA PACIFIC REGIONAL SALES HEADQUARTERS
AND SALES HEADQUARTERS FOR REGIONAL SALES HEADQUARTERS Juniper Networks, Inc. Juniper Networks (Hong Kong) Ltd.
NORTH AND SOUTH AMERICA Juniper Networks (UK) Limited 10 Technology Park Drive 26/F, Cityplaza One
Juniper Networks, Inc. Building 1 Westford, MA 01886-3146 USA 1111 King’s Road
1194 North Mathilda Avenue Aviator Park Phone: 978.589.5800 Taikoo Shing, Hong Kong
Sunnyvale, CA 94089 USA Station Road Fax: 978.589.0800
Phone: 852.2332.3636
Phone: 888.JUNIPER (888.586.4737) Addlestone Fax: 852.2574.7803
or 408.745.2000 Surrey, KT15 2PG, U.K.
Fax: 408.745.2100 Phone: 44.(0).1372.385500
www.juniper.net Fax: 44.(0).1372.385501
Copyright 2008 Juniper Networks, Inc. All rights reserved. Juniper Networks,
the Juniper Networks logo, NetScreen, and ScreenOS are registered trademarks
of Juniper Networks, Inc. in the United States and other countries. JUNOS and To purchase Juniper Networks solutions, please
JUNOSe are trademarks of Juniper Networks, Inc. All other trademarks, service
marks, registered trademarks, or registered service marks are the property of
contact your Juniper Networks sales representative
their respective owners. Juniper Networks assumes no responsibility for any at 1-866-298-6428 or authorized reseller.
inaccuracies in this document. Juniper Networks reserves the right to change,
modify, transfer, or otherwise revise this publication without notice.
18