DCS-Chapter4 v1.2
DCS-Chapter4 v1.2
2
Chapter 4
Spanning Tree Protocol
3
Chapter 4
Spanning Tree Protocol
4
Chapter 4
Spanning Tree Protocol
Loop Avoidance
The Spanning Tree Protocol can resolve loop issues.
5
Chapter 4
Spanning Tree Protocol
Redundant Links
If one of the connections fails, the Spanning Tree Protocol will
unblock the port and provide redundancy.
6
Chapter 4
Spanning Tree Protocol
7
Chapter 4
Spanning Tree Protocol
8
Chapter 4
Spanning Tree Protocol
BPDU Frame
D-Link
1
9
Chapter 4
Spanning Tree Protocol
11
Chapter 4
Spanning Tree Protocol
12
Chapter 4
Spanning Tree Protocol
Bridge ID Content
13
Chapter 4
Spanning Tree Protocol
Page is Animated 14
Chapter 4
Spanning Tree Protocol
15
Chapter 4
Spanning Tree Protocol
16
Chapter 4
Spanning Tree Protocol
4 Mbps 250
10 Mbps 100
16 Mbps 62
100 Mbps 19
1 Gbps 4
10 Gbps 2
Best
17
Chapter 4
Spanning Tree Protocol
Designated Designated
Port AP1 AP2 Port
Root Bridge
<A,0,A> <A,0,A>
AP1 vs BP1 AP2 vs CP1
AP1 Priority > BP1 Priority AP2 Priority > CP1 Priority
Path Cost: 10
Path Cost: 5 Designated
Port CP2 -> SW A = 4+5 = 9
CP1 -> SW A = 10
Roo <A,0,A>
<B,0,B>
t <A,0,A>
<C,0,C>
Port
BP1 Roo
CP1 t
BP2 Path Cost: 4
CP2 Port
<B,0,B>
<A,5,A> <A,10,A>
<C,0,C>
<A,9,A> Switch C
Switch B
32768, 00-00-00-00-00-0c
32768, 00-00-00-00-00-0b
Designated Roo CP1 vs CP2
BP1 vs BP2 vs CP2 Port
BP1 Priority > BP2 Priority t CP1 Priority > CP2 Priority
BP2 Priority > CP2 Priority Port BP2 Priority > CP2 Priority
Page is Animated 18
Chapter 4
Spanning Tree Protocol
BPDU Parameter
19
Chapter 4
Spanning Tree Protocol
STP Timers
Hello Time
• The time interval between Configuration BPDUs sent by the Root
Bridge. The Hello Time value configured in the Root Bridge switch
determines the Hello Time for all non-root switches because they just
relay the Configuration BPDUs when they receive it from the root. The
default Hello Time Value is 2 seconds; the value range is 1-10
seconds.
Forward Delay
• The time interval that a switch port spends in Listening and Learning
states. The default Forward Delay Value is 15 seconds; the value
range is 4-30 seconds.
Max. Age
• The time interval that a switch stores a BPDU before discarding it. The
default maximum age value is 20 seconds; the value range is 6-
40 seconds.
21
Chapter 4
Spanning Tree Protocol
Topology Change
In normal STP operation, a bridge keeps receiving Configuration
BPDUs from the Root Bridge on its Root Port.
In order for this to occur, a special BPDU called the Topology
Change Notification (TCN) BPDU has been introduced. Therefore,
when a bridge needs to signal a topology change, it starts to send
TCNs on its Root Port.
The designated bridge receives the TCN, acknowledges it and
generates another one for its own Root Port. The process
continues until the TCN hits the Root Bridge.
22
Chapter 4
Spanning Tree Protocol
TCN-ACK TCN
TC
N
TC
N-
AC
K
Page is animated 23
Chapter 4
Spanning Tree Protocol
24
Chapter 4
Spanning Tree Protocol
Root
Switch Forwarding
TC
F la
g
Delay=15s
TC Flag TC
Fl a
g
Forwarding
Delay=15s TC
F la
g
Forwarding
Delay=15s
TC Flag
Forwarding
Delay=15s
Forwarding
TC Flag Set=35s
(Forward delay timer + Max. age timer)
Delay=15s
Page is animated 26
Chapter 4
Spanning Tree Protocol
27
Chapter 4
Spanning Tree Protocol
28
Chapter 4
Spanning Tree Protocol
29
Chapter 4
Spanning Tree Protocol
Example: STP
Enable STP on both switches. Check that one port on the switch is
blocked.
Ping PC-1 and PC-2 continuously.
Unplug Cable-1, check how long (# pings lost) until the backup
link becomes active.
Re-plug Cable-1, and check how long it will take for the link to
recover.
30
Chapter 4
Spanning Tree Protocol
31
Chapter 4
Spanning Tree Protocol
32
Chapter 4
Spanning Tree Protocol
Disabled Discarding No No
Blocking Discarding No No
Listening Discarding No No
33
Chapter 4
Spanning Tree Protocol
34
Chapter 4
Spanning Tree Protocol
35
Chapter 4
Spanning Tree Protocol
36
Chapter 4
Spanning Tree Protocol
RSTP 802.1w
2-bit
6-bit
37
Chapter 4
Spanning Tree Protocol
2. Sync (block)
2. In-Sync
(unchanged)
4. Proposal
Page is animated 38
Chapter 4
Spanning Tree Protocol
39
Chapter 4
Spanning Tree Protocol
40
Chapter 4
Spanning Tree Protocol
41
Chapter 4
Spanning Tree Protocol
Page is animated 42
Chapter 4
Spanning Tree Protocol
44
Chapter 4
Spanning Tree Protocol
STP BPDU
Page is animated 45
Chapter 4
Spanning Tree Protocol
Example: RSTP
Enable RSTP on both switches. Check that one port on the switch
is blocked.
Ping PC-1 and PC-2 continuously.
Unplug the Cable-1 and check how long (# pings lost) before the
backup link becomes active.
Re-plug Cable-1 and check how long until the link recovers.
46
Chapter 4
Spanning Tree Protocol
Note:
1. By default, rstp is used on D-Link switches. Thus to configure it to STP, the command
config stp version stp must be used.
2. “instance_id 0” will be covered in DCP (D-Link Certified Professional) courses.
47
Chapter 4
Spanning Tree Protocol
Configuring STP
48
Chapter 4
Spanning Tree Protocol
DGS-3627:admin#
enable stp
This command is used to enable STP globally.
DGS-3627:admin#
disable stp
This command is used to disable STP globally.
49
Chapter 4
Spanning Tree Protocol
DGS-3627:admin#
config stp version [mstp | rstp | stp]
50
Chapter 4
Spanning Tree Protocol
DGS-3627:admin#
config stp priority <value 0-61440> instance_id
<value 0-15>
51
Chapter 4
Spanning Tree Protocol
52
Chapter 4
Spanning Tree Protocol
DGS-3627:admin#
show stp instance <value 0-15>
53
Chapter 4
Spanning Tree Protocol
54
Chapter 4
Spanning Tree Protocol
55
Chapter 4
Spanning Tree Protocol
56
Chapter 4
Spanning Tree Protocol
DGS-3627:admin#
config stp {maxage <value 6-40> | maxhops <value 1-40
| hellotime <value 1-10> | forwarddelay <value 4-30>
| txholdcount <value 1-10> | fbpdu [enable|disable] |
lbd [enable|disable)] | lbd_recover_timer [<value 0>
| <value 60-1000000>] | nni_bpdu_addr [dot1d |
dot1ad]}
57
Chapter 4
Spanning Tree Protocol
Summary
This chapter introduces the Spanning Tree Protocol (STP), used on
switches to provide a loop-free redundant topology.
There are two standards used for STP. These are IEEE 802.1D and
IEEE 802.1w, which are respectively STP and RSTP.
Rapid Spanning Tree Protocol (RSTP) provides for faster spanning
tree convergence when there is a topology change. STP normally
takes 30 to 50 seconds to react to a topology change, and RSTP is
able to react to a topology change between 1 to 6 seconds.
By default, D-Link switches use the IEEE 802.1w standard.
58
Chapter 4
Spanning Tree Protocol
Lab Topology
59