What is a Subnet Mask Address and How to Find Yours

I’m sure that you have heard the word subnet before. It is often in error messages or when talking about networks. For us techy people, it’s clear as day what a subnet is, and we can most likely tell you how many devices a network can have (there is always a limit), based on the subnet mask.

But you don’t care about that. You want to know what is and how you can find yours and for that, you have clicked on the right article. In this article, we will explain what a subnet mask is, why it is so important and the difference between subnet masks and IP addresses as well as how you can calculate a subnet mask and how you can find your subnet mask.

...

What is a Subnet Mask?

In order to understand what a subnet mask is you first need to know what an IP (Internet Protocol) address is. Every device that connects to a network needs its own unique IP address if you are using Internet protocol to allow the devices to communicate with each other. An IP address is a string of numbers separated by full stops for example:

172.16.81.100

A subnet mask is again a number and what it does is define a range of IP addresses that a network can use. Subnet is short for sub-networks and these are normally local networks that connect to the Internet. A subnet mask will designate these sub-networks.

Devices that are located on the same sub-network can communicate with each other. If devices on another subnetwork want to communicate with devices on a different subnetwork then they will require a router to route the commutation between the sub-networks. You can use a subnetwork to partition numerous networks and therefore limit the communication between them.

A limited connection.

The job of a subnet mask is to hide the network element of an IP address. Only the host element is visible. We will explain what a Class C IP address is in more detail later, but one of the most common Class C subnet masks is 255.255.255.0

Like an IP address, each section of the subnet mask address can contain any numbers from 0 to 255. For the subnet mask 255.255.255.0, the first 3 sections are full which means that device IP addresses within this subnet mask must be the same as the initial 3 sections. The last section can be any number between 0 and 255.

An example best explains this. The two IP addresses 12.0.1.101 and 12.0.1.102 are located on the same subnet but the IP address 12.0.2.101 would be on a different subnet. With a subnet mask of 255.255.255.0, there is 256 IP address but only 254 of these can be used for hosts. This is because the gateway (usually the first address) and the broadcast address (usually the last address) is reserved.

Why is a Subnet So Important?

One of the most important reasons for a subnet is security. When you are on the same subnet as other devices there is free communication but devices on other subnets will not be able to access your subnet.

A good example of this is your home network. In your network, you have a router that will use subnet for security. Your ISP will allocate a public IP to you. This IP address is what all the websites and anything that you connect to will see. However, if you check your computer’s IP address, it will most likely be another IP then the public one.

This is because there is a subnet on the home side of your router that cannot be routed to from the outside. What needs to happen, is that traffic coming in needs to go through the router that then translates and routes the traffic to the correct device. This way, everything is still connected, while still not being directly connected.

A subnet will increase the number of devices that can access the Internet. With standard IPv4 networking, there are only around three billion IP addresses available. This is nowhere near enough to meet the global demand for device connection.

So, a subnet is used to enable a collection of devices to connect to the Internet with a single IP address through the use of a router (like you have at home or in your office) and in this way a lot more than three billion devices can have access to the Internet. This is what was explained above with 1 public address for your whole network.

A typical subnet mask for home networks is 255.255.255.0. This is a 24-bit mask and allows up to 256 IP addresses. However, “only” 254 hosts are possible, which should be enough for most homes.

But business that has thousands of devices, 254 is no good at all. The good thing is that 255.255.255.0 can be changed to something else, thus increasing the network and the capacity of hosts. For example, 255.255.0.0, which is a 16-bit mask, can have 65 536 hosts. If you want to know more about sizes, I recommend checking out this cheat sheet on Aelius.com.

What is the Difference Between an IP Address and a Subnet Mask?

So, this might be a bit confusing. How to know the difference between a subnet mask and an IP? Let’s use an example to clear out the confusion.

The best way to do this is to think of an IP address like a home address or the physical address of your business. So, let’s say that one of your friends wants to send you a letter. They will add your address to the envelope and then add a stamp and put into their local mailbox.

The postal worker will retrieve the letter and if the address is local then they will post it directly into your mailbox. If the address is in another state, city or town then it will go to the central mail office where workers will sort it and dispatch it to where it needs to go. An IP address works in a similar way.

So, if your IP address is 20.0.0.1 and your subnet mask is 255.0.0.0 this means that addresses in the 20.x.x.x range are in your local network like addresses in your local area. However, if you want to send something to an IP address outside of your subnet such as 30.0.0.1 then you cannot do this directly (they will be in a different state, city or town).

In this case, the mail has to go to the local central office and then dispatched to the local central office of the intended recipient. The postal worker can then deliver it.

So an IP address is a number that has a network number, a subnetwork number (this is optional) and a host number. Both the network and subnetwork numbers are used in routing and the host number is the host address.

A subnet mask defines the format of an IP address numerically where the network and subnetwork bits that form the address have mask bit values of 1 and the host component of the address uses a mask bit value of 0.

What is Class A, Class B, and Class C Networks?

The InterNIC provides all public Internet addresses as it is responsible for administering everything. It divides IP addresses into separate classes and the most common classes are Class A, Class B, and Class C addresses.

Each of these classes uses a different subnet mask by default and you can easily identify the class of an IP address by the first octet that it uses.

Class A Addresses

In a Class A network, you would see the default subnet mask of 255.0.0.0 used. This means that the first octet of Class A IP addresses would be between 0 and 127. An example Class A IP address would be 12.48.24.9

Class A networks have an 8-bit prefix with the highest bit set to 0. There is a 7-bit network number and the host number is 24 bit. With Class A there is a maximum of 126 networks.

Class B Addresses

In a Class B network, you would see the default subnet mask of 255.255.0.0 used. This means that the first octet of Class B IP addresses would be between 128 and 191. An example Class B IP address would be 171.17.51.64

Class B networks have a 16-bit prefix with the highest bit order set to 1-0. The network number is 14 bit and the host number is 16 bit.

Class C Addresses

In a Class C network, you would see the default subnet mask of 255.255.255.0 used. This means that the first octet of Class C IP addresses would be between 192 and 223. An example Class C IP address would be 194.166.124.133

Class C networks have a 24-bit prefix with the highest bit order set to 1-1-0. The network number is 24 bit and the host number is 8 bit.

How to Find Your Subnet Mask

This will be different depending on if you are using a Windows, Mac or Linux.

For Windows 10:

  1. Open Command Prompt by searching for CMD
  2. Type ipconfig and press enter
  3. There will be a line named “Subnet Mask” which tells you your computers subnet mask

For Mac and Linux users:

  1. Open a terminal
  2. Type ifconfig and press enter
  3. There will be a line named “Subnet Mask” which tells you your computers subnet mask

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top