What is a subnet mask? IP address and subnet mask
As you know, every computer, in whatever networkhe was not, he has a certain digital address, called an IP address. Naturally, this rule is relevant only for networks based on the TCP / IP protocol, however, today almost any network is based on it. Anyway, in addition to this address, the network workstation has several other parameters that affect its interaction with other devices. First of all, one of them is the network mask, which we will discuss in this article.
Subnet mask, gateway and address ...
If you try to get information about the currentconnection, then, in addition to the IP address allocated to your computer, you will also see such fields as the subnet mask, the default gateway, and one or more DNS servers, or rather their addresses. For an uninitiated person, all this data is just a heap of numbers, but if you plan to configure computer networks based on the TCP / IP protocol, then you need to know a little more about these indicators.
A few words about IP addresses
Before diving into the wilds and explaining what issubnet mask, you should remember what an IP address is: what the numbers in it are and what values they can take. In advance, we will specify one point: all the information in this article will concern the IPv4 protocol, since it is still the most "current" one.
About local addresses
Gateway
What is the subnet mask for?
So, we got close to the question of how,what is a subnet mask. In fact, this is a brief reference about which computers are on the same network as yours, and which ones require a gateway to connect. A mask is a kind of pattern that the computer superimposes on the IP address with which it wants to connect. If the pattern "falls flat", then everything is fine, if not - the request is sent to the device specified in the network settings as the default gateway.
What does the subnet mask look like?
If you are an averageuser of a home network consisting of several computers that has a gateway to access the Internet, then your subnet mask, most likely, looks like this: 255.255.255.0. These numbers are the so-called subnet mask 24, which indicates that if the first three digits in the IP address of the computer match your address, it is directly accessible.
Can I find out the subnet mask?
Despite the fact that this issue is under itselfit makes little sense, users do not stop asking it to search engines. It is almost impossible to determine the IP subnet mask by IP, because it is impossible to tell exactly what scale a local or distributed network has, based on the IP address alone. In some cases, information about the gateway can help, for example, if your computer has the address 192.168.1.2 and the gateway is 192.168.0.1, then the subnet mask must be at least 255.255.0.0, otherwise the gateway will be unreachable.
About the price of errors
And what can happen if you make a mistake? Proceeding from the fact that we now already know what a subnet mask is, we can confidently say that if it is set incorrectly, there is a high probability that your computer will be cut off from the outside world. For example, if you enter 0.0.0.0 as a mask, then the operating system will treat any IP address as local and will not even attempt to use the gateway, which will result in the loss of the ability to communicate with computers outside your local network.
If you make another mistake, indicating too"Close" subnet mask, your computer may start experiencing problems already with connecting to "neighbors" on the local network - even if you access local IP, the subnet mask will indicate that access to it is possible only through the gateway, and this can lead either to an increased load on the network, or to the absolute inaccessibility of computers in the "locale".
Subnet masking options
Different operating systems useAppropriate approaches to the formulation of the network mask. While in Windows standard writing is considered to specify four eight-bit numbers, other operating systems, in particular those based on Unix, use a record based on specifying the IP address of the workstation, as well as the number of bits that must remain static.
And what about the more familiar version of the masksubnet, which is used in most intra-apartment LANs? The conversation, of course, is about 255.255.255.0. If you carefully read this article, then about this mask the conversation was already going, and the number of its fixed bits is 24 (i.e. the first three numbers of 8 bits).
Thus, it is possible to carry out a simple logicalchain - for each fixed number there are 8 bits, which means that the same 255.0.0.0 will be written as / 8, since only the first number is fixed in it.
As for the intermediate options,for example, 255.255.255.128, then their bit size is also easily computable, in this case it is 25-25 bits of the first three fixed numbers, and also one more bit dividing the segment from 0 to 255 exactly in half.
If you need more optionsand examples, you can always turn your attention to specialized sources. On their pages devoted to the topic of our article, there is a table of subnet masks, which includes almost all possible variants of composing these sequences.