Try   HackMD

802.1D - Loop Problems

Loop Problem

在架設 LAN 時,有迴圈的話可以讓架設流程比較順利,而且兩個節點間的不同路徑,也可以作為彼此的「備用」路線,增加網路的可靠度。不過,有環表示可能有 LAN 會同時與一個 Bridge 的兩個端口相連(不管直接或間接),這就會造成兩個問題:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

問題一:重複的封包轉送

最直接可以發現的是:

B 重複收了兩次
A
送來的封包。這是因為
X
Y
都跟
A
直接相連,所以他們都收到了
A
的封包。假設他們一開始都不知道
B
在哪,那
X
Y
都會廣播這個封包,所以這個封包就被廣播了兩次,使得
B
收了兩次同樣的封包。

問題二:學到錯誤的位址

除此之外,

X 在廣播封包時,
Y
的 1 號端口也會收到這個從
A
來的封包。這就會使
Y
以為要往自己的 1 號端口才能送到
A
,儘管這是更遠的路。類似地,
X
也可能收到
Y
廣播的封包,因此也會以為
A
要往自己的 2 號端口走。

這個乍看之下也算合理,因為實際上

A 確實跟這兩個端口「間接」相連。但是當
B
要送給
A
封包時,問題就會出現了。
X
Y
都會以為
A
B
都在自己上方的 LAN,所以
B
的封包就無法被轉送到下方的
A
去:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

解法:除掉迴圈直到變成一棵生成樹

而解決這個問題的方法就是:除去迴圈上的某些邊,直到所有 LAN 與 bridge 之間形成一棵樹。因為變成一棵樹,所以樹上的任二節點間有唯一的路徑,因此兩點間要送封包,就只能按著那條唯一路徑送。對於任意 bridge,一個 MAC address 只會從唯一的 port 來。

「除去某些邊」在 bridge 上的效果就是「暫停使用某些端口」。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

課程影片

第 4E 講 IEEE 802.1D 交換機的擴張樹演算法 (Spanning Tree Algorithm) L01 5

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →