Subnet mask explained

An IP address is divided into two parts: the network part and the host part. For example, an IP address from the Class A consists of 8 network bits and 24 host bits. This is so because the default subnet mask for a class A IP address is 8 bits (or, written in dotted decimal notation, 255.0.0.0). What does this mean? Well, just like an IP address, a subnet mask also consists of 32 bits. It is used by computers to determine the network part and the host part of an IP address. The 1s in the subnet mask represent a network part, the 0s a host part.

Computers works only with bits. The binary AND operation is used to determine a network range:

binary and

Here is an example. Let’s say that we have the IP address of 10.0.0.1, with the default subnet mask of 255.0.0.0.

First, we need to convert the IP address to binary:

IP address – 10.0.0.1 = 00001010.00000000.00000000.00000001
Subnet mask – 255.0.0.0 = 11111111.00000000.00000000.00000000

Computers use the binary AND operation to determine the network number:

binary and example

In the picture above you can see that the network part of the IP address (10) has been determined. The computer can now determine the size of the network. Only IP addresses that begins with 10 will be in the same network. In this case, the range of addresses in this network is 10.0.0.0 – 10.255.255.255.

 

A subnet mask is always be a series of 1s, followed by a series of 0s.

Subscribe to our Newsletter

Like us on Facebook

top
Geek University 2019