Home  >  Article  >  What does /24 after the IP address mean?

What does /24 after the IP address mean?

青灯夜游
青灯夜游Original
2022-11-23 11:36:4557031browse

The "/24" after the IP address indicates that the mask bit is 24 bits. The IP address is composed of four decimal numbers, which is equivalent to a 32-bit binary number; the slash followed by the specific number after the IP address is a network segment, or subnet, expressed in CIDR form. The "/24" after the IP address means that the first 24 bits of the 32-bit binary are represented by "1", and the last 8 bits are represented by 0, that is, "11111111 11111111 11111111 000000"; convert it into decimal, which is "255.255.255.0".

What does /24 after the IP address mean?

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

IP address refers to the Internet Protocol address, which is a unified address format provided by the IP protocol. It assigns a logical address to every network and every host on the Internet to shield the physical address. difference.

/24 after the ip address

after the ip address The slash 24 indicates that the mask bits are 24 bits, that is, there are 24 consecutive "1"s in the subnet mask expressed in 32-bit binary.

The ip address followed by a slash and a specific number is a network segment, or subnet, represented by CIDR (Classless and Subnet AddressExtensions 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, we 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 have special meanings and cannot be used as IP addresses); sub The net mask is 255.255.255.0.

How did the above subnet mask come from? In fact, the key is "24". We know that the IP address is composed of four decimal numbers, which is equivalent to 32 bits Binary. Using CIDR representation, the latter number separates these 32 bits (taking 24 as an example): the first 24 bits are represented by "1", and the last 8 bits are represented by 0, resulting in a binary number:

11111111 11111111 11111111 00000000

Convert it to decimal, it is: 255.255.255.0.

Expand knowledge : Mask function

The IPv4 protocol used forcibly defines some reserved addresses for IP addresses, namely: "network address" and "broadcast address". The so-called "network address" refers to " The "host number" is an IP address with all "0", such as: 125.0.0.0 (Class A address); and the "broadcast address" refers to the IP address when the "host number" is all "255", such as: 125.255.255.255 ( Class A address).

The subnet mask is used to identify whether two IP addresses belong to the same subnet. It is also a set of 32-bit long binary values, and the value on each bit represents a different Meaning: If it is "1", it means that the bit is a network bit; if it is "0", it means that the bit is a host bit. Like the IP address, people also use (dotted decimal) to represent the subnet mask, such as: 255.255 .0.0. If the bitwise AND calculation of two IP addresses with the same subnet mask yields the same result, it means that the two IP addresses are in the same subnet. In other words, use these two IP The two computers at the address are like different departments in the same organization. Although their roles, functions, and even geographical locations may be different, they are all on the same network.

Subnet mask calculation Methods Since various types of networks have been put into various applications, the network has expanded on a large scale at an incredible speed. The IPv4 in use has gradually exposed its shortcomings, namely: the network number occupies too many spaces, and the host number Too few bits. One of the most common solutions is to subdivide a higher class IP address into multiple subnets, and then make the different subnets available to groups of users of different sizes. Use this In order to effectively improve the utilization of IP addresses, the main method is to extract the high-order part of the "host number" in the IP address as the subnet number, and expand or compress the subnet mask from the usual "network number" boundaries. code, used to create a certain number of subnets of a certain type of IP address. Of course, as more subnets are created, the number of available host addresses on each subnet decreases accordingly.

The main function of the subnet mask is to tell the network device which part of a specific IP address contains the network address and subnet address, and which part is the host address. The routing device of the network can make routing decisions as long as it identifies the network number and subnet number of the destination address. The host part of the IP address does not participate in the router's routing operation and is only used to uniquely identify a network device in a network segment. Interface.

If only the three main class addresses A, B, and C are used in the network system, and no subnets are divided into these three main class addresses or the main class addresses are summarized, the network device will use the first IP address according to the IP address. You can determine which main class network among A, B, and C it belongs to by using a numerical range of bytes, and then determine the network part and host part of the IP address without the assistance of a subnet mask. However, in order to make the system divide the three main types of networks A, B, and C into subnets, or use classless inter-domain routing technology (Classless Inter-Domain Routing, CIDR) to summarize network segments In order to correctly distinguish the network and subnet parts of the IP address from the host part, you must rely on the help of the subnet mask.

The subnet mask uses the same addressing format as IP. The part of the subnet mask of 1 corresponds to the network and subnet parts of the IP address, and the part of the subnet mask of 0 corresponds to the IP address. host part. After ANDing the subnet mask and the IP address, the host part of the IP address will be discarded, and the remainder is the network address and subnet address. For example, the destination IP address of an IP group is: 10.2.2.1. If the subnet mask is: 255.255.255.0, and the "AND" operation is performed with it, the result is: 10.2.2.0, then the network device thinks that the network number of the IP address is the same as the subnet mask. The network number is: 10.2.2.0.

Interrupt mask:

Interrupt mask means that before interrupting in assembly language, the corresponding interrupt status word needs to be authorized to allow or block related interrupts. operate. That is, read OCW1 to write the command word. OCW1 needs to write the odd entry address, the order is M7~M0, if Mi=1: shield the interrupt request introduced by IRi; if Mi=0: allow the introduction of IRi end interrupt.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What does /24 after the IP address mean?. 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
Previous article:what is aiNext article:what is ai