计算机网络怎么寻址_计算机网络中的无类寻址
計算機網絡怎么尋址
To reduce the wastage of IP addresses in blocks we subnetting. But in Classless addressing wastage of IP addresses in a block is more reduced than Classful subnetting. In this variable length, blocks are used that belongs to no class.
為了減少塊中IP地址的浪費,我們進行了子網劃分。 但是在無類別尋址中 ,與有類別子網劃分相比,減少了塊中IP地址的浪費。 在此可變長度中,將使用不屬于任何類的塊。
Properties:
特性:
Addresses in a block must be in contiguous form
塊中的地址必須為連續形式
The number of address in a block must be the power of 2 i.e. 2, 4, 8, 16,...
塊中的地址數必須為2的冪,即2、4、8、16 ...
The first address must be evenly divisible by the number of addresses.
第一個地址必須能被地址數平均整除。
Representation:
表示:
In Classless addressing a block, IP address is given like 192.168.10.1/28 (after "/" number of the mask bit is given).
在無類尋址塊中 ,IP地址的給出類似于192.168.10.1/28 (在給出掩碼位的“ /”號之后)。
We can find a mask for the whole block by putting the given after of bits out of 32 as 1 and rest of the bits as 0.
通過將32位中給定的after位設為1并將其余位設為0,可以找到整個塊的掩碼。
Here, we have 28 bits. So, we need to put 28 bits out of 32 bits as 1 and rest of bits as 0 will give us the mask for the Ip address block.
在這里,我們有28位。 因此,我們需要將32位中的28位設為1 ,其余位設為0,這將為我們提供Ip地址塊的掩碼。
11111111.11111111.11111111.11100000255. 255. 255. 240Mask is 255.255.255.240
遮罩為255.255.255.240
Note: The given address is not necessarily the first IP address of the block.
注意:給定的地址不一定是該塊的第一個IP地址。
Important points:
要點:
To get the first IP address of the block set the rightmost (32 - n) bits to 0s.
要獲取該塊的第一個IP地址,請將最右邊的(32-n)位設置為0s。
Last IP address of the block can be found by setting the rightmost bits to 1s.
通過將最右邊的位設置為1,可以找到塊的最后一個IP地址。
Number of IP addresses of the given block can be found by 232 - n.
給定塊的IP地址數量可以通過2 32 -n找到。
Example:
例:
192.168.12.30/28Mask value :255.255.255.240In the above example, if we want to find the first address of the given block then have to put 0 to set a rightmost bit of the given IP.
在上面的示例中,如果要查找給定塊的第一個地址,則必須將0設置為給定IP的最右邊一位。
To make is easy to convert only the last octet into binary and then set 1 or 0 accordingly and rest will remain the same.
制作很容易,只需將最后一個八位位組轉換為二進制,然后相應地設置1或0,其余的將保持不變。
Binary of 30 = 11110
30的二進制數= 11110
Hence, the first IP address of the block is 192.168.12.16 (Satisfying Property no. 3).
因此,該塊的第一個IP地址是192.168.12.16 (滿足3號屬性)。
Again, to get the last IP address of the block we have to replace all the rightmost bit to 1, 192.168.12.00011110
同樣,要獲取塊的最后一個IP地址,我們必須將所有最右邊的位替換為1 192.168.12.00011110
After replacing all the rightmost bits to 1 we obtain 192.168.12.00011111 i.e. 192.168.12.31
將所有最右邊的位替換為1后,我們獲得192.168.12.00011111,即192.168.12.31
Suggestion: To understand this topic please go through the previous topic i.e. FLSM and VLSM in Computer Networks
建議:要了解此主題,請遍歷上一主題,即計算機網絡中的FLSM和VLSM
翻譯自: https://www.includehelp.com/computer-networks/classless-addressing-in-computer-networks.aspx
計算機網絡怎么尋址
總結
以上是生活随笔為你收集整理的计算机网络怎么寻址_计算机网络中的无类寻址的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python里x.pow2_带有Pyth
- 下一篇: 输入输出数组元素的函数重载_C ++函数