Description of IP Address Class A/B/C/D/E and Network ID, Host ID

Description of IP Address Class A/B/C/D/E and Network ID, Host ID

An IPv4 network address consists of 4 bytes, generally composed of 4 decimal digits, each digit from 0 to 255, separated by dots. In order to classify and manage devices and networks, IP addresses are also divided into two parts:network addresses and host addresses.

  • • Network address: put in the front to indicate which network on the Internet this IP address belongs to;
  • • Host address:put it at the back to indicate which device this IP address belongs to in a certain network.
    • The Network ID and Host ID have a master-slave relationship.

      IP addresses can be divided into 5 categories such as A/B/C/D/E:

Class A IP Address

IPv4: 0 Network Class, Net ID, Host ID Description of IP Address in Binary, Decimal and Hexadecimal Description of IP Address Class A/B/C/D/E and Network ID, Host ID

Class A IP address means: in the four-segment number of the IP address (for example: byte 1. byte 2. byte 3. byte 4), the first segment number (byte 1) is the network number , and the remaining three segments of numbers (byte 2. byte 3. byte 4) are the numbers of the local computer.

If the IP address is represented in binary, a Class A IP address consists of a 1-byte network address and a 3-byte host address, and the highest bit of the network address must be '0'.

Class A IP address range: 1.0.0.0 ~ 127.255.255.255, available IP address range: 1.0.0.1 ~ 127.255.255.254.

The length of the network identifier in the Class A IP address is 7 bits, and the length of the host identifier is 24 bits. The number of class A network addresses is small (2^7 - 2 = 126), which can be used to accommodate more than 16 million computers of large networks (2^24 - 2 = 16777214).

(default subnet mask: 255.0.0.0 or 0xFF000000). Generally used for large networks.

Class B IP Address

IPv4: 128 Network Class, Net ID, Host ID Description of IP Address in Binary, Decimal and Hexadecimal Description of IP Address Class A/B/C/D/E and Network ID, Host ID

Class B IP address means: in the four-segment number of the IP address (for example: byte 1. byte 2. byte 3. byte 4), the first two segments of the number (byte 1. byte 2) is the network number, and the last two numbers (byte 3. byte 4) are the numbers of the local computer.

If the IP address is represented in binary, the class B IP address consists of a 2-byte network address and a 2-byte host address. The highest bit of the network address must be '10'.

Class B IP address range: 128.0.0.0 ~ 191.255.255.255, available IP address range: 128.0.0.1 ~ 191.255.255.254.

Class B IP addresses have a 14-bit network identifier and a 16-bit host identifier. Class B network addresses are suitable for medium-sized networks (2^14 = 16384), and each network can accommodate 60,000+ computers (2^16 - 2 = 65534).

(default subnet mask: 255.255.0.0 or 0xFFFF0000). Typically used for medium-sized networks.

Class C IP Address

IPv4: 192 Network Class, Net ID, Host ID Description of IP Address in Binary, Decimal and Hexadecimal Description of IP Address Class A/B/C/D/E and Network ID, Host ID

Class C IP address means: in the four-segment number of the IP address (for example: byte 1. byte 2. byte 3. byte 4), the first three-segment number (byte 1. byte 2 .Byte 3) is the network number, and the remaining number (byte 4) is the number of the local computer.

If the IP address is represented in binary, the Class C IP address consists of a 3-byte network address and a 1-byte host address. The highest bit of the network address must be '110'.

Class C IP address range: 192.0.0.0 ~ 223.255.255.255, available IP address range: 192.0.0.1 ~ 223.255.255.254.

The length of the network identifier in the class C IP address is 21 bits, and the length of the host identifier is 8 bits. The number of Class C network addresses is large (2^21 = 2097152), which is suitable for small-scale local area networks. Each network can only contain up to 254 computers (2^8 - 2 = 254).

(default subnet mask: 255.255.255.0 or 0xFFFFFF00). Generally used for small networks.

Class D IP Address

IPv4: 224 Network Class, Net ID, Host ID Description of IP Address in Binary, Decimal and Hexadecimal Description of IP Address Class A/B/C/D/E and Network ID, Host ID

The first 4 bits of the Class D address are always 1110. Presetting the first 3 bits to 1 means that the Class D address starts at 128 + 64 + 32 = 224. The fourth bit is 0, which means that the maximum value of the Class D address is 128 + 64 + 32 + 8 + 4 + 2 + 1 = 239.

Class D IP address range: 224.0.0.0 ~ 239.255.255.255.

Class D IPv4 addresses do not distinguish between network addresses and host addresses.

Class D IP addresses are reserved for use by the Internet Architecture Board (IAB) for multicast addresses (one-to-many communication).

Class E IP Address

IPv4: 240 Network Class, Net ID, Host ID Description of IP Address in Binary, Decimal and Hexadecimal Description of IP Address Class A/B/C/D/E and Network ID, Host ID

The first 4 bits of the Class E IP address are always 1111. Presetting the first 4 bits to 1 means that the Class E address starts at 128 + 64 + 32 + 16 = 240.

Class E IP address range: 240.0.0.0 ~ 255.255.255.255.

Class E IPv4 addresses do not distinguish between network addresses and host addresses.

Class E IP addresses are reserved for future use, typically for research purposes. So there are no Class E addresses available on the Internet.

As you can see, there is no overlap between different types of IP address segments. The five types of IP addresses are also different in terms of usage:

  • • Class A IP addresses are used by government agencies;
  • • Class B IP addresses are assigned to medium-sized businesses;
  • • Class C IP addresses can be assigned freely;
  • • Class D IP addresses are used for multicast;
  • • Class E IP addresses are reserved for experiments.

The current popular IPv4 classification is based on different combinations of network numbers and host numbers. For 32-bit addresses, the occupied lengths of the ABC three types of network numbers are 8, 16, and 24, respectively, and the D type is used for multicast. Address, Class E spare.

All network space calculations must be "subtracted by 2" because two reserved addresses are subtracted: "0" for this network and "255" for broadcast.

Some special IPs:

0.0.0.0 cannot be pinged. In the server, 0.0.0.0 is not a real IP address, it represents all the IPV4 addresses in the machine. The port that listens to 0.0.0.0 is the port that listens to all IPs in the machine.

127.0.0.1 is a reserved address, generally used for loopback address, equivalent to localhost or local IP address.

255.255.255.255 is used to represent the broadcast address of the local network. It cannot be forwarded or passed through the gateway, but will be sent to all hosts on the same physical network segment, so it is also called "broadcast" by many people.

📚 Comment

Languages