blog posts

The SubNet mask? what it is?

According to its IP class, each IP is divided into two parts: Network ID and Host ID. How can you distinguish the fixed octets of an IP or the so-called network ID of an address from the host ID? We must introduce you to a netmask or Subnet mask to answer this question.

Netmask or Subnet mask is the task of separating the two parts and the network from each other and differentiating between these two parts. The subnet mask is a 32-bit string with zero and one bit from left to right. The bits displayed with the value of “1” are the network, and the bits indicated with the value of “0” are the host. For example, in Class A IP, where the first octet is the network and the next three octets are the hosts, the Netmask in Binary representation is as follows:

11111111 000000000000000000000000

The subnet mask in the Decimal display for this class is as follows:

255.0.0.0

As you noticed, in more straightforward language, instead of each fixed octet, or in other words, instead of each Network ID, the number 255 is placed. So, for example, by looking at the Subnet mask with the numbers 255,255,255.0, you can easily find out that the IP is class C, the first three parts are fixed and called network, and the last part is variable and called the host.

In other words:

Netmask is a 32-bit “mask” that divides an IP address into subnets and identifies available hosts on the network. In a netmask, two bits are always automatically assigned. For example, in 255.255.225.0, “0” is the network address. In 255.255.255.255, “255” is the transferred broadcast address. 0 and 255 are permanently assigned and cannot be used.

First of all, the Netmask is not an IP address:

  • This is what defines the network.
  • So let’s see what an IP address is.

Let’s use the address 10.1.7.129. How to find out which network it is on?

Well, we can’t know unless we have the Netmask. How does it work? Remember that all these numbers are shorthand notations for actual binary bit patterns. And everything works using binary.

So what we call 10.1.7.129 is a dotted set of 4 sets of 8-bit binary numbers.

10 = 00001010 / 1 = 00000001 / 7 = 000000111 / 129 = 10000001, and what we do with those numbers is mask them against the network mask. Masking is a way to determine which part of the address is the network – in other words, which network things are on – and which part is the host – the actual address of the device.

We should know that because this device can host 1.7.129 on network 10.0.0.0, 7.129 on network 10.1.0.0, or host 129 on network 10.1. 7.0 or host 129 on 10.1. 7.128. The grid can be even smaller than that.

We put a number 1 in every place that is supposed to be the network part and a number 0 in every area that will be the host part. This is it. Then we perform a logical AND function against the two numbers. Don’t you know what that is?

Well, this is a quantitative comparison function. Here’s how it works. We compare two bits. If both of them (this one and that one) are 1, the result is 1. If not, the result is 0.

So our netmasks look like sets of 1s followed by sets of 0s. So our masks are something like 255.0.0.0, 255.255.0.0, 255.255.255.0, or 255.255.255.128, for the examples I gave above.


________________________________________________________________
SUBNET MASK / NETMASK specialized description:

Netmask and subnet mask are often used interchangeably, but subnet masks are more commonly used in network configurations, while netmasks often refer to classes of IP addresses. They are used to define a ran.

Ge IP addresses that an ISP or other organization can use.

There are three standard classes of IP addresses—A, B, and C—and they have the following netmasks:

  • class A: 255.0.0.0
  • Class B: 255.255.0.0
  • class C: 255.255.255.0

Class A defines a range of IP addresses where the first three-digit part is the same, but the other parts can each contain a number from 0 to 255. In class B, the first two sections have the same number as class C. The first three mean a Class C IP address range may have up to 256 addresses.

((( Netmask is a 32-bit value that divides IP addresses into segments. While a Class C netmask is often written as “255.255.255.0”), it may also be written as 11111111. 11111111.11111111.00000000. Its binary representation shows that there are 32 bits (4 segments of 8 bits each) that make up the network mask.

It also shows how Netmask gets its name – it “masks” the IP addresses inside it. Sections with all 1’s are preset and, therefore, cannot be changed, while a section with all 0’s gives any number between 0 and 255.))))

What is a subnet? Read here.

What is Subnet Mask Calculator?

Some people know how to calculate the Subnet Mask manually, but most people use unique calculators for this purpose, that is, to get the Subnet Mask. There are several types of calculators. Some have a wide range of functions and broad scope, but others have only specific applications. These tools provide information such as IP range, IP address, Subnet Mask, and network address.

Listed below are some of the most common types of Subnet Mask calculators.
The IPv6 IP Subnet Calculator maps hierarchical subnets.
IPv4/IPv6 Calculator/Converter is an IP mask calculator that supports IPv6 alternate and compressed formats. This subnet calculator may also allow you to convert IP numbers from IPv4 to IPv6.
IPv4 CIDR calculator is a subnet mask setting and Hex conversion tool.
The IPv4 Wildcard Calculator shows which part of an IP address is ready for testing by calculating the wildcard mask of an IP address.
You must use the HEX Subnet calculator to calculate the first and last subnet address, including the hexadecimal notation of the multicast address.
A simple Subnet Mask calculator calculates the smallest available subnet and subnet mask.
The Subnet Range/Address Range calculator calculates the beginning and end of addresses.

What is meant by IP MASK?

The abbreviation subnet mask may be used to define both IP address and subnet in combination. In this case, the number of mask bits comes after the IP address. For example, 10.0.1.1/24 and 216.202.192.66/22 are equivalent to the IP address number 10.0.1.1 with the subnet mask of 255.255.255.0 and the IP address. They are 216.202.196.66 with a subnet mask of 255.255.252.0. Note, however, that you are not masking the IP address but the subnet.

Obtaining the Subnet Mask from the IP address

In this section, we will learn how to obtain Subnet Mask manually. This process is explained in six steps.

Suppose you are given an IP address 10.20.4.13/29 and asked to find the following:

  • Subnet address
  • The first address is valid
  • The last lesson is valid
    Broadcast address
  • Subnet Mask
  • The step-by-step method of calculating the above items:
    Step 1: Find the SUBNET number
  • To find the SUBNET number, you need to subtract the prefix number from 32:
  • 29-32=3

To get the SUBNET MASK, we do the following:

8 bits – 3 bits = 5 bits (network bits that are on)

You might ask why we subtracted from 8 bits because we need eight bits for every eight in the address:

1 1 1 1 1 0 0 0
128 + 64 + 32 + 16 + 8 = 248
Subnet Mask = 255.255.255.248
Step 2: Find the size of the SUBNET

To find the size of the subnet, we need to raise 2 to the power of the number we obtained in the previous section. For example, in the example above, the subnet above example^3.

Step 3: Find the requested address

We must subtract one from the subnet size to find the broadcast address. So:

(2**n) – 1 = Broadcast Address

In the example under consideration, this value equals (2**3)-1 = (1-8) = 7.

Step 4: Find the IP address of the SUBNET

For this purpose, we need to find the subnet block for the IP address, where our IP address is located in increments of 0 8 16 32 40. As we can see, 13 is between 8 and 16; therefore, this address is valid in the 10.20.4.8/29 subnet.

Fifth step: Calculation of valid hosts
To calculate the valid hosts in the subnet, we must use the following formula:
2**n – 2 = Valid Host Range

2**3-2 = (2-8) = 6

In the example under consideration, this value is as follows:

In the end, you can see the Netmask of each class and the number of usable IPs in the table below.