Daftar Pertemuan
STP Tips
- Root Bridge = Lowest Bridge ID
- Bridge ID = Priority + MAC Address
- PortFast untuk access ports
- BPDUGuard proteksi dari loops
STP Port States
Pertemuan 4: STP & RSTP Tuning
Bobot: 8%Tujuan Pembelajaran
Setelah menyelesaikan praktikum ini, mahasiswa mampu:
- Memahami konsep Spanning Tree Protocol (STP) dan loop prevention
- Memanipulasi root bridge election melalui priority adjustment
- Mengkonfigurasi Rapid-PVST+ untuk faster convergence
- Mengoptimalkan jaringan dengan PortFast, BPDUGuard, dan feature lainnya
Materi Teori - Spanning Tree Protocol
1. Konsep Dasar STP
Spanning Tree Protocol (STP) adalah protocol layer 2 yang mencegah bridging loops dalam jaringan Ethernet dengan redundant paths.
- Frame diduplikasi secara tak terbatas
- MAC address table corruption
- Network performance degradation
- Complete network failure
- Membuat loop-free logical topology
- Block redundant paths secara otomatis
- Provide backup paths untuk redundancy
- Maintain network stability
2. STP Operation dan Algorithm
STP bekerja melalui tiga langkah utama untuk membentuk loop-free topology:
Switch dengan lowest Bridge ID menjadi Root Bridge
Lower Priority = Better
Same Priority = Lower MAC
Setiap non-root bridge memilih port terdekat ke Root Bridge
2. Lowest Sender BID
3. Lowest Port ID
Satu designated port per segment untuk forwarding traffic
- Root Bridge: All DP
- Others: One DP
3. STP Port States dan Timers
Setiap port dalam STP melewati beberapa state sebelum mencapai forwarding state:
Disabled
Blocking
Listening
Learning
Forwarding
STP Timers Default Values:
| Timer | Default Value | Function |
|---|---|---|
| Hello Time | 2 seconds | BPDU transmission interval |
| Forward Delay | 15 seconds | Listening + Learning states |
| Max Age | 20 seconds | BPDU maximum storage time |
Total Convergence Time:
Listening → Learning: 15s (Forward Delay)
Learning → Forwarding: 15s (Forward Delay)
Total: 50 seconds
Root Port Change: 30-50 seconds
Direct Link Failure: 30 seconds
Indirect Link Failure: 50 seconds
4. STP Variants dan Evolusi
Beberapa versi STP yang dikembangkan untuk meningkatkan performance dan features:
| Protocol | Convergence | VLAN Support | Standard | Key Features | Recommendation |
|---|---|---|---|---|---|
| STP | 30-50 seconds | Single Instance | 802.1D | Original standard | Not recommended |
| PVST+ | 30-50 seconds | Per-VLAN | Cisco | VLAN load balancing | Legacy |
| RSTP | 1-2 seconds | Single Instance | 802.1w | Rapid convergence | Small networks |
| Rapid-PVST+ | 1-2 seconds | Per-VLAN | Cisco | Fast + VLAN awareness | Recommended |
| MSTP | 1-2 seconds | Multiple Instances | 802.1s | Scalable for large networks | Enterprise |
5. STP Optimization Features
Berbagai feature untuk mengoptimalkan STP operation dan security:
Immediately transitions access ports to forwarding state
spanning-tree portfast
Disables port if BPDU received on PortFast port
spanning-tree bpduguard enable
Prevents BPDU transmission on specified ports
spanning-tree bpdufilter enable
Fast convergence when primary uplink fails
Reduces convergence time for indirect link failures
Job Sheet Praktikum
Informasi Job Sheet
Optimasi jaringan dengan STP & RSTP
Cisco Packet Tracer
8%
Laporan Praktikum
Diagram Topologi STP dengan Redundant Links
Switch A
Switch B
Switch C
Keterangan Topologi:
- 3 Switch Cisco 2960 dengan redundant links
- Switch A: Root Bridge (Priority 4096)
- Switch B: Secondary Root (Priority 8192)
- Switch C: Non-Root (Priority 32768)
- Port Roles: Root (R), Designated (D), Alternate (A)
- Redundant Links: Multiple paths create potential loops
- STP Optimization: PortFast, BPDUGuard pada access ports
STP Configuration Plan
| Switch | Priority | Expected Role | Root Port | Designated Ports | Blocked Ports |
|---|---|---|---|---|---|
| Switch A | 4096 | Root Bridge | - | All Ports | - |
| Switch B | 8192 | Designated Bridge | Fa0/1 | Fa0/2, Fa0/4 | Fa0/3 |
| Switch C | 32768 | Non-Root Bridge | Fa0/1 | Fa0/3, Fa0/4 | Fa0/2 |
Port Connections Plan
| Connection | Ports | Link Type | Expected STP State |
|---|---|---|---|
| Switch A ↔ Switch B | Fa0/1 - Fa0/1 | Trunk | Forwarding (Both) |
| Switch A ↔ Switch C | Fa0/2 - Fa0/1 | Trunk | Forwarding (Both) |
| Switch B ↔ Switch C | Fa0/2 - Fa0/2 | Trunk | Forwarding (B) / Blocking (C) |
| PC Connections | All Fa0/3-4 | Access | Forwarding (With PortFast) |
Langkah Kerja Detail
Buat topologi loop dengan redundant links dan konfigurasi trunking:
Physical Connections:
- SwitchA Fa0/1 ↔ SwitchB Fa0/1
- SwitchA Fa0/2 ↔ SwitchC Fa0/1
- SwitchB Fa0/2 ↔ SwitchC Fa0/2
- PC1-2 → SwitchA Fa0/3-4
- PC3-4 → SwitchB Fa0/3-4
- PC5-6 → SwitchC Fa0/3-4
Trunk Configuration:
configure terminal
interface range fastethernet 0/1-2
switchport mode trunk
switchport trunk native vlan 99
no shutdown
exit
Pastikan:
- Semua trunk ports dalam mode trunk
- Native VLAN konsisten (VLAN 99)
- STP aktif secara default (mencegah loops)
Analisis bagaimana STP bekerja secara default tanpa konfigurasi manual:
STP Status Check:
show spanning-tree
show spanning-tree summary
show spanning-tree root
! Identifikasi root bridge default
show spanning-tree vlan 1
show spanning-tree bridge
Expected Observations:
- Satu switch menjadi Root Bridge (lowest MAC)
- Satu port blocked per loop (Alternate role)
- Root Ports selected berdasarkan path cost
- Designated Ports pada setiap segment
Document Default Root Bridge:
Root Hello Max Fwd
Vlan Root ID Cost Time Age Dly Root Port
VLAN0001 32769 0011.bb0b.3600 19 2 20 15 Fa0/1
Manipulasi STP untuk memilih root bridge sesuai design plan:
Switch A sebagai Primary Root:
configure terminal
! Method 1: Primary root command
spanning-tree vlan 1 root primary
! Method 2: Manual priority
spanning-tree vlan 1 priority 4096
! Verifikasi
show spanning-tree vlan 1
show spanning-tree root
Switch B sebagai Secondary Root:
configure terminal
! Method 1: Secondary root command
spanning-tree vlan 1 root secondary
! Method 2: Manual priority
spanning-tree vlan 1 priority 8192
! Switch C biarkan default
show spanning-tree vlan 1
! Priority tetap 32768
Priority Values:
- 0-61440: Configurable values (increments of 4096)
- 32768: Default priority
- 4096: Typical root bridge priority
- 8192: Typical secondary root priority
Upgrade dari STP ke Rapid-PVST+ untuk faster convergence:
configure terminal
! Aktifkan Rapid-PVST+
spanning-tree mode rapid-pvst
! Verifikasi RSTP convergence
show spanning-tree
show spanning-tree interface fa0/1 detail
show spanning-tree summary
! Perhatikan perbedaan state
show spanning-tree vlan 1
! Look for "RSTP" in output
RSTP Port States vs STP:
| STP State | RSTP State | Convergence Time |
|---|---|---|
| Blocking, Listening | Discarding | Immediate |
| Learning | Learning | Forward Delay |
| Forwarding | Forwarding | Immediate |
Konfigurasi optimasi untuk access ports dengan PortFast dan BPDUGuard:
PortFast Configuration:
configure terminal
interface range fastethernet 0/3-4
spanning-tree portfast
! Port immediately goes to forwarding
exit
! Global PortFast (optional)
spanning-tree portfast default
BPDUGuard Configuration:
interface range fastethernet 0/3-4
spanning-tree bpduguard enable
! Port shuts down if BPDU received
exit
! Global BPDUGuard (alternative)
spanning-tree portfast bpduguard default
BPDUFilter (Optional):
spanning-tree bpdufilter enable
! Prevents BPDU transmission
exit
Verification:
show spanning-tree summary
show interfaces status | include err-disabled
Konfigurasi advanced features untuk optimasi tambahan:
UplinkFast dan BackboneFast:
spanning-tree uplinkfast
! Fast convergence for uplink failure
! BackboneFast pada semua switch
spanning-tree backbonefast
! Reduces convergence for indirect failures
Path Cost dan Port Priority:
interface fastethernet 0/1
spanning-tree cost 1700000
! Make path less preferred
exit
! Manipulasi port priority
interface fastethernet 0/2
spanning-tree port-priority 0
exit
Lakukan comprehensive testing untuk memverifikasi STP operation:
STP Verification:
show spanning-tree root
show spanning-tree vlan 1
! Test convergence time
! Putus link antara Switch A dan Switch B
! Ukur waktu convergence dengan ping
ping 192.168.1.10 -t
! Ganti dengan IP PC yang sesuai
BPDUGuard Testing:
! Coba hubungkan switch lain ke port dengan BPDUGuard
! Amati port status (harus error-disable)
! Recovery dari error-disable
interface fa0/3
shutdown
no shutdown
exit
Convergence Time Measurement:
| Scenario | STP Convergence | RSTP Convergence |
|---|---|---|
| Direct Link Failure | 30 seconds | 1-2 seconds |
| Indirect Link Failure | 50 seconds | 1-2 seconds |
| Root Bridge Change | 50 seconds | 1-2 seconds |
Kriteria Penilaian
| Kriteria | Indikator | Bobot | Status |
|---|---|---|---|
| Root Bridge Manipulation | Root bridge berhasil dimanipulasi sesuai plan dengan priority yang tepat | 2.5% | Check |
| RSTP Implementation | Rapid-PVST+ berhasil diimplementasikan dan diverifikasi | 2.0% | Check |
| PortFast & BPDUGuard | PortFast dan BPDUGuard terkofigurasi dengan benar pada access ports | 1.5% | Check |
| Convergence Analysis | Convergence time terukur dan dianalisis (STP vs RSTP comparison) | 1.0% | Check |
| Advanced Features | UplinkFast, BackboneFast, dan path cost manipulation berfungsi | 0.5% | Check |
| Troubleshooting | Mampu identifikasi dan selesaikan STP-related issues | 0.5% | Check |
| Total | 8% | Complete | |
Tips dan Best Practices STP
- Selalu gunakan BPDUGuard pada PortFast ports untuk mencegah STP manipulation attacks
- Implementasi Root Guard pada ports yang tidak seharusnya menjadi root bridge
- Gunakan Loop Guard untuk mencegah alternate ports menjadi designated karena BPDU loss
- Monitor untuk BPDU rate limiting attacks
- Selalu manually configure root bridge priorities daripada mengandalkan MAC address
- Gunakan Rapid-PVST+ daripada legacy STP untuk faster convergence
- Implementasi PortFast hanya pada access ports yang terhubung ke end devices
- Documentasikan STP topology dan expected port roles
Common STP Issues and Solutions:
- Network loops: Verifikasi STP operation dan port states
- Slow convergence: Upgrade ke RSTP atau optimasi timer
- Unstable root bridge: Configure manual root bridge priorities
- BPDU filtering issues: Pastikan BPDUFilter tidak menyebabkan loops