Home  >  Article  >  The composition of an IP address

The composition of an IP address

青灯夜游
青灯夜游Original
2019-06-05 13:53:3318752browse

P address refers to the Internet Protocol Address (English: Internet Protocol Address, also translated as Internet Protocol Address), which is the abbreviation of IP Address. The IP address is a unified address format provided by the IP protocol. It assigns a logical address to each network and each host on the Internet to shield the differences in physical addresses.

The composition of an IP address

The IP address adopts a hierarchical structure; it is composed of two parts: the network number (net ID) and the host number (host ID).

According to different value ranges, IP addresses can be divided into five categories; the first 5 digits in the IP address are used to identify the category of the IP address:

● Class A address The first digit is 0;

● The first two digits of Class B address are 10;

● The first three digits of Class C address are 110;

● Class D address The first four digits of the address are 1110; the first five digits of the Class E address are 11110.

The composition of an IP addressIn fact, most of the network bits and host bits are distinguished by the subnet mask. The subnet mask corresponds to the IP address one-to-one. The subnet mask of 1 is the network bit. Bit, 0 is the host bit.

For example: 192.168.1.2 mask 255.255.255.0. The network bit is 192.168.1 and the host bit is 2

For example: For example, 172.16.2.160/255.255.255.0: The [network number] of this IP address

is 172.16.2.0 and the host number is 0.0 .0.160

Subnet division

For example: 172.16.2.160/255.255.255.192 (IP address/mask)

1010 1100 0001 0000 0000 0010 1010 0000 (Binary)

1111 1111 1111 1111 1111 1111 1100 0000 (Subnet mask)

Description:

Only the one who knows Only by using the net mask and IP can you know the specific network segment and host number;

The same subnet mask may not necessarily be the same network segment IP. IPs in the same network segment must have the same subnet mask.

The above is the detailed content of The composition of an IP address. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn