SoFunction
Updated on 2025-04-12

IP address composition and type

An IP address consists of 32-bit strings of 4 bytes, which are usually separated by decimal points. Each byte can be represented in decimal or hexadecimal, such as 129.45.8.22 or 0x8.0x43.0x10.0x26 is an IP address represented in decimal or hexadecimal. IP addresses can also be represented in binary.

An IP address includes two identification codes (IDs), namely the network ID and the host ID.

All hosts on the same physical network use the same network ID, and a host on the network (including workstations, servers, routers, etc.) has a host ID corresponding to it. According to this, the 4 bytes of the IP address are divided into 2 parts, one of which is used to indicate the specific network segment, namely the network ID; the other part is used to indicate the specific node, namely the host ID.

There are five location division methods within these 32-bit address information, and these five division methods correspond to Class A, B, C, D and E IP addresses respectively.

Class A: A Class A IP address consists of a 1-byte network address and a 3-byte host address. The highest bit of the network address must be "0" (each byte has an 8-bit binary number).

Class B: A Class B IP address consists of 2 bytes of network address and 2 bytes of host address. The highest two digits of the network address must be "10".

Class C: A Class C address consists of 3 bytes of network address and 1 byte of host address. The highest three digits of the network address must be "110".

Class D: used for multi-point broadcast. The first byte starts with "1110". Therefore, any IP address with the first byte greater than 223 and less than 240 is a multi-post address. The all-zero ("0.0.0.0") address corresponds to the current host. The IP address of all "1" ("255.255.255.255") is the broadcast address of the current subnet.

Class E: Start with "11110" and reserved for future use.

IP addresses for special purposes: Any host segment, that is, the IP addresses whose host ID is set to "0" are called the network address, such as 129.45.0.0; Broadcast address: Any IP addresses whose host ID is set to "1" are called the broadcast address, such as 129.45.255.255; Reserved address: The network ID cannot start with decimal "127", and the number 127 is reserved for diagnosis in such addresses. For example, 127.1.1 is used for loop testing, and the first 8-bit group of the network ID cannot be fully set to "0", all "0" means the local network; IP addresses with all "0" and all "1" are reserved for use.

IP addresses are suitable for large and small networks. The address is custom, and its highest bit defines the type of address. Class A addresses support multiple hosts in one network: the highest bit is 0, followed by 7Bit network part and 24Bit host part. In a Class B address, the highest bit is non-0, followed by 14Bit network number and 16Bit host number. The C class address starts with 110, followed by 21Bit network number and 8Bit host number. As usual, the IP address is given by dotted characters. The address consists of four decimal numbers, separated by dots. For example, 10.0.0.51 and 128.10.2.1 are the IP addresses of Class A and Class B, respectively. Article entry: dnbm     Editor: dnbm