There are currently two versions of the Internet Protocol (IP): IPv4 and IPv6. Both types enable online networking and data exchange, but the two versions identify devices differently and offer distinct features. So, which one is better, faster, and more secure?

This article offers a head-to-head comparison of IPv4 and IPv6, the two currently available IPs for routing traffic across the Internet. Read on to learn the main differences between the two protocols and see why switching to IPv6 is vital to the long-term health of the Internet.

Comparison of IPv4 and IPv6

What Is IP?

The Internet Protocol (IP) is a set of networking rules that enable computers to communicate over the Internet. IP has two primary purposes:

  • Enable different computers to exchange data over the Internet while ensuring sent files arrive at the correct destination.
  • Identify every device and domain that connects to the Internet by assigning a unique IP address (a series of digits that identify a specific computer or device).

When you send something online, the IP breaks data into smaller chunks called packets. Each packet has attached IP info that ensures whatever you send reaches the right recipient. This process occurs automatically and looks like this:

  • The sender's computer connects to the Internet via a local router, either at home or within an office server room.
  • The router (which has a static IP address that never changes) assigns a temporary (a.k.a. dynamic) IP address to the device to enable communication.
  • IP converts files into datagrams with a header (info consisting of IP source/destination and metadata) and the payload (the data itself).
  • The protocol nests data into packets.
  • IP breaks down data packets (fragmentation) and sends them over the Internet to the specified IP address.
  • Once data reaches its destination, IP rebuilds the file (reassembly) to allow access.

The Internet Protocol does not assign IP addresses at random. A non-profit organization called Internet Corporation for Assigned Names and Numbers (ICANN) allocates IP addresses to Internet Service Providers (ISPs) who assign addresses to end-user devices.

Most networks combine IP with TCP (Transmission Control Protocol) or UDP (User Datagram Protocol) to form a connection between devices. All three are a part of the broader Internet Protocol Suite (TCP/IP) that governs rules for routing and receiving data over a network.

Learn the difference between public and private IP addresses, the two main types of "online IDs" computers use to communicate over the Internet.

What Is IPv4?

IPv4 is the first major version of the Internet Protocol that's been the go-to communication model for the Internet since the 1980s. This protocol "carried" 94% of all online traffic in 2021.

IPv4 assigns 32-bit IP addresses to devices. Each address has four groups of numbers (8-bit sections called octets) separated by a period, such as:

192.158.1.38

The value of each octet ranges from  0 to 255, so the IPv4 model includes every address between 0.0.0.0 and 255.255.255.255. All IPv4 addresses have two parts:

  • The network ID (the first three octets) that indicates which network the device is on.
  • The host ID (the fourth octet) that identifies the specific device on that network.

For example, if your home network has a 192.168.1.1 address, 192.168.1 is the network ID, while the final octet (1) is the host ID. In most networks, the router gets the .1 value by default.

IPv4 enables the creation and use of 4,294,967,296 unique addresses (more commonly expressed as 2^32). In the 1980s and 1990s, over 4 billion available addresses seemed sufficient to meet the demand of the online world. However, it quickly became clear that a shortage was coming.

Nowadays, there are over 7.75 billion people worldwide, and most of us use two or more smart devices. Just over four billion IP addresses are no longer enough, so IT experts must "trick" devices into reusing the same addresses.

The most common technique for reusing IPv4 addresses is Network Address Translation (NAT). NAT enables you to represent a group of devices with a single IP address, which conserves bandwidth and slows down the depletion of IP addresses.

We view IP addresses in human-readable notations, such as 66.94.29.13. However, computers only understand binary format, so the address we see as 66.94.29.13 stands for 01000010.01011110.00011101.00001101 in the "computer language."

IPv4 addresses explained

IPv4 Features

