Network and subnetwork masks and Ways to write them

Network and subnetwork masks
Andrey Volkov

Andrey Volkov

System, network administration + DBA. And a little programmer!)) See Author profile.

Because IPv4 addresses are hierarchical, there needs to be some way of distinguishing between the network portion of the address and the host portion. To accomplish this, an IPv4 address must be paired with a network mask, which is also sometimes called a subnetwork mask or simply a subnet mask or mask. A network mask is a 32-bit string of binary characters that defines which portion of the address represents the network and which portion of the address represents the specific host.

The rules for creating a network mask are as follows:

  1. A 1 in the subnet mask defines a network bit.
  2. A 0 in the subnet mask defines a host bit.

So an IPv4 address by itself really tells us nothing. We can make some guesses based on other information that will come later, but for now we need to have a subnet mask paired with an IPv4 address in order for us to know where the device is located and what its unique identity is.

Note

Historically, networks were broken down and divided up for use through the use of address classes. This was accomplished through the use of network masks. When people starting breaking down larger networks into smaller network known as subnetworks, the term subnetwork mask came into use. All of these terms are now used interchangeably.

 

Ways to Write a Network or Subnet Mask

There are three ways to denote a subnet mask:

  • In binary: 11111111.11111111.11111111.00000000
  • In decimal: 255.255.255.0
  • In slash notation: /24

Each of these says the same thing: the first 24 bits of the 32-bit mask are 1, and the last 8 bits of the mask are 0. This tells us that when compared to an IPv4 address, the first 24 bits define the network portion of the address, and the last 8 bits define the host portion. If we look back at the address from the beginning of this blog and add to it this subnet mask, we get the following:

11000000.10101000.00000001.00000001 (address)

11111111.11111111.11111111.00000000 (subnet mask)

192.168.1.1 255.255.255.0 (address and then mask separated by a single space)

192.168.1.1/24 (address and mask using the / to separate address from mask)

In all three cases we can say that the network portion of the address 192.168.1.1/24 is 192.168.1 and that the host portion is .1.

 

 

Вас заинтересует / Intresting for you:

Network, Node and Broadcast Ad...
Network, Node and Broadcast Ad... 302 views Андрей Волков Sun, 14 Feb 2021, 06:14:12
Binary ANDing: multiplication ...
Binary ANDing: multiplication ... 317 views Андрей Волков Sun, 14 Feb 2021, 08:38:30
IT Industry Trends and Transit...
IT Industry Trends and Transit... 636 views Masha Sun, 27 Jan 2019, 12:28:11
Subnetting a Class B Network U...
Subnetting a Class B Network U... 280 views Андрей Волков Sun, 14 Feb 2021, 08:11:41