IP Addresses and Subnetting

Fullstack web developer / Blockchain developer, loves working with others and try to bring my best to them, i write and make youtube videos when i'm not coding.
In today’s hyper-connected world, where billions of devices communicate seamlessly across the internet, IP addresses serve as the backend of digital communication, acting as unique identifiers for every device on a network. Much like a postal address ensures your mail reaches the right destination, an IP address directs data to its intended recipient, whether it’s your smartphone, a server, or an IoT device. However, as networks grow in size and complexity, efficiently managing these addresses becomes a critical challenge. This is where subnetting comes in, a powerful technique that divides large networks into smaller, more manageable subnetworks, optimizing performance, enhancing security, and preventing address exhaustion. In this article, we’ll explore the concepts of IP addresses and subnetting, examining their structure, purpose, and practical applications.
Whether you’re aspiring to become a network administrator, exploring cybersecurity, or simply curious about the mechanics of the internet, this guide offers a clear foundation for mastering the essential principles of IP addressing and subnetting.
Understanding IP Addresses
What is an IP Address?
An IP address, or Internet Protocol address, is a unique identifier assigned to every device connected to a network, enabling seamless communication across the internet or local networks. Think of it as a digital phone number, just as you dial a specific number to reach a friend, devices use IP addresses to send and receive data packets accurately. Without IP addresses, the internet as we know it would grind to a halt, unable to route emails, web pages, or streaming content to the right destinations.
There are two primary versions of IP addresses in use today: IPv4 and IPv6. IPv4, the older and more widely used standard, is running out of available addresses due to the explosive growth of internet-connected devices. IPv6, its successor, was designed to accommodate this expansion with a vastly larger address pool. Understanding the difference between these two is key to grasping how networks function.
IPv4: Uses a 32-bit address format, typically written as four decimal numbers separated by dots (e.g., 192.168.1.1). It supports about 4.3 billion unique addresses, which seemed sufficient decades ago but is insufficient for the modern internet, with billions of new devices connecting every day, from smartphones to smart home gadgets. This scarcity, known as IPv4 address exhaustion, has been mitigated through techniques like Network Address Translation (NAT), which allows multiple devices to share a single public IP address, and Classless Interdomain Routing (CIDR), which enables more flexible allocation of address blocks. Subnetting plays a crucial role here by dividing larger networks into smaller subnetworks, optimizing the use of available addresses and reducing waste.
IPv6: Employs a 128-bit address format, written as eight groups of hexadecimal digits separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). It offers an astronomical number of addresses, enough to assign one to every atom on Earth’s surface, with room to spare. Despite its advantages, IPv6 has not fully replaced IPv4 as of today, with global adoption hovering around 45%. Key reasons for this slow transition include a lack of strong incentives for Internet Service Providers (ISPs) to upgrade, the high costs and complexity of migrating existing infrastructure (such as updating hardware, software, and training staff), and IPv6’s lack of backward compatibility with IPv4, requiring dual-stack operations. Additionally, behavioral resistance to change and the continued effectiveness of IPv4 exhaustion mitigation strategies (like NAT and CIDR) have stalled widespread adoption.
Structure of an IP Address
To understand how IP addresses work, let’s break down their structure:
IPv4 Structure: An IPv4 address consists of 32 bits, divided into four 8-bit segments (octets), each represented as a decimal number from 0 to 255. For example, in the address 192.168.255.255, each number corresponds to an octet. The address is split into two parts:
Network Portion: Identifies the specific network a device is connected to.
Host Portion: Identifies the individual device within that network.
The division between these portions is determined by a subnet mask, which we’ll explore in the subnetting section.

IPv6 Structure: IPv6 addresses are far longer, with 128 bits divided into eight 16-bits blocks, each expressed as four hexadecimal digits. For readability, leading zeros in each block can be omitted, and consecutive sections of all zeros can be shortened with a double colon (::), but only once per address. For instance, 2001:0db8:0000:0000:0000:0000:0000:0001 can be simplified to 2001:db8::1. This structure supports the massive scale of modern and future networks.

