<>IP the address is ? effect
IP the address is IP A unified address format provided by the protocol , It assigns a logical address to each network and host on the Internet , To shield the difference of physical address . common IP address , Divided into IPv4 And IPv6 Two categories
IPv4 The address is expressed in dotted decimal ,X.X.X.X (X It means a 10 Base ） example ：192.168.1.1
every last X Corresponding to 8 Binary , Count Reg 32 bit; every last X corresponding 1 Bytes ;X The value range is 0 --255 ;
structure ： Network bit + Host bit
IP Address is used to uniquely identify an online device within a certain range ;（ All devices that need internet access , Must have IP address ）
<>IP Address classification （IPv4）
IP Addresses fall into five categories , The number of addresses that can be accommodated is different ：
A Class reserved for government agencies （0.0.0.0 reach 127.255.255.255）
B Class assigned to medium-sized companies （220.127.116.11 reach 18.104.22.168）
C Class is assigned to anyone who needs it （192.0.0.0 reach 22.214.171.124）
D Class for multicast （126.96.36.199—188.8.131.52）
E Class for experiments （240.0.0.0—247.255.255.255）
A,B,C Among the three categories IP address = network address + Host address , and D,E The two types do not distinguish between network address and host address
Special instructions ：
（1）A In class 10.X.X.X Is a private address ;127.X.X.X Is a reserved address
（2）B In class 172.16.0.0~172.31.255.255 Is a private address
（3）C In class 192.168.X.X Is a private address
<> Subnet mask
Network address can be simply understood as network segment , The host address is the address of the corresponding different hosts in the network segment .
Subnet mask is used to distinguish IP Network bit and host bit in address , Must be with IP address , One to one correspondence , Appear in pairs ;
Subnet mask and IP The same address is 32 Bit address , Then IP The network address can be obtained by summing the address and subnet mask （ Network segment ）.
In subnet mask 1 Corresponding IP Bits in address , Call it network bit ;
In subnet mask 0 Corresponding IP Bits in address , Called host bit .
Subnet mask characteristics ：
* And IP Address to address correspondence ;
* 1 and 0 Always continuous , Will not cross ;
* Always on the left 1, Always on the right 0;
e.g. IP Address is 192.168.10.2, Subnet mask is 255.255.255.240. Binary representation ： IP address ： 11000000 10101000
00001010 00000010 Subnet mask ： 11111111 11111111 11111111
11110000（ indicate IP Address before 28 Bit indicates network bit , after 4 Bit is host bit ） IP The address and mask are summed ： 11000000 10101000 00001010
00000000 So this IP The network where the address is located is 192.168.10.0, Host ID is 2.
An address ：XX.XX.XX.128/25,/25 Is another form of mask , Indicates continuous 25 individual 1, Remaining use 0 Supplement .
（1） Host number ： Host number + network number =32,32-25=7
（2） network address ： When 7 Bit host numbers are all 0, that is XX.XX.XX.128
（3） Broadcast address ： When 7 Bit host numbers are all 1, that is XX.XX.XX.255
（4） Number of available addresses ：7 Bit host number yes 2 7 2^7 27 Kinds of results , But remove the network address and broadcast address , Namely ： 2 7 − 2 = 126 2^7-2=126 27−2=
126, That is, there can be 126 Hosts .