What does 192.168.0.0/24 mean?

In fact, this is a network segment, or subnet, expressed in the form of CIDR (
Classless and Subnet Address Extensions and Supernetting).
We know that to determine a subnet, we need to know the host address and subnet mask, But in the form of CIDR, you can simply get two values. For example, "192.168.0.0/24" means that the IP address of this network segment starts from 192.168.0.1 and ends at 192.168.0.254 (192.168.0.0 and 192.168 .0.255 has a special meaning and cannot be used as an IP address); the subnet mask is 255.255.255.0.
How did the above subnet mask come from? In fact, the key lies in "24". We know that the IP address is four decimals It consists of numbers, which is equivalent to 32-bit binary. In CIDR representation, the latter number separates the 32 bits (take 24 as an example): the first 24 bits are represented by "1", and the last 8 bits are represented by 0, to get a Binary number:
11111111 11111111 11111111 00000000.
Convert it to decimal, that is: 255.255.255.0.


/24 means that the IP subnet mask is 255.255.255.0
means the first 24 (that is, the first three decimal digits of the IP) of the address for the network bits.
Indicates that there are 8 host bits in this network segment, that is, 2 to the 8th power of hosts
Indicates that this address is a class C standard IP

https://www.zybang.com/question/3a231889bd91deeae06e1a3a179557e8.html

Subnet mask (subnet mask), also known as network mask, address mask, subnet mask, is a method used to indicate which bits of an IP address identify the subnet where the host is located, and which bits identify the subnet. is the bitmask of the host. The subnet mask cannot exist alone, it must be used in conjunction with the IP address. The subnet mask has only one function, which is to divide an IP address into two parts: the network address and the host address.

The setting of the subnet mask must follow certain rules. Like a binary IP address, a subnet mask consists of 1s and 0s, and the 1s and 0s are contiguous, respectively. The length of the subnet mask is also 32 bits. The left side is the network bit, which is represented by the binary number "1", and the number of 1 is equal to the length of the network bit; the right side is the host bit, which is represented by the binary number "0", and the number of 0 is equal to the host. bit length. The purpose of this is to cover the original host number with 0 when the mask and ip address do bitwise AND operation, without changing the original network segment number, and it is easy to determine the number of hosts in the subnet by the number of 0 digits (2 When the host number is all 1, it represents the broadcast address of the network, and when it is all 0, it represents the network number of the network, which are two special addresses). Only through the subnet mask can the relationship between the subnet where a host is located and other subnets be indicated, so that the network works normally

. The first 3 bytes in the IP address indicate the network number, and the last byte indicates the subnet number. It also indicates the host number, and also indicates whether the two IP addresses belong to the same network segment. If they belong to the same network interval, the information exchange between these two addresses does not pass through the router. If they do not belong to the same network range, that is, the subnet numbers are different, the information exchange between the two addresses must be carried out through the router

subnet mask - the "all 1" bit pattern that shields the network part of an IP address. For class A addresses, the default subnet mask is 255.0.0.0; for class B addresses, the default subnet mask is 255.255.0.0; for class C addresses, the default subnet mask is 255.255. 255.0

http://baike.baidu.com/link?url=Jac8ty4fHVfJnPsUJzF3EdPFGnSMdimiiCnNyRioip1vMZe3GJrieL1nwp6wePzlss9Y2ss1nYORBtZk_eUrY390TBdtpFNbdNjsMlHWSlSFFdiVEI-LabbR2VZuf3hz

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326271832&siteId=291194637