# 網路大小事

## 關於STP

Spanning Tree Protocol (STP) 是Layer 2 的 Protocol，一般在 Switch 上執行，主要目的是防止 Switch 在連接時產生 Switching Loop。STP 是在學習網路知識中一個重要的部份，需了解其運作原理和操作。

![](https://529150212-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lh81JtaIQ84bwQqz_Wh%2F-Lu6WvkgxRkT8KsLPWKr%2F-Lu6Y71AdtBF-NBLueOa%2FSTP.png?alt=media\&token=8cad1d03-fae5-4154-9aff-36d40a7f279c)

PC1 要傳送資料給 PC2,但 PC1 的 ARP Table 裡沒有 PC2 的 MAC Address，因此 PC1 送出一個 Broadcast ARP Request 想找出 PC2 的 MAC Address。這個 Broadcast 送到 SW1，由於 SW1 在 Fa0/3 收到 Broadcast，所以它會把 Broadcast 經由 Fa0/1 和 Fa0/2 送出去。同樣地,SW2 在 Fa0/1 收 到後會在 Fa0/2 送出去，而 SW3 在 Fa0/2 收到後， 就在 Fa0/1 和 Fa0/3 送出去，於是 SW2 和 SW1 又 收到來自 SW3 的 Broadcast,然後它們也照樣在另一個出口送出,於是 Broadcast 會不停地被重覆輸送,這就稱為 Broadcast Storm（廣播風暴）,會造成 Switching Loop 的問題。解決 Broadcast Storm 的方法是把網路中其中一條連線斷開,阻止 Broadcast 在網路上繞圈圈。問題是究竟斷開那一條連線好呢?各個 Switch 應該要有一致的共識，所以就有了 STP 這個機制,讓所有 Switch 溝通那些 port 要傳送資料,那些 port 應該休息不要傳送資料。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/andoid-shou-ji/wang-lu-da-xiao-shi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
