IP data packets can be in either IPv4 or IPv6 format. IPv6 is an improved version used to replace the IPv4 protocol in the future. For the purpose of this article, we can ignore the difference between the two for the moment. We only use IPv4 as an example. The following is an IPv4 packet in the IPv4 format. We fold the entire sequence according to 4 bytes to better display the frame. The IP packet header also has multiple regions. We focus on the source address and destination address in red ). They are all IP addresses. The IPv4 address is 4 bytes in length (that is, 32 bits ). We usually divide IPv4 addresses into four decimal numbers, with each number ranging from 0 to 255. For example, 192.0.0.1 is an IP address. The address is written in the binary format in the IP packet header. An IP address is a global address that identifies "Community" (LAN) and "House" (host ). This is achieved by classifying IP addresses. IP class From To Subnet Mask A 1.0.0.0 126.255.255.255 255.0.0.0 B 128.0.0.0 191.255.255.255 255.255.0.0 C 192.0.0.0 223.255.255.255.255 255.255.0 32-bit each IP address is divided into two parts, the first part is used To distinguish the LAN, the second part is used to differentiate the host of the LAN. The Subnet Mask (Subnet Mask) tells us the dividing line between the two parts. For example, 255.0.0.0 (eight digits 1 and 24 digits 0) indicates that the first eight digits are used to distinguish the LAN, the last 24 bits are used to differentiate hosts. As classification A, B, and C have been defined, when an IP address belongs to the scope of Class B, we know that the first 16 bits and the last 16 bits represent the LAN and host respectively.