
IP Address and Subnetting Explained for Beginners

What is ip address?
IP address is either a string of numbers (IPv4) or hexadecimal digits (IPv6) which ensure that data is accurately routed between the various devices.
IP addresses can be categorized based on the following perspectives:
-
Based on Addressing Scheme
- IPv4: Consists of four decimal numbers (0–255) separated by dots,like
192.168.1.1
. It is a 32-bit address made up of 4 octets, supporting over 4 billion unique addresses. - IPv6: Consists of eight groups of four
hexadecimal digits separated by colons,like
2001:0db8:85a3::8a2e:0370:7334
. It uses 128-bit addressing, providing a vastly larger pool of unique addresses.
- IPv4: Consists of four decimal numbers (0–255) separated by dots,like
- Based on Usage
- Public IP: Globally unique and assigned by ISPs. Used to access the internet. Can be static or dynamic.
- Private IP: Used inside local networks →
192.168.x.x
. Not routable on the internet. Requires NAT for outside access.
- Based on Assignment Method
- Static IP: Manually assigned and remains constant over time. Commonly used for servers, printers, and other network infrastructure.
- Dynamic IP: Automatically assigned by a DHCP server and may change over time. Typically used for personal computers and home networks.
- Based on Function
- Unicast IP Address:Identifies a single unique host
Most common type in standard communications - Broadcast IP Address (IPv4 only):Sends data to all devices on a network
- Multicast IP Address: Used to send data to multiple specific recipients simultaneously. It is especially useful for applications like video streaming, online conferencing, and real-time data distribution.
- Unicast IP Address:Identifies a single unique host
How Do IP Addresses Work?
- Identification: Each device on a network is assigned a unique IP address that distinguishes it from others.
- Communication: IP addresses enable devices to send and receive data packets across local and global networks.
- Routing: Routers use IP addresses to determine the best path for forwarding data to its intended destination.
- LAN vs. WAN: Local Area Networks (LANs) use IP addresses for internal device communication, while Wide Area Networks (WANs), like the internet, handle global data exchange.
- NAT (Network Address Translation): Allows multiple devices on a private network to access the internet using a single public IP address, enhancing security and conserving address space.
Consider this example of email transmission from Ethiopia
to America
:
Solomon in Ethiopia wants to send an email to John in America. Both users are on private IP addresses within their respective home networks. Their routers, which are assigned public IPs by their ISPs, manage external communication. Solomon’s email is broken into data packets and routed through various global networks. Once it reaches John’s mail server in America, the packets are reassembled into the original message. John can then view the email on his device via his local IP, all made possible by IP addressing, NAT (Network Address Translation), and DNS (Domain Name System).
The most widely used IP address class is IPv4, which is separated into five classes to arrange the distribution of addresses:
- Class A →from 1.0.0.0 to 127.255.255.255 and ~16 million hosts per network
- Class B → from 128.0.0.0 to 191.255.255.255 and ~65,000 hosts per network
- Class C → from 192.0.0.0 to 223.255.255.255 and 254 hosts per network
- Class D → from 224.0.0.0 to 239.255.255.255 and Multicast
- Class E → from 240.0.0.0 to 255.255.255.255 and used for Experimental purpose.
The following are considered special IP addresses
due
to their specific roles and reserved purposes in networking:
- Loopback →
127.0.0.1
used to test internal network stack in the case of localhost. - Broadcast →
192.168.1.255
sends data to all devices in a subnet. - Multicast →
233.0.0.1
sends data to multiple selected devices.
To find the IP address of a Windows operating system, follow these simple steps:
- Open
Command Prompt
. - Type
ipconfig
and pressEnter
. - Look for the IPv4 Address under your active network connection.
Subnetting in Computer Networks
The process of splitting a single IP network into smaller, easier-to-manage sub-networks, known as subnets, is known as subnetting. It is a crucial component of network architecture and is frequently employed by administrators to maximize IP address utilization and enhance network functionality.
For example, instead of assigning the entire address block 37.1.1.0
to Office-1
and requiring the company to purchase more IP addresses,
subnetting allows us to split that large block into smaller subnets and assign one to each office.
This improves address efficiency and enhances control.
Subnetting a computer network is important for the following reasons:
- To Divide large networks into smaller, more manageable subnets.
- To Simplify network maintenance and troubleshooting.
- To Enhance security by isolating segments within the network.
Drawback: To reach a specific application, the process must pass through multiple layers → network ID, subnet ID, host IP, and finally, the application port.
Let's assume 192.168.10.0
is a Class C network. In Class C, the default subnet mask is
255.255.255.0
, meaning the host ID starts with all 0s.
To divide this network into two subnets, we borrow 1 bit from the host ID 2¹ = 2 subnets
.
This leaves us with 7 bits for host addressing.
Subnet Ranges:
- First Subnet:
192.168.10.0
to192.168.10.127
- Second Subnet:
192.168.10.128
to192.168.10.255
In the first subnet:
192.168.10.0
is used as the subnet ID and also as the network ID when viewed internally.192.168.10.127
is used as the directed broadcast address.
In the second subnet:
192.168.10.128
is the subnet ID.192.168.10.255
serves as the directed broadcast address.
It's important to note that during subnetting, the number of usable host IP addresses is reduced. The first and last IP addresses in each subnet are reserved — one for the subnet ID and one for the broadcast address.
Context-based Interpretation:
How can we determine whether 192.168.10.0
is the network ID of the entire network or the
subnet ID of the first subnet?The answer will depends on the sender’s location:
- If the sender is outside the network, it treats
192.168.10.0
as the network ID for the whole block. - If the sender is inside the network, it treats
192.168.10.0
as the subnet ID of the first subnet.
Private Subnets:
Certain IP address ranges are reserved specifically for use in private networks. These addresses are not routable on the public internet and are commonly used in homes, labs, local area networks (LANs), and behind Network Address Translation (NAT) devices or routers.
Reserved Private IP Ranges:
10.0.0.0/8
– Range:10.0.0.0
to10.255.255.255
(Class A)172.16.0.0/12
– Range:172.16.0.0
to172.31.255.255
(Class B)192.168.0.0/16
– Range:192.168.0.0
to192.168.255.255
(Class C)
These private IP addresses can be used freely by anyone within internal networks without requiring coordination with any external organization or IP registry.
One key benefit is that internet routers are configured to never forward packets originating from these private ranges. This makes them safe for internal use, reducing the risk of IP conflicts or security breaches when connecting to the internet.
Supernetting in computer network
The practice of merging a collection of adjacent subnetted networks into a single, larger network is known as supernetting. Other names for this method are route aggregation and route summarization.
Optimizing routing tables is the main goal of supernetting. Supernetting reduces the size of a routing table, which lists all known networks, by combining several entries into a single entry.
A supernet mask is a 32-bit address composed of 1s and 0s that defines the network structure:
- The number of 1s represents the fixed (network) portion.
- The number of 0s represents the variable (host) portion.
Here are the key rules for supernetting:
- All networks must be contiguous.
- All networks must be of the same size.
- The first network address must be evenly divisible by the total size of the supernet.
Example: Suppose we have the following network IDs:
- 192.168.0.0
- 192.168.1.0
- 192.168.2.0
- 192.168.3.0
We have to check the Condition:
- All network addresses are contiguous.
- Each network is the same size (e.g., 2⁸ = 256 addresses).
- The first network (192.168.0.0) is divisible by the total supernet size (e.g., 2¹⁰ = 1024).
Since 2⁸ ÷ 2¹⁰ = 0 remainder, this condition is satisfied.
Now let’s determine the supernet mask using binary:
- 192.168.0.0 = 192.168.00000000.00000000
- 192.168.1.0 = 192.168.00000001.00000000
- 192.168.2.0 = 192.168.00000010.00000000
- 192.168.3.0 = 192.168.00000011.00000000
The fixed binary portion is 192.168.000000
; the rest is variable.
By converting the fixed part to 1s and variable part to 0s, we get:
255.255.252.0
as the supernet mask.
To determine the Network ID (NID) of each IP address, we apply the supernet mask using a bitwise AND operation:
IP Address + Supernet Mask = Network ID
After applying the supernet mask to all the listed addresses, we find that they all belong to the same supernet: 192.168.0.0. This becomes the supernet ID.
As a result, the routing table now contains a single summarized entry:
192.168.0.0
with the mask 255.255.252.0
.
Initially, there were four separate entries in the routing table one for each individual network. Through supernetting, these have been consolidated into one, simplifying the routing process and reducing overhead.
Latest Posts

How to Configure a Client-Server Network.

What Our Users Say.

Object Oriented Programming in C++ for Beginners.

I’m committed to providing tailored solutions and always ready to assist if any issue arises.