Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
STP
Search
Torsten Rehn
November 09, 2016
Technology
0
140
STP
Spanning Tree Protocol
Torsten Rehn
November 09, 2016
Tweet
Share
More Decks by Torsten Rehn
See All by Torsten Rehn
8 Years of Config Management
trehn
0
110
How the Internet works
trehn
0
64
Other Decks in Technology
See All in Technology
Data Hubグループ 紹介資料
sansan33
PRO
0
2.2k
これがLambdaレス時代のChatOpsだ!実例で学ぶAmazon Q Developerカスタムアクション活用法
iwamot
PRO
6
1.1k
GoでもGUIアプリを作りたい!
kworkdev
PRO
0
140
やる気のない自分との向き合い方/How to Deal with Your Unmotivated Self
sanogemaru
0
510
エンタメとAIのための3Dパラレルワールド構築(GPU UNITE 2025 特別講演)
pfn
PRO
0
330
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
310
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
930
AWS Top Engineer、浮いてませんか? / As an AWS Top Engineer, Are You Out of Place?
yuj1osm
2
210
能登半島地震において デジタルができたこと・できなかったこと
ditccsugii
0
200
そのWAFのブロック、どう活かす? サービスを守るための実践的多層防御と思考法 / WAF blocks defense decision
kaminashi
0
200
Codexとも仲良く。CodeRabbit CLIの紹介
moongift
PRO
0
210
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
3
20k
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
4.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Music & Morning Musume
bryan
46
6.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
KATA
mclloyd
32
15k
Navigating Team Friction
lara
190
15k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
49
51k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
Transcript
STP P A N N I N G R O
T O C O L R E E
S S S S S S
S S S S S S
S S S S S S
S S S PC PC To:
S S S PC PC To:
S S S PC PC To:
S S S PC PC To:
S S S PC PC To: To: To: To: To:
To: To: To: To: To: To: To:
S S S PC PC
STP VARIANTS
STP old, do not use RSTP STP, but faster MSTP
does VLANs
STP old, do not use RSTP STP, but faster MSTP
does VLANs You are here.
Designate a root For each switch, find the shortest path
to the root For each cable, determine which end has the shorter path to root On each switch, disable all other ports that lead to root
Switches need to communicate.
Bridge Protocol Data Unit
S S S S
S S S S I am root with priority 2.
S S S S 2 5 4 3 2 3
4 5
S S S S 2 5 4 3 2 3
4 5
S S S S 2 5 4 2 3 4
S S S S 2 5 2 3 4
S S S S 2 2 3 4
S S S S 2 2 3
S S S S 2 2 3
Designate a root For each switch, find the shortest path
to the root For each cable, determine which end has the shorter path to root On each switch, disable all other ports that lead to root ✓
BPDU FORMAT
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B always zero (for classic STP)
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B config topology change topology change ack
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B 2 B priority + 6 B MAC address
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B total “cost” to root 100 MBit/s: 200k 1 GBit/s: 20k
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B 2 B priority + 6 B MAC address
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B physical port of sender
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B hops since initial BPDU from root
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B max TTL
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B interval between periodic config BPDUs
Protocol ID Version Type Flags Root ID Path cost Bridge
ID Port ID Age Max Age Hello Fwd Delay 2 B 1 B 1B 1 B 8 B 4 B 8 B 2 B 2 B 2 B 2 B 2 B time spent learning/listening
Designate a root For each switch, find the shortest path
to the root For each cable, determine which end has the shorter path to root On each switch, disable all other ports that lead to root ✓ ✓ ✓ ✓
SOME TERMINOLOGY
RSTP PORT STATES DISCARDING Only BPDUs are transmitted. LEARNING Like
DISCARDING, but learns MAC addresses. FORWARDING Regular data is transmitted.
RSTP PORT ROLES ROOT Best path to root bridge. DESIGNATED
Points away from root. ALTERNATE Worse (and thus disabled) path to root bridge. BACKUP Leads to same segment as another DESIGNATED port.
ROLE ASSIGNMENTS
S S S S
S S S S 2 3 8 9
S S S S 2 3 8 9 20,000 20,010
10,000 10,000
Designate a root For each switch, find the shortest path
to the root For each cable, determine which end has the shorter path to root On each switch, disable all other ports that lead to root
S S S S 2 3 8 9 20,000 20,010
10,000 10,000
S S S S 2 3 8 9 20,000 20,010
10,000 10,000 root bridge
Designate a root For each switch, find the shortest path
to the root For each cable, determine which end has the shorter path to root On each switch, disable all other ports that lead to root
S S S S 2 3 8 9 20,000 20,010
10,000 10,000 root bridge R R R
Designate a root For each switch, find the shortest path
to the root For each cable, determine which end has the shorter path to root On each switch, disable all other ports that lead to root
S S S S 2 3 8 9 20,000 20,010
10,000 10,000 root bridge R R R D D D D
Designate a root For each switch, find the shortest path
to the root For each cable, determine which end has the shorter path to root On each switch, disable all other ports that lead to root
S S S S 2 3 8 9 20,000 20,010
10,000 10,000 root bridge R R R D D D D A
S S S S 2 3 8 9 20,000 20,010
10,000 10,000 root bridge R R R D D D D A port discarding
DEALING WITH FAILURE
S S S S root bridge S port discarding
S S S root bridge S port discarding I just
lost my root port :’(
S S S root bridge S port discarding Now I
can be root myself \o/
S S S root bridge S port discarding I’m root.
S S S root bridge S port discarding I’m root.
S S S root bridge S port discarding NOPE
S S S root bridge S port discarding NOPE
S S S root bridge S port discarding OK :/
TCN
S S S root bridge S TCN
S S S root bridge S TCN TCN ACK
S S S root bridge S TCN ACK
S S S root bridge S TCN ACK
S S S root bridge S TCN ACK
ALWAYS configure bridge priorities configure path costs if you have
redundant links use RSTP instead of STP
PDU 1 SRV-2 SRV-1 SW-2 SW-4 PDU 2 SW-3 SW-1
SRV-2 SRV-1 SW-2 SW-4 PDU 2 SW-3 SW-1
That’s (R)STP. Further reading: http://blog.ine.com/wp-content/uploads/2010/04/understanding-stp-rstp-convergence.pdf http://blog.ine.com/2010/02/22/understanding-mstp/ Slides: https://speakerdeck.com/trehn/stp