Here are the main features of IPv4:

  • Creates 32-bit IP addresses.
  • Addresses use four 1-byte decimal numbers separated by a dot, a format that a human can easily read and even remember.
  • Connectionless protocol.
  • Requires small amounts of memory to store address info in the network.
  • Supported by nearly all devices and websites on the Internet.
  • Offers video libraries and conferences.
  • Enables the creation of a simple virtual communication layer over diversified devices.

Learn how to check your IP address in Linux the easy way (both for IPv4 and IPv6).

What Is IPv6?

IPv6 is the latest Internet Protocol version and the successor to IPv4. IPv6 aims to fulfill the need for more IP addresses, the main issue of the previous IP. Another common name for IPv6 is IPng (Internet Protocol next generation).

Unlike its predecessor, IPv6 uses 128-bit hexadecimal IP addresses. This model enables 2^128 unique addresses (over 340 undecillion, which is 340 with 36 zeros).

IPv6 addresses are significantly longer than IPv4 variants (eight 16-bit blocks with groups of four symbols, often called hextets or quartets) and are alphanumeric. Also, whereas IPv4 relies on periods for formatting, IPv6 uses colons, such as in this example:

2001:0db8:0000:0001:0000:ff00:0032:7879

The model omits leading zeros (like in IPv4), and you'll sometimes find IP addresses that have a double colon (::) that designate any number of 0 bits (such as 1201:2db7::fa00:0040:6669, in which the third, fourth, and fifth hextets are 0000).

While IPv6 is more sustainable than IPv4, the majority of the Internet still uses IPv4. Upgrading all the routers, servers, and switches that have used IPv4 for decades takes a lot of time and money. Compatibility is also a concern, which is why we're seeing a rise in IPv4-to-IPv6 conversion techniques like:

  • Dual stacking that enables a device to run both protocol types at the same time.
  • IPv6 tunnels that allow private networks to communicate with each other even if they use different IP versions.

While functional, IP conversions create flaws that can lead to network security risks, cyber attacks, and data breaches. Ideally, a network should rely solely on IPv6, which is bound to become the norm in the coming years.

IPv6 addresses explained

IPv6 Features

Here are the main features of IPv6:

  • A 128-bit hexadecimal address scheme.
  • Both stateful and stateless configurations.
  • Auto-configuration capabilities.
  • Support for Quality of Service (QoS), a.k.a. flow labeling.
  • Better multicast routing and simpler header format than IPv4.
  • End-to-end connectivity at the IP layer, so there's no need for NAT, one of the most popular workarounds for conserving IPv4 addresses.
  • Integrated Internet Protocol Security (IPSec) with built-in authentication, encryption, and privacy support.

The world did not skip over IPv5. The draft for IPv5 came out in 1990 when IT experts wanted to use it for streaming services (such as voice and video). However, the model never took off due to technical issues, and it eventually fell behind when IPv6 came out in 1995.

IPv4 vs IPv6: Table Comparison

The table below offers an in-depth IPv4 vs IPv6 comparison: 

