By now, you’ve probably heard the doom-and-gloom stories of the world running out of IPv4 addresses. While they are true – in 2019 we officially ran out of new IPv4 addresses and can only reappropriate the existing ones – there’s no reason to worry because IPv6 is here. If you’re wondering how these two protocol versions differ and if any of them is actually better, you’ve come to the right place – we explain all that and more in our article!
The primary reason for developing the Internet Protocol version 6 was to provide a sufficient number of IP addresses for future use. Despite offering over 4 billion IP addresses, the Internet Protocol version 4 developed in the early 1980s, quickly proved not to be enough when confronted with the growing popularity of the internet. The only way to increase the address space was to change its structure. This is why the IPv6 address is 128 bits long (compared to 32 bits in IPv4) and is divided into 8 hexadecimal numbers separated by a colon (as opposed to 4 groups of decimal numbers separated by a dot). To learn the exact ins and outs of how both of these addresses are built, you can read our other articles on the Internet Protocol: IPv4 and IPv6.
There is a price to pay for the increased address space that IPv6 provides us with. Unfortunately, the new protocol version was not developed to be backward-compatible with IPv4, so they cannot be used interchangeably. This forces the network owners (such as carriers, service providers, and enterprises) to either switch to the new version entirely or maintain a dual-stack IPv4 and IPv6 approach. Both of these options are expensive, resource-consuming, and don’t really bring any obvious added value to the end customers, which is why providers are hesitant to implement them.
However, the switch is not only inevitable, it does bring certain benefits. This is because IPv6 was not designed just to provide more addresses, but to make the IP communications more efficient. To that end, here are some of the most important changes made to IPv6 vs IPv4.
This one’s quite obvious, as the primary reason for developing IPv6 was to deal with the issue of an insufficient pool of IPv4 addresses. Thanks to its 128-bit structure, IPv6 provides so many available addresses that every last person on Earth could have a few… trillions of connected devices before we’d run out of IPs again1 . This means it’s good enough for the foreseeable future, even if that future holds even more IP-address-intensive technologies like the Internet of Things.
Despite all this, precautions still have been taken to ensure the efficient use of IPv6 addresses. The problem with IPv4 address availability has been aggravated by “address hoarding” by some companies that were allocated “stockpiles” of addresses that they never actually needed or fully used, but refused to return either. To avoid a similar situation in the future, proper IPv6 address allocation and assignment policies have been put in place.
Therefore, contrary to IPv4 addresses whose geographical distribution is strongly biased towards the United States, the coverage of IPv6 addresses has no limitations.
This is a direct result of the increased address space in IPv6 vs IPv4. As all the devices can now have their individual global address, there is no need for complicated routing procedures such as network address translation (NAT). Moreover, IP addresses are no longer divided into classes, which implies no need to reserve several fragments of the address space for the purpose of private addressing.
While NAT is a necessary and popular way of conserving IPv4 addresses, it can also be a significant roadblock to application development when end-to-end communications are concerned, as they often require creative, yet not really efficient workarounds for NAT traversals. Removing that roadblock potentially leads to faster development times, more efficient applications, and conserved resources.
One of the major differences between IPv4 and IPv6 is that the latter allows the so-called stateless address autoconfiguration (SLAAC). With IPv4, you need a DHCP server to assign an IP address to a device. With IPv6, the device can obtain the network identifier (the first 64 bits) from the router and generate its own host identifier (the last 64 bits) to create a full IPv6 address. To do the former, the device sends a “router solicitation” (RS) asking for the network address and receives it from the “router advertisement” (RA), which the router also advertises through a periodic unicast.
Does that mean you don’t need a DHCP server anymore? Not really. First of all, if you have a dual-stack IPv4 and IPv6 network, you still need a DHCP server for IPv4 management. But even if you didn’t, you need the server to provide your devices with all the other DHCP options. You might also find that you need to perform a “stateful” configuration (which very much resembles the configuration process in IPv4) if you want more controlled IP address management.
The instantly growing popularity of mobile devices, including smartphones utilizing data and voice transfer over IP, as well as the limitations of IPv4, have forced the implementation of a special IP protocol for mobile devices called Mobile IP (MIP) which uses triangular routing. Due to the limited pool of IPv4 addresses, it was impossible to allow mobile devices to keep their IP address (“home address”) when moving between networks (“roaming”), which in turn prevented them from being traceable across locations. A workaround to that has been to assign the device a new IP address (“care-of address”) when it moves to a new network (“foreign network”) but route all traffic directed to that device through its network of origin (“home network”) which has been updated with the new address. While a clever solution, you can imagine that it is also very inefficient and creates a lot of unnecessary traffic.
As opposed to mobile IPv4, the process in mobile IPv6 has been optimized so that triangular routing is no longer required and direct routing is used instead. In this scenario, when the device is roaming, the home network is only used to advertise the device’s new IP address, so that it can be contacted directly, and the home network doesn’t have to handle all the traffic.
Another important difference between IPv4 and IPv6 is the use of multicasting. This is a method of sending a single message to multiple recipients who have expressed interest in receiving it. While sending a multicast message is possible in IPv4, it is an optional feature, and so broadcasting is used much more commonly. This creates unnecessary overhead, as a broadcast message is sent to everyone in the network indiscriminately, forcing devices to deal with it whether it’s relevant to them or not. This is why, for the sake of efficiency, there are no broadcast messages in IPv6 at all and multicasting is a base specification, not an optional feature. As an example consider the IP to MAC resolution procedure which operates on Neighbor Discovery Protocol messages sent to dedicated IPv6 multicast addresses, contrary to version 4 of the protocol employing the broadcast-based Address Resolution Protocol (ARP).
Diving deeper into technical details, significant changes are made to IPv6 packets to improve the reliability and efficiency of data transmission. Compared to the IPv4 datagram, whose header length may vary from 20 to 60 bits, the IPv6 packet header size is fixed and equal to 40 bits. Although larger headers imply greater overhead at first glance, their consistent format, as well as lack of the checksum field to be calculated and verified in transit impose less hardware processing and hence facilitate routing. Moreover, IPv6 packet integrity is preserved since it is allowed to be fragmented only by the sender, not by forwarding routers. Last but not least, built-in support for flow identification helps to ensure the expected quality of service, which is particularly important for high-quality media transmission.
Internet Protocol version 6 was originally designed to be compatible with the IP Security (IPsec) suite, whose full implementation was initially intended to be mandatory but turned out to be impractical for selected types of devices that may use IPv6. Now IPsec inclusion is recommended for IPv6, while the specification was also re-engineered and widely adapted to IPv4 needs. On the other hand, one point is that the lack of private address space and elimination of NAT increases the exposure of IPv6 hosts, which should be reduced by employing firewalls in the network topology in place of NATing devices.
It has to be said that in fact, IPv6 has certain advantages over IPv4. This is only natural, considering that it was developed not only to ensure an appropriate number of IP addresses but also to improve upon the previous version and build on the experience that was gathered in the meantime. While the benefits may not be apparent to end users, they are certainly clear to network administrators and developers dealing with the Internet Protocol. All that’s left now is getting over the hurdle of managing a dual-stack network in the meantime.
Author: Bartłomiej Grochal
Programming since 2010, he started his AVSystem journey in 2018 as a Software Engineer of two greenfield products: BSAP and DHCP. His background in scientific research, experience in knowledge sharing, and openness proved him to be a great team player with an eye for detail and led to a transition towards a business-oriented role of the Product Owner of previously developed components. In his free time enjoys watching football, playing basketball hiking, and cooking.
Subscribe to stay in the loop with all our latest content: