cidr addresses

CIDR a "network prefix" classification of various lengths instead of a network address and a subnet ID number, the format: IP address = {<network prefix> <host number>}. In order to distinguish the network prefix, usually a "slash notation" (CIDR notation), i.e., the IP address / prefix of the number of occupied bits networks. For example: 192.168.24.0/22 ​​represented by 32-bit address, the first 22-bit network prefix, and after 10 (32-22 = 10) bits represent the host number. In the conversion, 192.168.24.0 / 22 corresponding to binary is:

1100 0000(192),1010 1000(168),0001 1000(24),0000 0000(0)

                    

The red is the host number, a total of 10. When the 10 bits are all zero, taking the smallest address 192.168.24.0, when it is full 10 1, taking the maximum address 192.168.27.255. Note, however, in practice, the host number are all 0 or all 1 addresses are generally not used, as otherwise address the role reserved. Therefore, the first address 1100 0000,1010 10000,0001 10 00,0000 0001 , i.e., the last address of 192.168.24.1: 0000,1010 10000,0001 101 1100 1,1111 1110 , i.e. 192.168.27.254

 

Accordingly, in the present embodiment the third paragraph of the address data minimum is 00011000 (24), the maximum is 00011011 (27) , the fourth paragraph in the address data minimum of 0000 0001 (1), a maximum of 1111 1110 (254) , above the brackets data in decimal, binary front. Therefore, in the present embodiment corresponding to the address 192.168.24.0/22 segment 192.168.24.1-192.168.27.254, a total of four segments.

Guess you like

Origin www.cnblogs.com/liangxiyang/p/11628000.html