Point of comparison IPv4 IPv6
Size of IP address 32-bit (4 bytes) 128-bit (16 bytes)
Number of available IP addresses 4.3 billion (must reuse and mask addresses) 340 undecillion (every device can have a unique address)
IP address notation Decimal address, 4 fields (octets) separated by dots (.) Alphanumeric address, 8 fields (hextets or quartets) separated by colons (:)
Main selling point Widely supported and easy to use Virtually unlimited number of IP addresses
IP address lifetime Not an applicable concept Two lifetimes: preferred and valid (preferred lifetime is always smaller or equal to valid)
Address prefix Sometimes used to designate network from host portion (written as /nn suffix on the presentation form of address) Used to designate the subnet prefix of an address (written as /nnn)
Configuration DHCP or manual configuration Stateless address auto-configuration (via Internet Control Message Protocol version 6 (ICMPv6) or DHCPv6)
Number of header fields 12 (length of 20-60 bytes) 8 (fixed length of 40 bytes)
Checksum in header Yes No
Types of addresses Unicast, broadcast, and multicast Unicast, multicast, and anycast
Number of classes Class A to E No classes
Address masking Used Not used
VLSM (Variable Length Subnet Mask) support Yes No
How to ping ping [insert IP address] ping6 [insert IP address]
Starting and stopping Use the STRTCP or ENDTCP command to start or end IPv4 Specify YES on the STRIP6 parameter of the STRTCP command to start (the ENDTCP command ends IPv6)
Packet size The minimum packet size is 576 bytes The minimum packet size is 1208 bytes
Packet fragmentation Performed by routers and sending nodes Performed by the sending node only
Routing Information Protocol (RIP) Supported by the routed daemon RIP does not support IPv6 (uses static routes for network functions)
Simple Network Management Protocol (SNMP) Yes No
IPSec (Internet Protocol Security) Optional Integrated and mandatory
Built-in end-to-end encryption No Yes
Quality of Service (QoS) The packet header does not identify packet flow for QoS handling The packet header contains Flow Label field that specifies packet flow for QoS handling
DNS records Pointer (PTR) records, IN-ADDR.ARPA DNS domain Pointer (PTR) records, IP6.ARPA DNS domain
IP to MAC resolution Broadcast ARP Multicast neighbor solicitation
Local subnet group management Internet Group Management Protocol (IGMP) Multicast Listener Discovery (MLD)
Optional fields Yes No (but there are Extension Headers)
Header includes options Required Moved to IPv6 extension headers
Mobility protocol Uses Mobile IPv4 (MIPv4)   Uses Mobile IPv6 (faster handover, routing, and hierarchical mobility)
Address allocation           Initially allocated by network class, now relies on smaller allocations of Classless Inter-Domain Routing (CIDR) Allocation is still in early stages, but the address space is large enough to give everyone a /48 subnet prefix length
Why is IPv6 transition taking so long?

Why Is IPv6 Better Than IPv4?

IPv6 is the most recent version of the IP, and it's more advanced, secure, and faster than IPv4. Here are the main advantages IPv6 has over its predecessor:

  • Enough IP addresses for the foreseeable future.
  • Simplified router tasks (mainly due to the encoding of IPv6 addresses that uses a hierarchy similar to CIDR).
  • Auto-configuration that automates tasks such as IP address assignment and device numbering.
  • Better compatibility with mobile networks.
  • Reduced size of routing tables, which leads to more efficient routing.
  • Up to 15% boost to speed, primarily due to bigger payloads and allowing every device to have a public IP address (instead of hiding behind a NAT router).
  • Built-in IPSec, end-to-end encryption, identity verification, and data integrity features.

Despite these benefits, less than 1% of current networks use IPv6. All others use IPv4, which has been the go-to IP since the birth of the Internet. Legacy systems are challenging (and expensive) to root out, especially the ones we have relied on for decades.

There are further problems on top of transition-related issues. Some VPNs do not support the latest IP, while many operating systems and network infrastructures struggle with IPv6 routing. Also, larger packet headers could potentially slow down certain use cases that would work more optimally with IPv4.

The main reason IPv6 beats the previous version is the significantly larger pool of available IP addresses. The difference in speed is neglectable for most use cases, while tech-savvy admins know how to add most IPv6-native features to IPv4. What no one can create are new IPv4 addresses (which the US ran out of in 2015), which is the main reason IPv6 is bound to take over eventually.

In theory, we can also run out of IPv6 addresses. However, if we keep the current pace of Internet expansion, exhausting IPv6 will become a concern somewhere around 9,000,000 AD.

IPv4 vs IPv6: The Two IP Versions Will Not Co-Exist Forever

IPv4 will stick around for a long time due to the cost and compatibility issues of switching to IPv6. However, the shift to IPv6 is vital to the long-term health of the Internet, so it's only a matter of time before IPv6 becomes the norm. The gradual transition might take years, but a permanent switch to IPv6 should already be on your business planning and IT radar.