In the world of networking, few concepts are as foundational as IP addresses. Whether you’re configuring a router, troubleshooting connectivity issues, or simply connecting to the internet, an IP address is crucial to your network’s communication. Among the different types of IP addresses, IPv4 remains the most widely used version today, despite the increasing adoption of its successor, IPv6. In this post, I’ll dive deep into the specifics of IPv4 addresses, breaking down what they are, how they work, and why they remain important even in the evolving era of IPv6.
I. What is an IP Address?
At its core, an IP (Internet Protocol) address is a unique numerical identifier assigned to every device connected to a network, such as computers, smartphones, servers, or IoT (Internet of Things) like smart home or office devices. Think of it as a postal address for devices on a network—it allows data to be sent to and received from the right location.
There are two major versions of IP addresses: IPv4 and IPv6. While IPv6 is the future, IPv4 continues to dominate the global internet infrastructure due to its widespread deployment and backward compatibility.
II. The Structure of an IPv4 Address
An IPv4 address is a 32-bit number typically written in dotted decimal notation, which looks like this: 192.168.1.1. This notation makes it easier for humans to read and interpret the address. The 32 bits are split into four segments (called “octets”), each of which is 8 bits long. Each octet is represented as a decimal number between 0 and 255. So, each IPv4 address consists of four decimal numbers, separated by dots.
Each octet can represent a number between 0 and 255 (2^8 = 256 possible values per octet). This structure allows for over 4 billion unique IPv4 addresses, which, while significant, is not enough to cover the ever-growing number of internet-connected devices.
III. How Are IPv4 Addresses Assigned to Devices?
IPv4 addresses are assigned in two primary ways: static and dynamic.
Static IP addresses are manually configured and remain constant until changed by the network administrator. These are typically used for servers or devices that need a permanent address.
Dynamic IP addresses are assigned automatically by a DHCP or Dynamic Host Configuration Protocol server. When a device joins the network, the DHCP server allocates an available IP address from a predefined pool. This address may change each time the device connects, but for most user devices (e.g., laptops or smartphones), this isn’t a problem and is transparent to the user and device. DHCP Lease Time is the amount of time a device is allowed to use an IP address. A typical lease time for home, or a corporate office, with a relatively stable number of connected devices could be 24 hours. For an environment like public WiFi at an airport, the lease time would be much shorter due to the transient nature of visitors needing to briefly connect and the IP address quickly repurposed for another user.
There’s also a distinction between private and public IPv4 addresses. Private IP addresses are used within local networks and aren’t routable over the internet. Public IP addresses, on the other hand, are used to uniquely identify devices on the broader internet.
IV. IPv4 Address Classes and Subnetting
When IPv4 was originally created, it defined 5 Subnet Classes; A through E, with each class having specific characteristics based on the first few bits of the address. These primary classes are:
Class A: For large networks, with addresses from 0.0.0.0 to 127.255.255.255. Subnet mask 255.0.0.0 (/8)
Class B: For medium-sized networks, with addresses from 128.0.0.0 to 191.255.255.255. Subnet mask 255.255.0.0 (/16)
Class C: For small networks, with addresses from 192.0.0.0 to 223.255.255.255. Subnet mask 255.255.255.0 (/24)
Class D: Used for multicast addresses (not for general network assignments) with addresses from 224.0.0.0 to 239.255.255.255.
Class E: Reserved for experimental purposes with addresses from 240.0.0.0 to 255.255.255.255.
Classes A through C were, and still are, the only subnets that are allocated for public use.
A Class A subnet has 16,777,216 IP addresses, a Class B has 65,536 addresses, and a Class C has 256 addresses.
Back in the 1980s, if an organization wanted a block of IP addresses, they had to request them from IANA, or the Internet Assigned Numbers Authority. The theory at the time was that if a requesting organization wanted a Class A block with ~16.7 million addresses, it came from the Class A pool with the first octet being between 0 and 127. If the requesting organization wanted a Class B, it came from the Class B pool with the first octet being between 128 and 191, if they wanted a Class C, it came from the Class C pool with the first octet being between 192 and 223.
Prior to 1993, the allocation of IP addresses, subnetting, and routing, were very different. Classful routing as it was known, was based on the fixed structure of classful addressing defined by the 5 classes listed above. Put simply, if an organization was allocated the subnet 135.10.0.0, the internet structure and routing protocol knew it was a Class B network because the first octet (135) was between 128 and 191. Similarly, if an organization was allocated the subnet 193.1.2.0 routing knew it was a Class C network because the first octet (193) was between 192 and 223. This classful routing meant that 135.10.0.0 always had to be routed as a Class B which was very inefficient and very wasteful from an IPv4 assignment and usage perspective, and this was one of the main drivers which led to a shortage of IPv4 addresses.
Let’s take an example of an organization wanting to deploy 2,000 new servers. A Class C subnet with only 256 IP addresses is too small, so the only option was the assignment of a Class B with 65,536 addresses – much more than what was needed.
To efficiently use the available address space, subnetting is often employed. Subnetting allows a single network to be divided into smaller, more manageable segments (subnets). This helps optimize address allocation and improve network performance.
The introduction of CIDR (Classless Inter-Domain Routing) in 1993 was a game changer for the internet as it allowed for a much more granular and efficient method for subnetting and IP address allocations. Instead of the legacy Class A, B and C only subnets, CIDR introduced 33 (or 30 new) subnet classifications, all the way from a /32 CIDR notation with 1 IP address to a /0 with ~4.3 billion IP addresses, or the entire IPv4-based internet.
Using the example above of an organization wanting to deploy 2,000 new servers and before having to assign a Class B block, that organization can now assign a /21 subnet with 2,048 addresses to that project, or perhaps a /20 with 4,096 addresses if future growth is projected; in short, much, much more efficient and effective.
CIDR | IP Addresses | Notes |
/32 | 1 | Host (single addr) |
/31 | 2 | |
/30 | 4 | 2 useable |
/29 | 8 | 6 useable |
/28 | 16 | 14 useable |
/27 | 32 | 30 useable |
/26 | 64 | 62 useable |
/25 | 128 | 126 useable |
/24 | 256 | “Class C” 254 useable |
/23 | 512 | 2 Class C’s |
/22 | 1,024 | 4 Class C’s |
/21 | 2,048 | 8 Class C’s |
/20 | 4,096 | 16 Class C’s |
/19 | 8,192 | 32 Class C’s |
/18 | 16,384 | 64 Class C’s |
/17 | 32,768 | 128 Class C’s |
/16 | 65,536 | “Class B” |
/15 | 131,072 | 2 Class B’s |
/14 | 262,144 | 4 Class B’s |
/13 | 524,288 | 8 Class B’s |
/12 | 1,048,576 | 16 Class B’s |
/11 | 2,097,152 | 32 Class B’s |
/10 | 4,194,304 | 64 Class B’s |
/9 | 8,388,608 | 128 Class B’s |
/8 | 16,777,216 | “Class A” |
/7 | 33,554,430 | |
/6 | 67,108,862 | |
/5 | 134,217,726 | |
/4 | 268,435,454 | |
/3 | 536,870,910 | |
/2 | 1,073,741,822 | |
/1 | 2,147,483,646 | |
/0 | 4,294,967,292 | All IPv4 space |
V. Who Allocates and Documents IPv4 Subnet Ownership?
In the early days of the internet, IANA (the Internet Assigned Numbers Authority) directly managed and allocated all IPv4 subnets in existence. In the 1990s as the internet quickly expanded, 5 Regional Internet Registries were established:
ARIN (American Registry for Internet Numbers):
Covers North America and parts of the Caribbean.
RIPE NCC (Réseaux IP Européens Network Coordination Centre):
Covers Europe, the Middle East, and parts of Central Asia.
APNIC (Asia-Pacific Network Information Centre):
Covers Asia and the Pacific region.
LACNIC (Latin American and Caribbean Internet Addresses Registry):
Covers Latin America and parts of the Caribbean.
AFRINIC (African Network Information Centre):
Covers Africa.
VI. What Are IPv4 Addresses Used For?
IPv4 addresses are used for a wide range of networking tasks and have critical roles in both local and global network communications. Here are the most common use cases:
1. Device Identification on Networks
IPv4 addresses serve as unique identifiers for devices on a network, allowing routers and other network equipment to direct data packets to the correct location. Whether it’s a computer, a phone, a printer, or an IoT device, each must have an IP address to send and receive data.
2. Internet Communication
Every device connected to the internet needs an IPv4 address to communicate with other devices across the globe. Public IPv4 addresses are assigned to websites, servers, and services that users access from their local devices. When you type a URL into your browser, the DNS (Domain Name System) resolves that address into an IP address (IPv4 or IPv6) to connect you to the correct server.
3. Local Networking
In private networks (like home or office networks), IPv4 addresses are used to assign devices to a specific local segment. Devices on the same local network can communicate with each other using these private IPv4 addresses, while NAT handles communication with the wider internet.
4. Routing and Data Delivery
Routers and switches use IPv4 addresses to forward data packets across networks. Each time data moves from one network to another, the IPv4 address is used to determine the correct path, ensuring that information reaches the right destination.
5. VPNs and Secure Connections
When using a Virtual Private Network (VPN), IPv4 addresses are used to route traffic between the user’s device and the VPN server. The VPN may assign a private IP address to the user’s device to ensure secure, encrypted communication between networks.
6. Hosting Websites and Services
Servers that host websites, web applications, and other services need public IPv4 addresses so that users can access them over the internet. These servers may also use private IP addresses internally for communication between components (e.g. database servers, web servers, etc.).
VII. The Limitations of IPv4
While IPv4 has served as the backbone of the internet for decades, it has its limitations. The most significant issue is address exhaustion. With more and more devices coming online, the pool of available IPv4 addresses has dwindled.
To mitigate this, NAT has been used, but it’s far from a perfect solution. NAT creates problems for certain applications (such as peer-to-peer communication) and adds complexity to network configurations.
This shortage of IPv4 addresses is one of the driving factors behind the development of IPv6, which offers an exponentially larger address space. There are roughly 340 undecillion (340 trillion trillion trillion) IPv6 addresses.
VIII. IPv4 vs. IPv6
IPv6, with its 128-bit address space, provides an almost infinite number of unique addresses. It’s designed to solve the address shortage issue, among other improvements, such as better security and more efficient routing.
However, IPv4 remains dominant due to the slow pace of IPv6 adoption and the substantial infrastructure built around IPv4. Transitioning from IPv4 to IPv6 is a complex, ongoing process, and IPv4 will likely remain in use for many years to come.
IX. Conclusion
Despite the rise of IPv6, IPv4 remains the backbone of internet communications, and knowledge of its structure, assignment methods, and limitations is essential for anyone involved in networking or IT.
As the internet continues to evolve and more devices connect online, the transition to IPv6 will inevitably increase, but IPv4 will continue to play a significant role in networking for the foreseeable future.