Subnet Mask and IP address operation subnet mask: function: divide an IP address into two parts: network address and host address. Once the subnet mask is set, the network address and host address are fixed. Calculation: Convert the IP address and subnet mask to a binary format, and then perform "and" calculation. Obtain the network number, that is, the first address of the subnet. I have been entangled in why this computation is made. Now I want to understand this computation: 1. First, the subnet mask can be obtained based on the number of hosts in the subnet. The number of hosts is expressed in binary, and the number of binary is N. After the 32-bit binary number, the N position 0 and the others are all 1. Obtain the subnet mask. For example, there are 15 hosts in the subnet. 15 = 1011. The binary value is 4 digits, N = 4. The subnet mask is 11111111.1111111111.1111111111111111111111111111111111111111111_1_1_2402: the first IP address of the subnet ~~~~~ IP address + 2 ^ N. 3. Obtain the first IP address of the subnet Based on the IP address of the current machine. The current IP address is the first IP address + n (n <N). To obtain the first IP address of the subnet, use the IP address minus n, directly perform operations with the subnet mask to obtain the first IP address of the desired subnet. No matter whether the problem is simple or not, or whether you understand the right or wrong, you must first straighten out your own ideas. Otherwise, you will be able to suffocate yourself in the case of a simple problem ~~