Network Communications Basics 5

1, IP address classification (IPv4)

(1), IP address is actually a 32-bit binary configuration, in the network communication packet is 32-bit binary, it is used in the interactive display decimal points.

Source IP address: IP address of the network sent a data packet

IP address of the computer to receive the packet: destination IP address

Binary mode: 0xffffffff 0xC0A80166

Dotted decimal: 255.255.255.255 192.168.1.102

(2), the IP address 32 actually comprises two parts, namely, network address and host address. The subnet mask is used to describe the network and host addresses each accounting for how much bit

Address = IP address of the network host address +

Network address used to represent the subnet

Host address is used to indicate a particular subnet host

 

              8 indicates that the network can for example, that the host 24

              16 may also represent a network, said the host 16

              14 may represent a network, 18 denotes a host

When a front subnet mask of 255.255.255.0 is the network address 24, the 8-bit host address

When the subnet mask 255.255.0.0 represents the first 16 bits of the network address, the 16-bit host address

Internet address determines which network will be able to have a number of networks, such as the subnet mask is 255.255.255.0 express our total in a network can have up to 2 ^ 24, each network can have 2 ^ 8 hosts.

If the subnet mask is 255.255.0.0 represents our total in a network can have up to 2 ^ 16, each network can have 2 ^ 16 hosts.

(3), by the network address and the host address number of different bits are accounted for, the IP address is divided into five categories, there are three most common classes: A, Class B, C class. In addition there are 127.0.0.0 is used for the loopback test loopback.

 Class A IP address 
 
  A class A IP address of a network address and byte 3 byte consisting host address, the network address of the most significant bit must be "0", ranging from 1.0.0.0 to the address 126.0.0.0. A network has available Class 126, each network can accommodate more than 100 million hosts. 
 
Class B IP addresses 
 
  Class B IP address consists of two bytes of network and host addresses composed of 2 bytes, the maximum bit network address must be "10", the address range from 128.0.0.0 to 191.255.255.255. Class B network has the available 16382, each network can accommodate more than 60,000 hosts. 
 
Class C IP addresses 
 
  A Class C IP address of 3 bytes of network and host addresses composed of 1 byte, the most significant bit network address must be "110." Ranging from 192.0.0.0 to 223.255.255.255. Class C up to 209 million a network, each network can accommodate 254 hosts. 

 

2, how to determine whether two IP addresses in the same subnet

(1), network identification address = IP Subnet Mask &

(2), the network identifies two IP addresses the same, then it is in the same network.

Computer 1: IP Address: 192.168.1.102 Subnet Mask: 255.255.255.0 192.168.1.102 & 255.255.255.0 = 192.168.1.0

Computer 2: IP Address: 192.168.1.253 Subnet Mask: 255.255.255.0 192.168.1.102 & 255.255.255.0 = 192.168.1.0

The two computers on the same network segment;

192.168.1.4 192.168.12.5, if the subnet mask is 255.255.255.0, and then not in the same network segment; if the subnet mask is 255.255.0.0 then the same network segment

Guess you like

Origin www.cnblogs.com/jiangtongxue/p/11325090.html