计算机网络怎么寻址
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.11100000
255. 255. 255. 240
Mask 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/28
Mask value :255.255.255.240
In 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
计算机网络怎么寻址