查看單個文章
舊 2007-01-03, 09:56 AM   #7 (permalink)
rezard 帥哥
長老會員
 
rezard 的頭像
榮譽勳章
UID - 5875
在線等級: 級別:41 | 在線時長:1895小時 | 升級還需:37小時級別:41 | 在線時長:1895小時 | 升級還需:37小時級別:41 | 在線時長:1895小時 | 升級還需:37小時級別:41 | 在線時長:1895小時 | 升級還需:37小時級別:41 | 在線時長:1895小時 | 升級還需:37小時級別:41 | 在線時長:1895小時 | 升級還需:37小時
註冊日期: 2002-12-08
住址: 夢幻之島福爾摩沙
文章: 4595
精華: 0
現金: 258 金幣
資產: 25680236 金幣
預設

引用:
作者: rezard
如果小弟記得沒錯的話...
最初的規範切割二個子網路是違規的
因為去頭去尾就沒有可用的子網了
最少要切成四個 去頭去尾剩下二個
後來新規範才可以的樣子...

這一題 25bits 難道有陷阱...
對不起,沒看清楚IP,所以必須重算了一下~~

小弟查了一下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 編輯.
__________________
【詠螢】
的歷流光小,飄颻弱翅輕。恐畏無人識,獨自暗中明。
[IMG][/IMG]
rezard 目前離線  
送花文章: 127322, 收花文章: 3952 篇, 收花: 21079 次
回覆時引用此帖