ComputersInformation Technology

What is a subnet mask? IP address and subnet mask

As you know, every computer, no matter what network it is, 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 a network mask, which we will discuss in this article.

Subnet mask, gateway and address ...

If you try to get information about the current connection, 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 several CSN servers, or rather their addresses. For an uninitiated person, all these data represent only a heap of numbers, but if you are planning on configuring computer networks based on the TCP / IP protocol, you need to know a little more about these indicators.

A few words about IP-addresses

Before diving into the jungle and explaining what a subnet mask is, 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 information in this article will concern the IPv4 protocol, since it is still the most "current" one.

So, the IP address consists of four digits, each of which can take a value from zero to 255. Do not be a professor of mathematics to calculate: there may be just over four billion combinations. Any device on a TCP / IP network has a similar address regardless of what functions it performs-be it a network printer, router, ADSL-router or smartphone, the device will connect to the network only when it has a unique sequence of all The same four digits.

About local addresses

If you have several computers at home, you probably noticed that all their addresses have much in common - most often their difference is only in the last digit, for example, if one of your computers has the address 192.168.1.10, then the second one can have Be 192.168.1.9. This situation is quite natural for home networks, because these addresses are internal. They are used to transfer data inside your home network, for example between computers. And what happens when you need to get information from the Internet?

Gateway

Before you start to answer the question about what a subnet mask is, you need to figure out one more component of the network - the gateway. As you know, in order for your home computer to access the World Wide Web, it needs a gateway - its role is usually played by either a router or a modem, or (if talking not about the house, but about the work) the server. When you request an Internet page, your computer will know if the server you are looking for is in your home network. If it is there (for example, if you keep the site on one of your computers), then nothing, in fact, special happens - the computers establish a connection through the local network and begin the transfer of data. However, if you are trying to open a site located on a remote server, the gateway enters the case.

What is the subnet mask for?

So, we got close to the question of what a subnet mask is. 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 average user 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.

By the way, the example with 255.255.255.0 is relevant only if you are dealing with simple and familiar operating systems, for example Windows. Systems based on Linux, including the proverbial and ubiquitous Android, use a slightly different approach, in which the subnet mask is given a one- or two-digit number. In the above example, a similar number is 24.

Can I find out the subnet mask?

Despite the fact that this question has little meaning, users do not stop asking it to search engines. It is almost impossible to determine the IP subnet mask by IP, because, based solely on the IP address, it is impossible to say exactly which scale a local or distributed network has. In some cases, information about the gateway can help, for example, if your computer has an address of 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.

In general, the IP address and the subnet mask are practically unrelated, or rather, one can not be determined based on another. In a network, the computer needs to operate with both parameters in order to create successful connections to a particular device.

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, one can confidently state 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 by specifying a too "tight" subnet mask, then your computer may start experiencing problems already with connecting to "neighbors" over 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 use appropriate 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.

Let's consider a concrete example. Having an IP address of 192.168.111.222 and indicating that the static character of its bits is 32, we get the following entry: 192.168.111.222/32. In practice, this means that the computer will use the available gateway to connect to any computers other than itself. This is because 32 is the total number of bits that contains the IP address in the fourth version of the protocol. If we consider this mask in a form more familiar to most people (as it is done in Windows), then it would look like 255.255.255.255.

And what about the more conventional version of the subnet mask that 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, you can perform a simple logical chain - 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 variants, for example, 255.255.255.128, their bit rate 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 options and 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.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.atomiyme.com. Theme powered by WordPress.