What is Subnetting?
Subnetting is the process of dividing a larger network into smaller, more manageable subnetworks, or subnets. Each subnet operates as its own mini-network, with a unique range of IP addresses, allowing devices within it to communicate efficiently while remaining part of the broader network. Think of subnetting as organizing a massive library: instead of piling all books into one chaotic heap, you create sections for fiction, non-fiction, and reference, making it easier to find and manage resources.
Challenges of Large Networks
As networks grow, they face significant hurdles that subnetting helps address:
IP Address Exhaustion: As discussed with IPv4, the 4.3 billion available addresses are insufficient for the ever-growing number of devices, from smartphones to IoT sensors. Without careful management, large networks could assign oversized address blocks to small groups, increasing scarcity. Even with techniques like Network Address Translation (NAT), inefficient allocation can strain resources.
Network Congestion and Broadcast Traffic: In a large, undivided network, devices send broadcast messages (like discovery requests) to every other device, clogging the network and slowing performance. Imagine a crowded room where everyone is shouting at once, communication becomes chaotic. Subnetting reduces this noise by limiting broadcast traffic to smaller groups.
Subnetting as a Solution
Subnetting tackles these challenges by optimizing network performance and management. By carving a large network into smaller subnets, you create efficient, self-contained units that reduce unnecessary traffic and improve speed. For instance, a university might subnet its network to separate student dorms, faculty offices, and research labs, ensuring each segment operates smoothly without interfering with others. Subnetting also stretches IPv4’s limited address space by enabling precise allocation, complementing other exhaustion-mitigation strategies like NAT and CIDR. Moreover, it enhances security by creating barriers between subnets, making it harder for threats to spread across an entire network.
In essence, subnetting is like urban planning for networks: it organizes the digital landscape into neighborhoods, each with its own structure and purpose, ensuring the entire system runs efficiently and securely.
How Subnetting Works
If subnetting is the urban planning of networks, dividing digital cities into efficient neighborhoods, then how do network administrators draw these boundaries? Just as a city planner uses maps and measurements to carve out districts, subnetting relies on precise tools and calculations to organize IP addresses. In this section, we’ll dive into the nuts and bolts of subnetting, exploring subnet masks, CIDR notation, and step-by-step calculations to show you how to transform a chaotic network into a well-structured system ready for today’s digital demands.
Subnet Masks
A subnet mask is the key tool that defines the boundaries of a subnet, determining which part of an IP address identifies the network and which part identifies the host. Think of it as a filter that separates the “street name” (network) from the “house number” (host) in our digital address system. For example, a common subnet mask like 255.255.255.0 (or /24 in CIDR notation) indicates that the first three octets of an IPv4 address (e.g 192.168.1.0) represent the network, while the last octet (e.g., 1 to .254) identifies individual devices.
How It Works: In binary, a subnet mask consists of a series of 1s (for the network portion) followed by 0s (for the host portion). For 255.255.255.0, this is 11111111.11111111.11111111.00000000 (24 bits of 1s). When applied to an IP address like 192.168.1.1, the mask isolates the network (192.168.1.0) and host (0.0.0.1) portions.
Role: By defining these boundaries, subnet masks enable devices to determine whether a destination IP address is within their own subnet (local communication) or requires routing to another subnet, reducing unnecessary traffic and enhancing efficiency.
CIDR Notation
Classless Inter-Domain Routing (CIDR) is a modern approach to IP address allocation, instead of fixed network sizes, CIDR uses a suffix (e.g., /24) to indicate the number of bits in the subnet mask, allowing precise control over network size.
With CIDR, an IP address like 192.168.1.0/24 tells us the network portion spans 24 bits (equivalent to 255.255.255.0). This flexibility allows administrators to create subnets of any size, from a handful of addresses to thousands, optimizing IP usage.
Example: For 192.168.1.0/24, the /24 means the first 24 bits are fixed for the network, leaving 8 bits for hosts (supporting up to 256 addresses, 254 usable for devices). CIDR’s adaptability is a cornerstone of modern subnetting, especially for conserving IPv4 addresses.
Calculating Subnets
Subnetting involves dividing a larger network into smaller subnets through a series of calculations. Let’s walk through the process using a network with address, 192.168.1.0/24, as an example, splitting it into four subnets.
Step-by-Step Process:
Determine the Number of Subnets Needed: Suppose we need four subnets for different departments (e.g., HR, IT, Sales, and Guest Wi-Fi).
Calculate Subnet Bits: To create four subnets, we need 2 bits (since 2² = 4). These bits are “borrowed” from the host portion of the original /24 mask, resulting in a new mask of /26 (24 + 2 = 26 bits).
Determine the New Subnet Mask: A /26 mask is 255.255.255.192 (11111111.11111111.11111111.11000000 in binary).
Calculate Hosts per Subnet: With a /26 mask, 6 bits remain for hosts (32 total bits — 26 network bits = 6 host bits). This yields 2⁶ = 64 addresses per subnet, with 62 usable for devices (subtracting 1 for the network address and 1 for the broadcast address).
Identify Subnet Ranges: Each subnet increments by 64 addresses (256 ÷ 4 = 64). The ranges are:
Subnet 1: 192.168.1.0–192.168.1.63 (usable: .1 to .62)
Subnet 2: 192.168.1.64–192.168.1.127 (usable: .65 to .126)
Subnet 3: 192.168.1.128–192.168.1.191 (usable: .129 to .190)
Subnet 4: 192.168.1.192–192.168.1.255 (usable: .193 to .254)
6. Assign Subnets: Assign each department a subnet (e.g., HR gets 192.168.1.0/26, IT gets 192.168.1.64/26, etc.).
Here’s a visual representation;

Subnet Calculators
For those who prefer efficiency over manual calculations, subnet calculators are powerful tools that automate the process, delivering instant results for network planning**.**
Subnet calculators, available as online tools (e.g., SolarWinds Subnet Calculator, IP Subnet Calculator by Calculator.net) or software (e.g., Cisco Packet Tracer), allow users to input an IP address and desired number of subnets or hosts, then generate subnet masks, address ranges, and other details. For instance, entering 192.168.1.0/24 and requesting four subnets yields the same ranges as our manual example (192.168.1.0/26, 192.168.1.64/26, etc.), complete with network and broadcast addresses. Many tools also support IPv6 subnetting, which is more complex due to its 128-bit structure.
Practical Application of Subnetting
Now that we’ve seen the mechanics of subnetting, how does it apply in real-world networks? Subnetting isn’t just a theoretical exercise, it’s a practical tool powering networks in businesses, homes, and global enterprises. From isolating sensitive data in a corporate office to securing your smart home devices, subnetting brings order and efficiency to diverse scenarios. Let’s explore how these calculations come to life in practical settings, with examples that show subnetting’s transformative impact.
Consider a mid-sized company, TechTrend Innovations, with three departments (Engineering, Marketing, and Guest Wi-Fi) and a Class C network, 192.168.1.0/24. To optimize its network, the IT team decides to subnet it into three subnets, each tailored to the department’s needs.
- Subnetting Plan:
Engineering (50 devices): Assigned 192.168.1.0/26 (62 usable addresses).
Marketing (30 devices): Assigned 192.168.1.64/26 (62 usable addresses).
Guest Wi-Fi (20 devices): Assigned 192.168.1.128/27 (30 usable addresses, using a /27 mask to save addresses for future growth).
2. Implementation: Using the calculations from the previous section, the IT team borrows bits to create subnets with appropriate host counts. Engineering and Marketing get /26 subnets (64 addresses each), while Guest Wi-Fi uses a /27 subnet (32 addresses). Routers are configured to route traffic between subnets, and firewalls restrict Guest Wi-Fi from accessing internal resources.
3. Benefits: This setup reduces broadcast traffic, isolates guest devices for security, and ensures each department has enough addresses without wasting IP space. If a guest’s device is compromised, it can’t easily access Engineering’s servers.
Conclusion
In summary, IP addresses are the backbone of modern networking, ensuring that billions of devices can communicate reliably, while subnetting provides the structure necessary to keep those networks efficient, secure, and scalable. IPv4’s limitations and IPv6’s promise highlight why careful address management remains essential, and subnetting bridges that gap by optimizing resources, reducing congestion, and strengthening security. Whether applied in enterprises, educational institutions, or home networks, subnetting transforms sprawling digital landscapes into organized, manageable systems. For anyone pursuing networking, cybersecurity, or IT administration, mastering IP addressing and subnetting is not just a technical skill, it’s a foundational building block for navigating and shaping the future of our connected world.
What’s Next?
Learning the concepts is just the beginning, the real mastery comes with practice and application. Here are a few next steps you can take:
Hands-on Practice: Use tools like Cisco Packet Tracer, GNS3, or even VirtualBox with router/firewall VMs to simulate networks and apply subnetting in real scenarios.
Subnetting Drills: Challenge yourself with subnetting problems, calculate ranges, hosts, and masks until you can do it quickly. (Plenty of online subnetting quizzes exist.)
Explore IPv6 Subnetting: Dive deeper into IPv6 and its prefix-based subnetting, which is increasingly important as adoption grows.
Advance to Routing: Once you’re comfortable with subnetting, explore routing protocols (like RIP, OSPF, or BGP) to see how networks exchange information between subnets.
Security Applications: Study how subnetting combines with firewalls, VLANs, and access control to strengthen network security.
By following these steps, you’ll go from understanding subnetting on paper to designing and managing networks with confidence.



