Acquaintance Network Protocols: What is the IP address

In the windows system, we can use ipconfigto see the local IP address.

Here we can see the IP address 192.168.1.7, but when we see your IP address in the browser when they found the IP address and not the same as above:

Here, 101.86.19.217and 192.168.1.7all IP addresses, but the former is a public IP address, which is a private IP address.

That in the end what is an IP address?

By the IP network address and a host address composition, it is 32-bit binary, every eight bits and inserted into a decimal conversion .to improve readability.

website address

The network address is used to identify where the network equipment, the network address is the IP address of the pre-stage. When the organization or enterprise application IP address, the IP address is not available, but get a unique, able to identify the network address. All devices on the same network have the same network address. IP routing function is based on the IP address of the network address, decide to IP packets sent to the specified network.

Host address

After the host address is the IP address segment, used to identify the network device. Equipment will be on the same network have the same network address, and between each device is based on the host address to distinguish.

Because of various sizes each network, large networks should use the shorter web address in order to be able to use more host address; on the contrary, the smaller the network, you should use longer network address. In order to meet the needs of different network size, then the length of the IP in the design, design and divided according to the IP address of the network address.

IP addresses are divided into five categories:

Class A    
0 Network number (7) Host number (24)
Class B      
1 0 Network Number (14) Host Number (16)
Class C        
1 1 0 Network number (21) Host Number (8)
Class D        
1 1 1 0 Multicast group number (28)
Class E          
1 1 1 1 0 Left after use (27)

Common are A, B, C three types of IP address:

category IP address range The maximum number of hosts Private IP address range
A 0.0.0.0-127.255.255.255 16777214 10.0.0.0-10.255.255.255
B 128.0.0.0-191.255.255.255 65534 172.16.0.0-172.31.255.255
C 192.0.0.0-223.255.255.255 254 192.168.0.0-192.168.255.255

IP address of the first host and the last number is not assigned, the maximum number of hosts is host number minus 2 times the square of 2 to Class C, for example: maximum number of hosts 2 = ^ 8--2 = 256--2 = 254.

Private addresses are allocated mainly for the LAN, the Internet is invalid. This well isolated from the local area network and the Internet. Private addresses to the public Internet can not be identified, it must be converted by the NAT internal IP address to the IP address of the public network is available, enabling communication with the external public IP address of the internal network. Public address is the address used in a wide area network, but the same can also be used in the LAN, in addition to the private address of the addresses are public addresses.

But in most cases, we do not have A, B, C three types of addresses, but with no type of inter-domain routing (CIDR) . The so-called CIDR, is to a 32-bit IP address is divided into two, the front is the network number, followed by a host number.

Such as 192.168.1.9/24, there is a slash This format is CIDR. 24 is a back slash means 32, the first 24 bits are the network number, the number 8 is the host. With the presence of CIDR, it is a broadcast address , 192.168.1.255. If you send a message to this address, so all machines of this network (192.168.1) inside can receive. One is the subnet mask , 255.255.255.0. The IP address and subnet mask AND computing, network number can be obtained. 1 and any binary number is the original number of AND, AND 0 is 0 and any number, such as 192 AND 255 = 11000000 AND 11111111 = 11000000 = 192,9 AND 0 = 1001 AND 0 = 0. So know the IP address 192.168.1.9, know the subnet mask 255.255.255.0, you can know the network number is 192.168.1, host number is 9.

So let's first calculate the CIDR address 13.144.163.91/22, subnet mask and broadcast address.

22 is not a multiple of 8, only converted into a binary point of view, the former 16 can not move, i.e. 13.144 unchanged. 10100011 163 becomes required, resolved into <101000> <11>, the network number is 13.144. <101000>, host number is <11> .91. The first address is 13.144. <101000> <00> .1, i.e. 13.144.160.1. The subnet mask is 255.255. <111111> <00> 0.01, that is 255.255.252.0. Broadcast address is 13.144. <101000> <11> .255, i.e. 13.144.163.255.

 

Reference: "Something about network protocol"

Guess you like

Origin www.cnblogs.com/74percent/p/12364682.html