IPv4 vs IPv6
In-Depth Technical Comparison & Architecture Guide
IPv4 and IPv6's real difference isn't just address space — IPv6's simplified header and native autoconfiguration reflect two decades of learning from IPv4's operational pain points, though one commonly-repeated claim about IPv6 (that it mandates IPsec) has actually been out of date since 2011 and is worth correcting directly.
Quick Reference Matrix
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address Length | 32 bits (~4.3 billion addresses) | 128 bits (~340 undecillion addresses) |
| Address Format | Dotted decimal (e.g. 192.0.2.1) | Hexadecimal groups (e.g. 2001:db8::1) |
| Header Checksum | Present | Removed — relies on link/transport-layer checksums |
| Native Autoconfiguration | No — requires DHCP or manual config | Yes — SLAAC (RFC 4862) |
| IPsec Support | Optional (SHOULD, per current guidance) | Optional (SHOULD, per RFC 6434 — not mandatory since 2011) |
| Address Exhaustion | Effectively exhausted for new allocations | Not a realistic concern at any practical scale |
Technology Overview
IPv4, in use since 1981, uses 32-bit addresses (roughly 4.3 billion possible addresses) written in dotted-decimal notation. That address space, while enormous by 1981 standards, has been effectively exhausted for new allocations for years — a scarcity managed in practice through NAT (Network Address Translation, letting many devices share one public IPv4 address) and CIDR-based allocation efficiency (see the Networking hub's IP tooling for that layer specifically).
IPv6, standardized to solve that exhaustion problem directly, uses 128-bit addresses — an address space so large (roughly 340 undecillion addresses) that exhaustion is not a realistic concern on any practical timescale. IPv6 addresses are written as eight groups of hexadecimal digits, commonly compressed with :: to represent a run of consecutive zero groups.
Beyond raw address count, IPv6's header was deliberately redesigned to be simpler and more efficient to process than IPv4's, and IPv6 added native features (like address autoconfiguration) IPv4 never had built in. One frequently-repeated claim, however, deserves direct correction: IPv6 does not mandate IPsec support the way many older articles and even some textbooks still state.
Correcting a Common Myth: IPsec Is Not Mandatory in IPv6
Early IPv6 specifications (RFC 2460, from 1998) did state that IPv6 implementations must support IPsec. This requirement was formally reversed years before most current 'IPv6 vs IPv4' comparisons were written: RFC 6434 (2011), the 'IPv6 Node Requirements' document, explicitly downgraded IPsec support from a mandatory 'MUST implement' to a recommended 'SHOULD implement' — meaning modern IPv6 implementations are not actually required to support IPsec at all, even though many do support it as an available option.
This matters because 'IPv6 has mandatory IPsec, unlike IPv4' is one of the most commonly repeated claims about IPv6 across the web, and it's been factually outdated for well over a decade. Neither protocol mandates IPsec today — both support it as an available option, with IPv4 requiring an additional header extension mechanism to carry it and IPv6 supporting it more natively in its extension header model, but 'mandatory' is the wrong word for either as of current standards.
Header Simplification and Native Autoconfiguration
IPv6's base header is fixed-length and simpler than IPv4's variable-length header — notably, it drops the header checksum field entirely, relying on the fact that link-layer and transport-layer (TCP/UDP) checksums already catch corrupted packets, making a redundant network-layer checksum unnecessary overhead recalculated at every hop.
IPv6 also natively supports Stateless Address Autoconfiguration (SLAAC, RFC 4862), letting a device generate its own valid IPv6 address on a network without a DHCP server, based on the network's advertised prefix and its own interface identifier. IPv4 has no equivalent native mechanism — address assignment there depends on DHCP or manual configuration, a genuine operational difference that simplifies IPv6 device onboarding in many network environments, particularly at IoT scale.
IPv4 Advantages & Disadvantages
Advantages / Pros
- Universal compatibility across virtually all existing hardware and software.
- Shorter, simpler address format to read and transcribe.
Disadvantages / Cons
- Address space effectively exhausted, requiring NAT for new allocations.
- No native address autoconfiguration equivalent to SLAAC.
IPv6 Advantages & Disadvantages
Advantages / Pros
- Vastly larger address space with no realistic exhaustion concern.
- Simplified, more efficient header processing at every hop.
- Native autoconfiguration (SLAAC) simplifies device onboarding.
Disadvantages / Cons
- Longer, less immediately readable address format.
- Still incomplete adoption on some legacy hardware and networks.
Real-World Use Cases
IPv4
Legacy and internal corporate networks
Existing infrastructure with no specific driver to migrate, still fully functional and supported.
IPv6
Large-scale IoT deployments
Assigning unique addresses to a very large number of devices, aided by native SLAAC autoconfiguration.
New public-facing infrastructure
Deployed alongside IPv4 (dual-stack) to support IPv6-capable clients as adoption continues.
Developer Recommendation
Deploy dual-stack (both IPv4 and IPv6) for new public-facing infrastructure wherever possible — see DNS A vs AAAA Records for how modern Happy Eyeballs client behavior makes this safe without a user-experience penalty.
Don't repeat or rely on the 'IPv6 mandates IPsec' claim when evaluating security posture — it's been factually outdated since RFC 6434 in 2011; verify actual IPsec support and configuration directly rather than assuming it from the protocol version alone.
Take advantage of SLAAC for IPv6 device onboarding in environments (like large IoT deployments) where DHCP's centralized address-assignment model is more operational overhead than necessary.
Frequently Asked Questions
- Does IPv6 require IPsec to be used?
- No — this is a commonly repeated but outdated claim. Early IPv6 specifications (RFC 2460, 1998) did mandate IPsec support, but RFC 6434 (2011) downgraded this to a recommendation ('SHOULD implement'), not a requirement. Neither IPv4 nor IPv6 mandates IPsec under current standards.
- Why does IPv6 not have a header checksum?
- IPv6's designers removed it deliberately, relying on the fact that link-layer and transport-layer (TCP/UDP) checksums already detect corrupted packets — recalculating a redundant checksum at every network-layer hop was considered unnecessary overhead.
- What is SLAAC?
- Stateless Address Autoconfiguration (RFC 4862) lets an IPv6 device generate its own valid address automatically from a network's advertised prefix and its own interface identifier, without needing a DHCP server — a native IPv6 capability IPv4 has no direct equivalent for.
- Are IPv6 packets faster than IPv4?
- IPv6's simplified, fixed-format header can be processed slightly more efficiently by routing hardware, but the practical difference is usually small on modern networks — the more significant IPv6 advantages are address space and native autoconfiguration, not raw per-packet speed.
- Is IPv4 going away?
- Not in the foreseeable future — dual-stack deployment (running both protocols together) remains the standard transition approach, and IPv4 support will likely persist for a very long time given the scale of existing infrastructure built on it.
- Why is IPv6 adoption still incomplete decades after its introduction?
- Migrating existing infrastructure, tooling, and operational practices built around IPv4 for decades carries real cost and complexity, and IPv4's NAT-based workarounds have kept it 'good enough' for many networks — adoption has been steady but gradual rather than driven by any hard forcing function.
Part of the Networking & Infrastructure Developer Hub
This comparison is part of our Networking & Infrastructure topic guide, covering related tools, standards, and decision guidance.
Related Comparisons
Other technology decisions in the same topic area as Networking & Infrastructure:
Launch Interactive Developer Tools
Put these concepts into practice. Test, format, serialize, or analyze your inputs locally with these secure, browser-only utilities:
IPv4 Subnet Calculator
Calculate subnet masks, host ranges, and broadcast addresses for IPv4.
IPv6 Subnet Calculator
Calculate IPv6 subnet CIDRs, host address ranges, first/last bits, and prefix binary layouts.
IPv6 Expansion Tool
Expand compressed IPv6 addresses into their full 32-character form.