![]() |
|
|||||||
| 論壇說明 |
|
歡迎您來到『史萊姆論壇』 ^___^ 您目前正以訪客的身份瀏覽本論壇,訪客所擁有的權限將受到限制,您可以瀏覽本論壇大部份的版區與文章,但您將無法參與任何討論或是使用私人訊息與其他會員交流。若您希望擁有完整的使用權限,請註冊成為我們的一份子,註冊的程序十分簡單、快速,而且最重要的是--註冊是完全免費的! 請點擊這裡:『註冊成為我們的一份子!』 |
|
|
主題工具 | 顯示模式 |
|
|
#6 (permalink) | |
|
長老會員
![]() |
引用:
小弟查了一下RFC做一下補充說明: 最先RFC 950因為屬於網路分級classical,IP位址是由 Network ID + Subnet ID + Host ID所構成,路由器判斷封包目的地時會先抓IP的前置位元network prefixes來判斷所屬層級,A級是0xxx、B級是10xx、C級是110x、D級是1110、E級是1111,確認層級後才判斷出Host ID從哪裡開始(Subnet ID為Host ID的最前頭),然後與mask一比(AND計算)才能得知有無切割子網路。 到了RFC 1812第22頁提到: The classical IP addressing architecture used addresses and subnet masks to discriminate the host number from the network prefix. With network prefixes, it is sufficient to indicate the number of bits in the prefix. Both representations are in common use. Architecturally correct subnet masks are capable of being represented using the prefix length description. They comprise that subset of all possible bits patterns that have o a contiguous string of ones at the more significant end, o a contiguous string of zeros at the less significant end, and o no intervening bits. 大意是說:雖然classical與classless二派均有使用,但是後來的classless子網路遮罩已經足以擔任原來前置位元的描述任務,所以子網路ID可以使用「任何型式」!(請留意最後一句話) 這就是小弟所說的陷阱:以一個類似B級網址、classless的表示法,容易讓人產生錯覺,連小弟都上當了…,上面版大的解法應該ok。 此帖於 2007-01-03 10:33 AM 被 rezard 編輯. |
|
|
|
送花文章: 127322,
|