Spanning Tree
Spanning Tree
Spanning Tree
User A User C
MAC: 00:26:88:02:74:86 Switch-1 Switch-2 MAC: 00:26:88:02:74:88
User B User D
MAC: 00:26:88:02:74:87 MAC: 00:26:88:02:74:89
What If …?
User A User C
MAC: 00:26:88:02:74:86 Switch-1 Switch-2 MAC: 00:26:88:02:74:88
Switch-3
Flood
User E User F
MAC: 00:26:88:02:74:90 MAC: 00:26:88:02:74:91
Spanning Tree
Host A Host B
Switch-2 Switch-3
No User Traffic
User Traffic
Loop Free
BPDUs Environment
Bridge ID
•Root ID
8
• A unique ID of the bridge that the transmitting
bridge believes to be the root
Port ID 2
Max Age 2 2 6
2 Port
Hello Time Priority
Number
Forward Delay 2
1 1
© 2010 Juniper Networks, Inc. All rights reserved. www.juniper.net | 8
Bridge ID 8
Port ID 2
Message Age 2
Max Age 2
Hello Time 2
Forward Delay 2
Host A Host B
Switch-2 Switch-3
F,R F,R
Switch-2 Switch-3
F F
F F
Host A F F Host B
Switch-2 Switch-3
Reconvergence Example (1 of 2)
Steps:
1. Switch G fails
2. Switch E’s port leaves forwarding state
3. Switch E sends TCNs out root port
Root
every 2 seconds until B’s root port A
receives TCN ACK (configuration BPDU)
4. Switch B sends TCN ACK
B C
5. Switch B sends TCN out root port
6. Switch A sends TCN ACK
D E F
Reconvergence Example (2 of 2)
Steps (contd.):
7. The root bridge sets the topology change flag
and sends an updated configuration BPDU
8. Switches B and C relay the topology
Root
change flag to downstream switches
A
9. All nonroot bridges change the MAC Fwd
Table Aging
MAC Fwd
Table Aging
MAC address forwarding table Time: 15
Sec
Time: 15
Sec
•Alternate port:
D DD D
• Provides an alternate path to the root
bridge (essentially a backup root port)
• Blocks traffic while receiving superior R A R A
•Backup port:
• Provides a redundant path to a segment
(on designated switches only)
• Blocks traffic while a more preferred port
Root Port = R
functions as the designated port
Designated Port = D
Disabled
Blocking Discarding
Learning Learning
Forwarding Forwarding
RST BPDUs
RST BPDUs:
•Act as keepalives
• RSTP-designated ports send Configuration BPDUs every hello time
(default of 2 seconds)
•Provide faster failure detection
• If a neighboring bridge receives no BPDU within 3 times the hello
interval (3 x 2 = 6 seconds), connectivity to the neighbor is faulty
Switch-1 (Root Bridge)
DDDD
RA RA
Switch-2 Switch-3
DB A A
Forwarding = F
F F F
Blocking = B
Root Port = R
R F R F Designated Port = D
R F
D A R D Alternate Port = A
F Inferior PDU F Superior PDU F
B
Switch-2 Switch-3 Switch-2 Switch-3
Forwarding = F
F F F
Blocking = B
Root Port = R
R F R F
Designated Port = D
R F
D A D R Alternate Port = A
F B F F
Switch-2 Switch-3 Switch-2 Switch-3
STP RSTP
Configuring STP
[edit protocols stp]
user@switch# set ?
Possible completions:
+ apply-groups Groups from which to inherit configuration data
+ apply-groups-except Don't inherit configuration data from these groups
bpdu-block-on-edge Block BPDU on all interfaces configured as edge (BPDU Protect)
bridge-priority Priority of the bridge (in increments of 4k - 0,4k,8k,..60k)
disable Disable STP
forward-delay Time spent in listening or learning state (4..30 seconds)
hello-time Time interval between configuration BPDUs (1..10 seconds)
> interface
max-age Maximum age of received protocol bpdu (6..40 seconds)
> traceoptions Tracing options for debugging protocol operation
Configuring RSTP
[edit protocols rstp]
user@switch# show
bridge-priority 32k;
max-age 20; Default RSTP settings
hello-time 2;
forward-delay 15;
interface ge-0/0/10.0 { Excludes interface from participating in RSTP
disable;
} Default priority value (used to influence downstream device’s least-cost path
interface ge-0/0/13.0 { calculation to root bridge—lower is better)
priority 128;
mode point-to-point; Default interface mode for interfaces operating in full-duplex mode
}
interface ge-0/0/14.0 { Default cost value for interfaces operating at 1 Gbps
cost 20000;
mode shared; Default interface mode for interfaces operating in half-duplex mode
}
interface ge-0/0/2.0 {
edge; Default value for interfaces that do not connect to STP-enabled devices
}
ge-0/0/8.0
ge-0/0/8.0
ge-0/0/8.0
cost 200000; cost 20000;
} }
D
R F F A B
D R
{master:0}[edit protocols rstp] F F {master:0}[edit protocols rstp]
ge-0/0/12.0
user@Switch-3# show Switch-3 Switch-4 user@Switch-4# show
bridge-priority 32k; bridge-priority 36k;
interface all { Forwarding = F interface all {
priority 16; priority 128;
Blocking = B
cost 2000; cost 20000;
} Root Port = R }
Designated Port = D
Alternate Port = A
ge-0/0/8.0
R
F R F
D A
{master:0}[edit protocols rstp] F B {master:0}[edit protocols rstp]
ge-0/0/12.0
user@Switch-3# show Switch-3 Switch-4 user@Switch-4# show
bridge-priority 32k; bridge-priority 36k;
interface all { Forwarding = F interface all {
priority 16; priority 128;
Blocking = B
cost 2000; cost 20000;
} Root Port = R }
Designated Port = D
Alternate Port = A
ge-0/0/8.0
ge-0/0/8.0
A B
R
{master:0}[edit protocols rstp] F {master:0}[edit protocols rstp]
ge-0/0/12.0
user@Switch-3# show Switch-3 Switch-4 user@Switch-4# show
bridge-priority 32k; bridge-priority 36k;
interface all { Forwarding = F interface ge-0/0/8.0 {
priority 16; priority 32;
Blocking = B
cost 20000; }
} Root Port = R interface ge-0/0/12.0 {
priority 16;
Designated Port = D
}
Alternate Port = A
What If…?
BPDUs
User A User A
Switch-2 Switch-3 Switch-2 Switch-3
BPDU Protection
User A
Switch-2 Switch-3
{master:0}[edit ethernet-switching-options]
user@Switch-2# show
bpdu-block {
interface ge-0/0/6.0;
}
ge-0/0/6.0
User A
{master:0}
user@Switch-2> show ethernet-switching interfaces ge-0/0/6.0
Interface State VLAN members Tag Tagging Blocking
ge-0/0/6.0 up default untagged unblocked Before BPDU violation
What If…?
D D D D
Layer 2 Loop
R R R R
D A D DA
Loop Protection
D D
Loop
R Protection R
D A
Switch-2 Switch-3
R Loop Protection R
D A
Use the block or alarm action in ge-0/0/12.0
conjunction with the loop protection feature
Switch-2 Switch-3
What If…?
Aggregation
BPDUs
Access
Root Protection
Access
{master:0}
user@Switch-1> show spanning-tree interface