STP & RSTP: “Polisi Lalu Lintas” di Jaringan Switch yang Mencegah Kekacauan

Bayangkan ini:
Kalau punya multiple switch yang saling terhubung, tanpa STP/RSTP seperti punya persimpangan tanpa lampu lalu lintas – pasti tabrakan dan kemacetan!

🔍 APA ITU STP & RSTP?

STP = Spanning Tree Protocol
RSTP = Rapid Spanning Tree Protocol

  • Analoginya: STP seperti lampu lalu lintas manual, RSTP seperti lampu cerdas dengan sensor

  • Fungsi: Mencegah switching loops di jaringan Layer 2

  • Tujuan: Membuat loop-free topology sambil tetap menjaga redundancy

Masalah Tanpa STP:

SW1 ↔ SW2 ↔ SW3 ← Terbentuk loop!
↓
Broadcast storm ⚡
MAC table corruption 💥
Network collapse 🔥

⚡ MENGAPA BUTUH STP/RSTP?

Scenario: Redundant Links

[PC1]--[SW1]====[SW2]--[PC2]
         \      /
          \    /
           [SW3]

Tanpa STP: Frame berputar-putar selamanya!
Dengan STP: Satu link di-block untuk cegah loop!

🎯 CARA KERJA STP (Spanning Tree Protocol)

Step 1: Root Bridge Election

Switch dengan Bridge ID terkecil menjadi "RAJA"
Bridge ID = Priority + MAC Address
↓
[SW1] ← Root Bridge (Priority 32768)
[SW2] ← Non-Root Bridge  
[SW3] ← Non-Root Bridge

Step 2: Port Role Assignment

Root Ports (RP)    ← Port menuju Root Bridge
Designated Ports (DP) ← Port yang forward traffic
Blocked Ports      ← Port yang di-block untuk cegah loop

Step 3: Topology Convergence

[SW1] (Root Bridge)
  │DP
[SW2]
  │RP    │DP (Blocked) ← DI-BLOCK!
[SW3]═══[SW4]

Proses STP Lambat: 30-50 detik untuk convergence! 🐢

🚀 RSTP (Rapid STP) – STP yang Lebih Cepat

Perbaikan RSTP:

  • Convergence time: 2-5 detik (vs 30-50 detik STP)

  • Port states lebih sederhana

  • Backup port concept

  • Proposal/Agreement mechanism

Perbandingan Port States

STP StatesRSTP StatesKeterangan
BlockingDiscardingTidak forward traffic
ListeningDiscardingSama seperti blocking
LearningLearningBelajar MAC addresses
ForwardingForwardingNormal operation

🔧 PORT ROLES & STATES

STP Port Roles:

  1. Root Port – Menuju root bridge

  2. Designated Port – Forward traffic

  3. Blocking Port – Di-block untuk cegah loop

  4. Disabled Port – Administratively down

RSTP Additional Roles:

  1. Alternate Port – Backup untuk root port

  2. Backup Port – Backup untuk designated port

📊 STP vs RSTP HEAD-TO-HEAD

 
 
ParameterSTP (802.1D)RSTP (802.1w)
Convergence30-50 detik2-5 detik
Port States5 states3 states
Backup PortsTidak adaAlternate & Backup
CompatibilityStandardBackward compatible
ComplexitySimpleLebih complex

🎯 ROOT BRIDGE ELECTION PROCESS

Step-by-Step Election:

  1. Compare Priority (default 32768) – Lebih kecil menang

  2. Compare MAC Address – Lebih kecil menang

  3. Port Priority/Port ID – Jika masih sama

Contoh:

SW1: Priority 32768 + MAC 00:11:22:33:44:55
SW2: Priority 32768 + MAC 00:11:22:33:44:66
↓
SW1 MENANG! ← MAC address lebih kecil

🛠️ KONFIGURASI PRAKTIS

Cisco STP Configuration:

bash
! Enable STP
 spanning-tree mode pvst
 
! Set root bridge priority
 spanning-tree vlan 1 priority 4096
 
! Set port cost
 interface GigabitEthernet1/0/1
 spanning-tree cost 19
 
! PortFast untuk access ports
 spanning-tree portfast

Cisco RSTP Configuration:

bash
! Enable RSTP
 spanning-tree mode rapid-pvst
 
! Optional: tune timers
 spanning-tree hello-time 1
 spanning-tree forward-time 4
 spanning-tree max-age 6

🚨 COMMON STP ISSUES & SOLUTIONS

1. Root Bridge Terpilih Salah

