Home >Common Problem >How to classify IP addresses
The IP address consists of two parts, namely the network address and the host address; the network address indicates which network on the Internet it belongs to, and the host address indicates which host in the network it belongs to; the two are master and slave. relation.
#The operating environment of this article: Windows 7 system, Dell G3 computer.
IP address consists of four segments, each field is one byte, 8 bits, and the maximum value is 255.
IP address consists of two parts, namely the network address and the host address. The network address indicates which network on the Internet it belongs to, and the host address indicates which host in the network it belongs to. The two are in a master-slave relationship.
The four major types of IP addresses identify a certain host on the network. The IPv4 address length is 32 bits and 4 bytes in total, but in practice we use dotted decimal notation.
IP addresses are divided according to the network number and host number, and are divided into three categories: A, B, C and special addresses D and E. Leave all 0s and 1s unused.
Class A: (1.0.0.0-126.0.0.0) (Default subnet mask: 255.0.0.0 or 0xFF000000) The first byte is the network number, and the last three characters Section is the host number. The beginning of this type of IP address is "0", so the network number of the address ranges from 1 to 126. Generally used in large networks.
Class B: (128.0.0.0-191.255.0.0) (Default subnet mask: 255.255.0.0 or 0xFFFF0000) The first two bytes are the network number, and the last two characters Section is the host number. The first part of this type of IP address is "10", so the network number of the address ranges from 128 to 191. Generally used for medium-sized networks.
Class C: (192.0.0.0-223.255.255.0) (Subnet mask: 255.255.255.0 or 0xFFFFFF00) The first three bytes are the network number, and the last byte is host number. The beginning of this type of IP address is "110", so the network number of the address ranges from 192 to 223. Generally used for small networks.
Class D: It is a multicast address. The beginning of this type of IP address is "1110", so the network number of the address ranges from 224 to 239. Generally used for multicast users[1].
Class E: is a reserved address. The beginning of this type of IP address is "1111", so the network number of the address ranges from 240 to 255.
In the three main types of IP addresses, three areas are reserved as private addresses. The address range is as follows:
Class A Address: 10.0.0.0~10.255.255.255
Class B address: 172.16.0.0~172.31.255.255
Class C address: 192.168. 0.0~192.168.255.255
Return address: 127.0.0.1. Also the local machine address, equivalent to localhost or local machine IP. Generally used for testing. For example: ping 127.0.0.1 to test whether the local TCP/IP is normal.
Related video recommendations: PHP video tutorial
The above is the detailed content of How to classify IP addresses. For more information, please follow other related articles on the PHP Chinese website!