IPv6 地址的 tentative 狀態

rfc4862 裏有詳細描述, IPv6 地址處在這種狀態時,地址的唯一性還沒有確定,
收到的包都會被丟棄。 一個客戶遇到過這樣的問題,板子上的網絡接口在某種情況
下會 down 再 up,此時有一個UDP數據報被丟棄了, 就是因爲 IP 地址處在
tentative 狀態。

tentative address - an address whose uniqueness on a link is being
verified, prior to its assignment to an interface. A tentative
address is not considered assigned to an interface in the usual
sense. An interface discards received packets addressed to a
tentative address, but accepts Neighbor Discovery packets related
to Duplicate Address Detection for the tentative address.

因此在address 類型爲 tentative address 時,丟棄除了Neighbor Discovery的包是正常的。 根據該RFC,網絡接口重啓後,
爲了避免網絡擁塞,不能立即發送Neighbor Discovery 或DAD,而是要延遲一段隨機時間, 這個時間值在0 到 MAX_RTR_SOLICITATION_DELAY 
之間。 所以,如果發包延遲到 MAX_RTR_SOLICITATION_DELAY 之後,理論上就可以避免tentative 狀態。 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章