
Demystifying IP Addresses and Netmasks: The Complete Overview

In this blog, we will learn about IP addresses and netmasks.
IP
The Internet Protocol (IP) is a unique identifier for your device, similar to how a mobile number uniquely identifies your phone.
IP addresses are typically represented as four Octets for IPv4, with each octet being One byte/Octets in size, and eight octets for IPv6, with each octet being two bytes/Octets in size.
Examples:
- IPv4: 192.168.43.64
- IPv6: 2001:db8:3333:4444:5555:6666:7777:8888
For the purposes of this discussion, we will focus on IPv4.
Do we really require four Octets structure with dots between them?
The answer is NO
The only requirement for an IPv4 address is that it must be 4 bytes in size. However, it does not have to be written as four octets or even with dots separating them.
Let's test this by fetching Google's IP address using the nslookup command.

Convert this to binary number using bc calculator in Bash shell.

And you can see it’s working.
This is because the octet structure and the dots between them are only for human readability. Computers do not interpret dots; they just need an IP address that is 4 bytes in size, and that’s it.
The range for IPv4 addresses is from 0.0.0.0 to 255.255.255.255.
Types of IP Addresses
IP addresses are classified into two main types: Public IPs and Private IPs.
Private IP addresses are used for communication between local devices without connecting to the Internet. They are free to use and secure to use.
You can find your private IP address by using the ifconfig command

The private IP address ranges are as follows:
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255
Public IP addresses are Internet-facing addresses provided by an Internet Service Provider (ISP). These addresses are used to access the internet and are not free.
By default
Private IP to Private IP communication is possible.
Public IP to Public IP communication is possible.
However:
Public IP to Private IP communication is not possible.
Private IP to Public IP communication is not possible.
Nevertheless, these types of communication can occur through Network Address Translation (NAT), which is typically used by your home router. This is why you can access the Internet even with a private IP address.
Netmasks
Netmasks are used to define the range of IP addresses within a network.

Which means,

You can see 24 Ones and 8 Zeros.
Here, we have converted 255 to binary using division method.
255 ÷ 2 = 127 remainder 1
127 ÷ 2 = 63 remainder 1
63 ÷ 2 = 31 remainder 1
31 ÷ 2 = 15 remainder 1
15 ÷ 2 = 7 remainder 1
7 ÷ 2 = 3 remainder 1
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
So, binary value of 255 is 11111111
By using this, we can able to find the number of IP addresses and its range.
Since we have 8 zeros, so
Number of IPs = 2 ^8 which equals to 256 IPs. SO, the usable IP range is 10.4.3.1 - 10.4.3.254 and the broadcast IP is 10.4.3.255.
And we can also write this as 255.255.255.0/24 . Here 24 denotes CIDR (Classless Inter-Domain Routing).
Thats it.
Kindly let me know in comments if you are any queries in these topics.
Written by
Sri Vishnuvardhan
Building production-grade geospatial platforms that combine GIS, remote sensing, cloud infrastructure, AI, and platform engineering to transform spatial data into scalable, real-world intelligence.
Enjoyed this article?
Subscribe to get notified when new articles on DevOps, Cloud, and platform engineering are published.
You'll receive a welcome email with a confirmation link. No spam — unsubscribe anytime.
Have a project in mind?
I work on cloud-native platforms, DevOps automation, and geospatial intelligence systems. Let's talk.
Related Articles
Keep exploring — you might also enjoy these.

Setting up your own High Availability managed WordPress hosting using Amazon RDS
Hosting your own WordPress website is interesting right!! Ok, come on let's do it!! We are going to do this practical from Scratch. From the Creation of our Own VPC, Subnets, Internet Gateway, Route tables to Deployment of WordPress. Here, we are going to use Amazon Web Service’s RDS service for hosting our own WordPress site. Before that, let's take a look at a basic introduction to RDS service. Amazon Relational Database Service is a distributed relational database service by Amazon Web

Linux Partition: Static Partition Scaling without any data loss
In this blog, we are going to see how to increase or decrease the size of the static partition in Linux without compromising any data loss and how to do that in Online mode without unmounting. I already explained the basic concepts of partition in very detail in my previous blog. You can refer to that blog by clicking here. In this practical, the Oracle VirtualBox is used for hosting the Redhat Enterprise Linux (RHEL8) Virtual Machine (VM). The first step is to attach one hard disk. So, I

Helm Charts
In this article we are going to see more about Helm charts and how to utilize it to achieve productivity in your Kubernetes deployment. Contents * Helm Chart Introduction * Helm Installation * Creation of our own Helm charts & Package deployment * Real-Time deployment upgrade * Push our Helm Charts to Artifact Hub * Import Helm charts from Artifact Hub & Package deployment Helm Chart In simple words, Helm is like a RPM in Redhat Enterprise Linux (RHEL) and APT in Ubuntu L