Cara kerja dari STP sendiri adalah melakukan blocking pada salah satu interface dengan begitu hanya akan digunakan satu jalur saja, dan looping dapat diatasi. Dan port yang di block tadi akan menjadi jalur cadangan, jika jalur utama mati atau tidak berfungsi. Spanning Tree Protocol bekerja di layer 2 OSI layer. STP biasa digunakan pada switch, router yang menjalankan mode bridge, serta mulitlayer swicth yang berfungsi sebagai switch.
Pada STP, terdapat istilah Root bridge dan non-Root bridge. Root Bridge merupakan switch yang semua portnya aktif/menyala. Sedangkan Non-Root Bridge adalah switch-switch selain Root Bridge. Jika pada kasus, kita memiliki 2 switch maka, yang menjadi non-Root Bridge adalah switch yang salah satu portnya mati, atau blocking. Pemilihan Root Bridge ini berdasarkan pada priority. Dan yang akan menjadi Root Bridge adalah switch dengan priority terendah. Apabila nilai priority dari beberapa switch memiliki nilai yang sama, maka pemilihan Root Bridge akan dilihat dari nilai MAC Address terendah. Switch yang memiliki nilai MAC Address paling kecil akan menjadi Root Bridge.
Pada STP juga dikenal beberapa port, seperti yang sempat kita singgung diatas. Beberapa jenis port tersebut antara lain :
- Designated Port, yaitu port yang digunakan untuk mengirim data (memiliki MAC address terkecil).
- Root Port, yaitu port pada switch yang terhubung ke Root Bridge.
- Blocking Port, yaitu port yang diblok sehingga menjadi tidak aktif dan tidak digunakan untuk mengirim data. Biasanya blocking port dipilih dari nilai MAC address terbesar, nilai port terbesar, atau port dengan bandwidth terkecil.
```python
SW0#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0006.2A52.7436
Cost 19
Port 2(FastEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0050.0FD4.0413
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2 Root FWD 19 128.2 P2p
Fa0/1 Desg FWD 19 128.1 P2p
SW0#
```
```python
SW1#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0006.2A52.7436
Cost 19
Port 2(FastEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0060.2F14.4813
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Altn BLK 19 128.1 P2p
Fa0/2 Root FWD 19 128.2 P2p
SW1#
```
```python
SW2#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0006.2A52.7436
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0006.2A52.7436
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2 Desg FWD 19 128.2 P2p
Fa0/1 Desg FWD 19 128.1 P2p
SW2#
```

0 comments:
Post a Comment