Problem: Switch tua jadi root bridge
Solution: Manual set root bridge priority

bash
spanning-tree vlan 1 priority 8192

2. STP Convergence Lambat

Problem: Network down 30+ detik saat failover
Solution: Migrate ke RSTP

bash
spanning-tree mode rapid-pvst

3. PortFast Related Issues

Problem: Loops karena PortFast di trunk port
Solution: BPDU Guard protection

bash
spanning-tree portfast
spanning-tree bpduguard enable

🛡️ STP SECURITY FEATURES

1. BPDU Guard

bash
! Block BPDU di access ports
spanning-tree bpduguard enable

2. Root Guard

bash
! Cegah root bridge takeover
spanning-tree guard root

3. Loop Guard

bash
! Deteksi unidirectional links
spanning-tree loopguard default

🌍 REAL-WORLD SCENARIOS

Scenario 1: Campus Network

[Core Switch] ← Root Bridge
    │    │
[Building A] [Building B]
    │    │
[Floor 1] [Floor 2] ← Automatic blocking jika ada loop

Scenario 2: Data Center

[Spine 1]══[Spine 2]
   │  \      /  │
[Leaf 1] [Leaf 2] ← RSTP untuk fast convergence

Scenario 3: Office Network

[Main Switch] ← Root Bridge
   │     │
[SW A]  [SW B] ← Satu link aktif, satu standby
   │     │
[Users] [Users]

🔧 TROUBLESHOOTING COMMANDS

Show STP Status:

bash
show spanning-tree summary
show spanning-tree vlan 1
show spanning-tree interface Gi1/0/1
show spanning-tree root

Debug STP Issues:

bash
debug spanning-tree events
show logging | include STP
show spanning-tree inconsistentports

📈 BEST PRACTICES DEPLOYMENT

1. Manual Root Bridge Selection

bash
! Jadikan core switch sebagai root
spanning-tree vlan 1-4094 priority 8192

2. Enable PortFast + BPDU Guard

bash
! Untuk semua access ports
interface range Gi1/0/1-24
 spanning-tree portfast
 spanning-tree bpduguard enable

3. Use RSTP Instead of STP

bash
! Untuk faster convergence
spanning-tree mode rapid-pvst

4. Tune STP Timers (Jika Perlu)

bash
! Hati-hati! Hanya jika diperlukan
spanning-tree hello-time 1
spanning-tree forward-time 4

🚀 MIGRATION STP → RSTP

Step-by-Step Migration:

  1. Backup configuration existing STP

  2. Verify topology dan root bridge placement

  3. Enable RSTP di semua switch

  4. Monitor convergence selama maintenance window

  5. Verify operation dengan test failover

Migration Command:

bash
! Dari STP ke RSTP
 spanning-tree mode rapid-pvst

🎮 VISUALIZATION STP/RSTP IN ACTION

Before STP:

[SW1] ↔ [SW2] ↔ [SW3] ← BROADCAST STORM! 💥
Frame berputar-putar selamanya
Network crash dalam hitungan detik

After STP:

[SW1] (Root Bridge)
  │DP
[SW2]
  │RP    │DP (Blocked) ← AMAN! ✅
[SW3]═══[SW4]

After Link Failure:

[SW1] (Root Bridge)
  │DP
[SW2]
  │RP    │DP (Now Forwarding) ← AUTO FAILOVER! 🔄
[SW3]═══[SW4] (Link SW2-SW3 down)

 

💡 FUN FACTS STP/RSTP

  1. Ditemukan 1985 oleh Radia Perlman – “Idea for a homework!”

  2. STP algorithm disebut “spanning tree” dari graph theory

  3. BPDU = Bridge Protocol Data Unit – “Bahasa” STP

  4. RSTP bisa 100x lebih cepat dari STP!

  5. Modern networks pakai RSTP atau MST (Multiple STP)

🌟 KESIMPULAN

STP adalah: Foundation jaringan switched – sederhana tapi powerful
RSTP adalah: STP yang dipercepat – untuk modern networks

Gunakan STP ketika:

  • ✅ Network kecil & sederhana

  • ✅ Legacy equipment

  • ✅ Tidak butuh fast convergence

Gunakan RSTP ketika:

  • ✅ Network medium to large

  • ✅ Butuh fast failover (<5 detik)

  • ✅ Modern switches support

Ingat: Tanpa STP/RSTP, jaringan switched Anda seperti kota tanpa lampu lalu lintas – chaos guaranteed! 🚦

Tinggalkan Balasan

More Articles & Posts