Every time you see some network settings, there are IPv4 or IPv6 addresses. As you can guess, the previous versions are long in the past (TCP/IP v1, v2, and v3). But why is it IPv4 vs IPv6 instead of the 5th version vs the 6th? How is it that the IPv4 from the 80s is still around? What are the differences between IPv4 and IPv6? Let’s find out!
What is IP (Internet Protocol)?
IP is an abbreviation of the internet protocol. The IP is the way devices connect to the internet. It has a set of rules that define how the data travels from host to its destination. Basically, we need to define what we see (hostname), where it is (IP address), and how to get there (route).
To identify all the devices (hosts), there are IP addresses that are unique to them. They are assigned by the network administrators and could be static (fixed) IPs or dynamic (changing automatically after time) IPs.
An IP address is a simple string of numbers that are separated by periods. An example of an IP is 127.0.0.1, which is the localhost of most network systems.
First, the IP protocol was part of the TCP/IP. The first version that separated from it was the IPv4.
Types of IP addresses
When are talking about cosumers’ IP addresses, we can define two:
- Private IP addresses
The Private IP address is used inside the network. Imagine your home or office. You have a router that probably uses a dynamic method of IP allocation like DHCP. Your device will request an address, and it will receive one. This is a private IP address for the network that your router creates. Other devices (computers, IoT devices, phones) connected to the Internet thought this router would get their IPs the same way.
The router uses the addresses to identify the connected devices and manages those IPs to provide to other devices later.
- Public IP addresses
Now we are going broader. Your router will get another IP address from your Internet service provider (ISP). This is a public IP address from the IPS’s pool of IP addresses for outside of your network recognition.
This public IP address can be a dynamic IP address leased to you by a DHCP or another type of server for a limited amount of time, or it could be a static IP address that will be fixed for you. The static could allow you to offer services that require such an IP address, but usually, it requires an extra payment.
What is IPv4 address?
IPv4 address is the Internet Protocol version 4 address that serves to identify a device on a network and looks like this 126.96.36.199. It has 4 numbers that can be from 0 to 254, and are divided by dots.
The IPv4 started being used in 1982 on SATNET and one year later on ARPANET.
The IPv4 protocol allows interconnected networks and transmission of data from one place (source) to the destination. It passes datagrams from one internet module to the next until the destination is reached. If the data is too large to pass through a network, it can get fragmentation, chopped into pieces, and pass the limit of the network.
Problems with IPv4
- A scarce number of available IPv4. The total number of available IPs is 4 294 967 296 (232). It looks massive, but think about how many connected devices are there. Yes, they are already more, and the internet service providers need to reuse their available IPs. Some are running out of numbers already, and they are starting to provide IPv6 addresses.
- Does not support IPsec natively. Yes, it could be configured, but it is harder.
- Limited IPv4 header (60 bytes). You can’t add any additional parameters.
- The price of IPv4 is rising. Each year the price is rising. Currently is above 25 USD. Maybe finally, the price will be the number one driver to move to the superior IPv6.
When we are talking about DNS and IPv4 addresses, we need to resolve the hostname to its IP address, and we use A records for that purpose.
If you want to check your domain’s A record, we recommend you take a look at the first command from our article: 10 Most used Dig commands
Where is the IPv5 address?
Ok, there are almost no IPv4s left. Why aren’t we moving to IPv5? Why we skipped it? The reason is that IPv5 doesn’t exist. It never made it to become one of the IP protocols. It was planned as a streaming protocol, and it got to its second version, ST2. Its packets had the IP version 5 ID but eventually died as a draft. To evade confusion, the next protocol was named IPv6.
The big problem IPv5 had was that it used the same IPv4 addressing and had the same limited number of addresses.
Part of its development went to the next version, and that is how IPv5 history finished.
What is IPv6 address?
IPv6 is the latest version of IP. It has been around since 1995 and was introduced to replace the IPv4 back in 1998. Since 2017, the IETF (Internet Engineering Task Force) has ratified it as an Internet Standard.
In contrast to the IPv4, which uses 32-bit addresses, the newer version IPv6 uses 128bit addressing. To see the difference, we will start with one example of IPv6: “2001:0db8:0000:0042:0000:8a2e:0370:7334”. It has 8 groups, double the number of the previous. Each group has 4 hexadecimal (hex) digits, and the groups are separated by colons.
As you can see, there are many more combinations of available IP addresses. To be precise, 1028 times more available addresses!
Another benefit of the new protocol is the increased security. It has IPsec (Internet security protocol). It authenticates the sender (with Authentication Header) and encrypts the data (Encapsulating Security Payload).
Stateless address auto-configuration (SLAAC) is important too. The IPv6 auto-configures by listening to the Ruter Advertisement (RA), from the host. After that, it auto-assigns a 64-bit prefix. The other 64 bits of the address come from the host who self-determines its address.
The main problem of the protocol is the slow adoption from the ISPs (internet providers). They mostly prefer to use IPv4 because they don’t want to invest in new technology. Currently, the adoption rate is 30.62% (date 25.02.2021, Google IPv6 adoption statistic ), and the leaders are India with 57.25%, second is Belgium with 54.06%, Germany with 52.22%, Malaysia with 51.89%, Greece with 48.85%, and the US with 45.43%.
You can use IPv6 addresses on your managed DNS with AAAA records.
IPv4 vs IPv6
So we are finally getting to the true IPv4 vs IPv6 comparison. Here we are going to put the attention on the fundamental differences that the two protocols have. You will see how much did the new one improve over the IPv4.
|Address||32 bit long||128 bit long|
|Address types||Unicast, multicast, and broadcast||Unicast, multicast and anycast|
|Number of IPs||4 294 967 296||2128|
|Packet size (Maximum transmission unit)||576 bytes required, with fragmentation option||1280 bytes required, no fragmentation|
|Address configuration||Manual or DHCP||SLAAC using ICMPv6 or DHCPv6|
|DNS||A records||AAAA records|
|Transport layers||TCP, UDP, RAW||TCP, UDP, RAW|
IPv4 vs. IPv6: Speed comparison
Is the new IPv6 faster than the previous IPv4?
- IPv6 has one big advantage: it does not need Network Address Translation (NAT). It uses global addresses because simply there are enough addresses, and it does not need the NAT, while IPv4 will have to deal with NAT.
- The older protocol has header checksums for bit errors because back when it was introduced, the connectivity was far worse. The newer does not, and its header is fixed to 40 bytes.
Currently, IPv6 is mostly faster than IPv4, with small exceptions.
IPv4 vs. IPv6: Security comparison
- As we mentioned before, IPv6 already includes IPSec. IPSec can be used with IPv4. Just it takes extra steps.
- Address scanning is a lot harder for IPv6. We are talking about a massive number of IPv6 subnet addresses. It will take an incredibly long time for an attacker if it does not use some extra criteria for its scanning.
- IPv6 can support end-to-end encryption. This can reduce man-in-the-middle attacks.
- Another feature of the new protocol is called SEND (Secure Neighbor Discovery). It is a cryptographic check of a host to see if it is truly the one that it says it is.
Benefits of the IPv6 summarized
- Better routing without fragmentation of packets
- Extended address space (128it vs 32bit)
- SLAAC – Stateless address auto-configuration
- An improved structure of the header with less processing overhead
IPv4 vs IPv6, now you know the difference. IPv6 provides enough IPs for a long, long time. We probably won’t see any new version any time soon.
As we stand today, more than 25 years from the beginning of IPv6, it is already used by 30% of the world’s Internet users. It will be the preferred IP version in the future, and it is important to start adopting it today.