What is a network prefix, and how it helps to decipher the IP address

Introduction

Each device connected to the Internet requires a numeric identifier. An IP address is a numeric code used to identify various equipment connected to the World Wide Web. To date, there are two versions of IP: IPv4 and IPv6. The protocol of version 4 is still basic, but the number of available resources has been exhausted, so version 6 is gradually being used, allowing the use of much more resources. Each identifier contains information about a specific connection, as well as about the connected equipment. The prefix indicates which values ​​are used to denote the network, and which - to denote the device. Let's take a closer look at what a network prefix is ​​and how it will help to decode an IP address.

Any device is guaranteed to receive its unique identifier.

IP Address Structure

Typically, the IP address is written as follows: 192.168.10.100. Each section is 8 bits or 1 byte of information. The server sees these numbers as a set of ones and zeros, for our convenience, they are written in the usual decimal system. Its maximum length is 3 characters, and the minimum is 1. In total, the entire record takes 32 bits and theoretically could be 232 or 4, 294, 967, 296 resources.

The entire digital code is divided into two parts: the address of the provider and the host. The first one identifies the provider through which you work, and the second denotes the identifier of a specific device, such as a laptop or an Android tablet, in a local connection. In order to find out how many bits each indicator represents, the network prefix is ​​written through a slash. Then the record looks like 192.168.10.100/24. In our case, 24 indicates that the first 3 sections (3 * 8 = 24), namely 192.168.10 is the address of the connection. The remaining 8 bits, namely 100, is the hardware identifier (maximum 28 = 256 addresses). At 192.168.10.100/16, the local resource will be 192.168, and the host will be 10.100 (216 = 65536).

Often, the subnet mask is used to determine the address. Its length is no different. This is essentially the same as the network prefix, just a little differently organized. You, probably, paid attention that the provider specifies this parameter at connection to the Internet. It also shows which part of the IP belongs to the provider, and which part to the host. It is also recorded in the form of four 8-bit sections. The only difference is that in binary terms, only a few need to go first. If you convert binary 11111111 to decimal, it will turn out 255. Therefore, the mask will necessarily begin with 255.

Consider an example. Take our address 192.168.10.100 and mask 255.255.255.0. Accordingly, the first three sections of the record will be the identifier of the LAN, and the last - the identifier of the computer. If the mask is 255.255.0.0, then the network will be 192.168, and the host will be 10.100.

It also helps to better determine if two IP resources are related to the same connection. Take, for example, 213.111.125.17 and 213.11.176.3. If the mask is 255.255.0.0, then both addresses are located on the same network, if it is 255.255.255.0, then it is different, since 125 and 176 are different.

The network prefix will allow defining its mask. For example, we have the record 176.172.7.132/22. As we remember, 22 shows the number of bits responsible for the provider. In the binary system, at the very beginning, we will write down 22 units and supplement them with 10 zeros to make 32 bits in total, and divide them into sections of 8 bits - 11111111.11111111.11111100.00000000. Now we translate the result into decimal, the final result is 255.255.252.0.

For the reverse calculation we take the address 176.172.7.132 and the mask 255.255.128.0. We translate it into a binary system, we get 11111111.11111111.10000000.00000000. There are 17 units in our case, this is our network prefix. In decimal form, we write it as 255.255.128.0/17.

Conclusion

After reading the article, you will not be frightened by the length of digital records when setting up a connection and the terms “network prefix” and others. If you are a regular user of the Android system, the information from the article will be quite enough for you. If you want to manually configure your home connection, you may need to do more research.

Do you find this material useful? We will be grateful for the comments left.