Blog

IPv4 address limitations

Exploring the challenges and potential solutions surrounding IPv4's address limitations and the complexities of transitioning to IPv6

  ·   4 min read

This article discusses the fundamental role of IPv4 in internet routing and its address space limitations, explaining the complexities involved in transitioning from IPv4 to IPv6

Routing Protocol - IPv4.

IP, short for Internet Protocol, is responsible for routing packets across the internet. It has been in use since the inception of the internet and remains a fundamental component today. I won’t delve into the specifics of IPv4 as there are many excellent resources available online. Instead, I want to discuss its future and the challenges it may face. The primary issue with IPv4 is its address space limitations.

IPv4 uses a 32-bit integer to represent an address, allowing for about 4 billion unique addresses. However, we now have more than 4 billion devices needing internet connections globally. This limitation is the main, and arguably the only, significant problem with IPv4.

Address Space Problem - Not Easy to Fix

One might think that simply moving from 32 bits to 64 bits would solve the problem. However, it’s not that simple. The IPv4 protocol, like any other protocol, is very strict. It has a header containing fields for the source and destination IPs. This header is used by every router and edge device worldwide. If one device starts using 64-bit addresses while others do not, it can cause misinterpretation of the header, leading to various issues, including undelivered messages.

Changing from 32 bits to a larger size requires updating the protocol and all routers and devices worldwide to adopt the new addressing scheme. This is a massive undertaking, needing more than just technical skill—it requires the ability to enforce such a change globally, which is challenging.

Given the inevitable shortage of IPv4 addresses, IPv6 was introduced as a solution.

IPv6 in Brief

IPv6 uses 128 bits to represent an address, providing a staggering number of potential addresses (approximately 340 undecillion). This effectively eliminates the problem of address shortages for the foreseeable future. Alongside this, IPv6 includes various improvements to core protocols. However, every router and device that handles packets must support IPv6.

While transitioning to IPv6 might seem daunting, the reality is that most routers already support IPv6, as it has been around for over two decades. Despite this, IPv4 remains prevalent, largely due to technologies like NAT (Network Address Translation) postponing the need for a full transition to IPv6.

My Thoughts on IPv6

Personally, I am not fond of IPv6. To explain, let’s start with what I appreciate about IPv4. I value its simplicity and the fact that an IP address is akin to a phone number—easy to remember, type, and use in daily tasks. In contrast, IPv6 addresses are lengthy and written in hexadecimal, making them harder for humans to manage. The separator is a colon instead of a dot, and while it may seem trivial, typing a colon requires pressing the shift key, which is less convenient.

Typing an IPv6 address typically requires a full keyboard and is prone to errors. The complexity of 128-bit addresses, compared to 32-bit addresses, means those who work with IPs—such as DevOps, IT, and network professionals — face more cumbersome tasks. This added complexity is, in my opinion, a significant reason IPv6 has not yet replaced IPv4 universally.

The Real Problem with IPv6.

The engineers behind IPv6 aimed to resolve the address space issue permanently, moving from 32 to 128 bits and attempting to future-proof the protocol. However, this came at the cost of simplicity and ease of use for those who work with IP addresses regularly. They over-engineered the solution, addressing problems that do not yet exist.

This is similar to over-designing a class structure in programming, where an overly modular and encapsulated design can complicate things unnecessarily. IPv6’s attempt to solve the address space issue resulted in a complete overhaul, rather than a simple, incremental fix.

An Alternative Solution for IPv4

A more incremental approach could have been used to solve the address space problem. Introducing “Address Space Prefixes” (ASP) could extend IPv4’s address capacity. Initially, all existing addresses would have an ASP of 0. To double the address space from 4 billion to 8 billion, an ASP of 1 could be introduced, effectively adding a single digit to the current address format.

This approach would expand the address space without drastically altering the underlying protocol. The existing IPv4 header has reserved bits that could accommodate this extra small integer, making the change backward compatible and less disruptive. Security investigators, DevOps engineers, and other professionals who work with addresses could continue using familiar practices with minimal adjustments.

In conclusion, while IPv6 offers a long-term solution to the address space issue, a more incremental and less disruptive approach might have eased the transition and maintained the simplicity that many professionals value in IPv4.