Simple Questions: What Are The IP Address & The Subnet Mask?

When you connect a device to a network, it receives an address which is used to recognize it on the network. This address is called Internet Protocol address and it is a numerical label assigned to each device from a network that uses the Internet Protocol for communication. The IP address has two functions: for host and network interface identification, as well as location addressing. In simple terms, we can explain the IP address as follows: "A name indicates what we seek on a network. An address indicates where it is. A route indicates how to get there". This means that the Internet Protocol address has information about the "name", location and the route to the device. Let’s get into more detail so that you better understand this concept:

What Is Internet Protocol Version 4 (IPv4)?

Internet Protocol Version 4 or IPv4 is the fourth version of the Internet Protocol. It uses 32-bit addresses which limits the address space to 4.294.967.296 (2^32) possible unique addresses. In order to be understood by everyone, IPv4 addresses are represented in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by dots (eg. 172.16.254.1).

IPv4 addresses can be divided into three categories named classes. As you can see in the table below, the main difference between each class is the number of bits allocated for network and host identification. Also, the class from which an IPv4 address comes, can be identified according to the leading bits of binary form of the first integer, from dot-decimal notation. For example, the IP address in the picture above is an class B IP address because the leading bits of the binary form of 172 (10101100) are 10.

In addition, there are other addresses used for particular actions. As you can see in the table below the class D IPv4 addresses are used for multicast addressing. In computer networking, multicast refers to group communication where information is addressed to a group of destination computers simultaneously. For example, the multicast addressing is used in Internet television and multipoint videoconferencing. The class E IPv4 addresses cannot be used in real life because they are used in experimental ways.

What Is Internet Protocol Version 6 (IPv6)?

Internet Protocol version 6 or IPv6 was created in 1995, in order to replace IPv4 addresses. The main reason was the rapid exhaustion of the IPv4 address space. We will run out of them very soon so we had to find a long term solution. The address size was increased from 32-bits to 128-bit, which means that the new address space provides the potential for a maximum of 2^128 different addresses. If you do a simple calculation, you’ll see that the number of IPv6 addresses is more than 7.9 x 10^28 times that number of IPv4 addresses, which is a huge number. Usually, the IPv6 addresses are represented in 8 groups of hexadecimal numbers separated by colons.

As you can see in the picture above the IPv6 addresses are a quite difficult to manage. So, there are some rules that simplify the way you write these addresses. If one or more groups are "0000", the zeros may be omitted and replaced with two colons (::) and the zeros from the beginning of a group can also be omitted. All the addresses below are correct and equivalent.

NOTE: In contrast to IPv4, the IPv6 addresses are not divided into classes.

What Is The Subnet Mask?

A Subnet mask is a 32-bit number that masks an IP address, and divides the IP address into network address and host address. Subnet Mask is made by setting network bits to all "1" and setting host bits to all "0". The Subnet mask can be represented in two ways: one is the usual dot-decimal notation like an IP address, and the second using the CIDR notation. It is written as the first address of a network, followed by a slash character (/), and ending with the bit-length of the prefix. For example, instead of writing the IP address (eg. 192.168.1.0) and the subnet mask (eg. 255.255.255.0) you can write the only address followed by a slash and the bit-length of the prefix, which is the number of bits "1" from the binary form of the subnet mask (eg. 192.168.1.0/24).

The subnet mask is used in the subnetting process. Subnetting involves dividing the network into smaller portions called subnets. As you know, an IP address is divided in two parts, one for network identification and one for host identification. Using the subnet mask the main network is divided in one or more smaller networks. This is performed by a bitwise AND operation between the IP address and the (sub)network mask. In simple terms, this means that a part of the bits from the host number are used for the new (sub)network identification.

If you want to learn more about this process, check this guide from techopedia.com.

Conclusion

Nowadays, the Internet is a part of our life. The actual Internet wouldn’t be the same without the Internet Protocol that every device is using. As you can see, the IP addresses are difficult to understand if you don’t have any experience in this field, so if you want to create your own network don’t hesitate to ask for help from someone from someone who deals with such things. If you have other questions about this topic do not hesitate to use the comments form below.