Demystifying IP Addresses: A Guide to Networking

Introduction

Abhay Ahire
5 min readOct 29, 2023

Are you interested in networking?
Let’s first understand how internet works. Not about internet basics though.

How Domain Resolution Works?

When you type a web address (like “www.example.com") into your browser, here’s what happens:

  1. Your browser asks a DNS (Domain Name System) resolver like Amazon Route 53 to find the IP address for the given domain.
  2. The resolver checks its cache. If it doesn’t have the IP, it asks the root server where to find the domain’s DNS server.
  3. The DNS server for the domain provides the IP address.
  4. Your browser uses this IP to connect to the web server, which hosts the website you want to visit.
    So what is ip address?

IP addresses

IP addresses are the fundamental building blocks that enable communication across the internet. Whether you’re a seasoned developer or just starting out, understanding the details of IP addresses is crucial.
In this blog series, we’ll dive into the world of IP addresses.
We will understand IPv4 Addresses, classes and CIDR notation
IPv4 Addresses: The Cornerstone of Internet Communication
IP (Internet Protocol) addresses are the heart of the internet, acting as unique identifiers for devices on networks.
In this blog, we’ll focus on IPv4 addresses, the most commonly used version.
Let’s start with the basics.

Structure of IPv4 Address

Structure of Ip Address

An IPv4 address consists of four decimal numbers separated by periods, following the dotted decimal notation.
For example: 192.168.0.1.
Each of these numbers represents an octet (8 bits) of the address in binary form.
Let’s break down the address 192.168.0.1.
This address comprises four octets, where “192” signifies the network.
168” represents the subnet within that network.
0.1” (This depend upon subnet mask) identifies a specific device on that subnet.
This breakdown is essential because it helps in routing data to the correct destination.

Network and Host

Every IPv4 address is composed of two parts: the network ID and the host ID.
To differentiate between them, we use a subnet mask.
Take, for instance, the address 192.168.0.1/24, where the subnet mask is 255.255.255.0. The first 24 bits are the network ID, and the remaining 8 bits represent the host ID.
Imagine you live in an apartment complex.
The building’s address represents the network, your apartment number is your host ID.
The layout of the complex is similar to the subnet mask. It can help direct visitors to visit the correct building and apartment.
E.g. Network : Epsilon Society Host Id : Flat no. 1
Network : Epsilon Society Host Id : Flat no. 2

Classes of IPv4 Addresses

IPv4 addresses are categorised into three main classes: A, B, and C.

Ipv4 Classes

Class A: Class A addresses range from 1.0.0.0 to 126.0.0.0.
They use an 8-bit subnet mask, allowing for a massive number of total usable addresses. The first octet is used for the network ID, while the remaining three are for host IDs.
Class A addresses are like mega cities within the world, with countless addresses.

Class B: Class B addresses span from 128.0.0.0 to 191.0.0.0.
They employ a 16-bit subnet mask. It has more moderate number of usable addresses. The first two octets are dedicated to the network ID.
Think of Class B addresses as neighbourhoods in the internet city.
Each neighbourhood is a network, and every house within it is a host.
These addresses are ideal for medium-sized organisations and networks.

Class C: Class C addresses extend from 192.0.0.0 to 223.0.0.0.
They use a 24-bit subnet mask, providing a smaller range of usable addresses.
In this case, the first three octets form the network ID.
Class C addresses resemble small communities in the internet landscape.
Each community is a network, and each house represents a host.
Class C addresses are commonly used for smaller networks, such as home or office setups.

Private IP Address Ranges

Within the world of IPv4 addresses, certain ranges are reserved for private use. These addresses are not routable on the public internet but are invaluable for creating private networks.
Suppose you’re setting up a home network.
You might choose an IP address like 192.168.0.1 for your router. This falls within the private Class C range, and it won’t conflict with public internet addresses.

Classless Interdomain Routing (CIDR)

As the internet continues to grow, a more flexible method for allocating IP addresses came out — Classless Interdomain Routing (CIDR). CIDR allows for variable-length subnet masks, which make IP address allocation much more efficient.
Simplified Example
Suppose you’re managing a large organization with multiple branches. Traditionally, you might allocate fixed, often oversized address ranges for each branch. This can lead to a waste of IP addresses.

With CIDR:

Your main office can use the IP range 192.168.0.0/16.
Each branch can use something like 192.168.1.0/24.
Here’s what it means:
“192.168.0.0” is the network’s base address.
“/16” and “/24” are subnet masks, specifying how many bits are used for the network portion.
Efficiency at Its Best
CIDR ensures efficient use of IP addresses. You allocate precisely the number of addresses needed for each location.
CIDR simplifies IP address management, making allocation and utilisation precise and efficient, which is crucial in our ever-growing digital world.

Conclusion

Understanding IPv4 addresses is paramount in networking, and this blog has taken you through the essentials. We’ve covered the structure of IPv4 addresses, the concept of network and host. Also the classes of IPv4 addresses, private IP address ranges, and the flexibility provided by CIDR. In our next blog, we’ll dive deeper into the AWS VPC and it’s details. Stay tuned for more networking insights!

--

--

Abhay Ahire

Full stack Dev with Angular, Java , Node and Devops Engg AWS