Lesson Contents
IPv4 and IPv6 are the two versions of the Internet Protocol used to address and route traffic across networks. IPv4 uses 32-bit addresses in dotted-decimal notation, while IPv6 uses 128-bit addresses in hexadecimal notation. That gives IPv6 a much larger address space, which is exactly what’s needed to address the shortage of IPv4 addresses.
In this lesson, we’ll compare IPv4 and IPv6. Most students are familiar with IPv4, and comparing the two, where you see the differences and what is new in IPv6, can help you understand IPv6 better.
Key Takeaways
- IPv4 uses 32-bit addresses in dotted-decimal notation (for example: 192.168.1.1), giving roughly 4.3 billion addresses. IPv6 uses 128-bit addresses in hexadecimal, colon-separated notation with zero compression, giving it a vastly larger address space and solving IPv4 exhaustion.
- The IPv4 header is variable length (minimum 20 bytes) with a hop-by-hop checksum and built-in fragmentation fields. The IPv6 header is a fixed 40-byte simplified structure that drops the checksum and moves optional features into extension headers.
- IPv6 adds a Flow Label field for flow identification that IPv4 doesn’t have.
- IPv4 supports unicast, multicast, and broadcast. IPv6 eliminates broadcast entirely and relies on multicast, a new anycast address type, and mandatory link-local addresses on every interface.
- Address configuration in IPv4 depends mainly on manual setup or DHCP. IPv6 adds Stateless Address Autoconfiguration (SLAAC) via Router Advertisements and Stateful DHCPv6, which reduces administrative overhead.
- IPv4 allows fragmentation by both hosts and routers, but IPv6 restricts fragmentation to the source host only. That makes Path MTU Discovery important and moves the fragmentation fields into an extension header.
- IPv4 resolves link-layer addresses using ARP with broadcast messages. IPv6 uses Neighbor Discovery Protocol (NDP) over ICMPv6 with multicast, and NDP also handles router discovery and duplicate address detection.
- IPsec was mandatory for every IPv6 node under the original IPv6 specification (RFC 2460), but RFC 6434 downgraded that requirement to a recommendation in 2011. IPv6’s IPsec support is optional today, just like IPv4’s.
Prerequisites
You should already be comfortable with basic IP addressing concepts, including binary-to-decimal and hexadecimal conversion and subnetting. You should also be familiar with protocols such as ARP, DHCP, and ICMP.
Components
Let’s break IPv4 and IPv6 down into the areas where they differ most:
- Address format
- Header structure
- Address types
- Configuration
- Fragmentation
- Address resolution
- Security
Let’s have a look.
Address Format and Space
IPv4 and IPv6 are different in how they represent addresses and how much address space each protocol provides.
- IPv4 uses 32-bit addresses:
- Written in dotted-decimal notation (for example: 192.168.1.1)
- Provides roughly 4.3 billion addresses.
- IPv6 uses 128-bit addresses:
- Written in hexadecimal, colon-separated notation
- Supports zero compression and leading-zero suppression for shorter notation.
- Provides a much larger address space than IPv4.
- Privacy extensions (RFC 4941) generate temporary, rotating global addresses alongside a stable one, so it’s normal to see two or more global IPv6 addresses on a single interface.
Here’s an overview which might be easier to read:
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address length | 32-bit |
128-bit |
| Notation | Dotted-decimal (192.168.1.1) |
Hexadecimal, colon-separated (2001:db8::1) |
| Address space | ~4.3 billion addresses | Much larger address space |
| Shortening rules | Not possible | Zero compression and leading-zero suppression |
| Privacy addressing | Not possible | Temporary, rotating global addresses (RFC 4941) |
Header Structure
The two protocols also have different packet header structures. Both in which fields are included and how those fields are organized.
- IPv4 header:
- Variable length due to optional fields, minimum 20 bytes.
- Includes a header checksum, which each router recalculates at every hop.
- Includes fragmentation fields (Identification, Flags, Fragment Offset).
- IPv6 header:
- Fixed 40-byte base header, simplified compared to IPv4.
- No header checksum field; it relies on the upper layers and link layer instead.
- Uses extension headers for optional features instead of built-in fields.
- Includes a Flow Label field for flow identification, which IPv4 doesn’t have.
Here’s an overview:
| Feature | IPv4 Header | IPv6 Header |
|---|---|---|
| Length | Variable, minimum 20 bytes | Fixed 40 bytes |
| Checksum | Header checksum, recalculated at every hop | No header checksum field |
| Fragmentation fields | Identification, Flags, Fragment Offset in base header |
Moved to an extension header |
| Optional features | Options field | Extension headers |
| Flow identification | Not present | Flow Label field |
Address Types and Communication Models
Another difference is the address types and how packets are delivered across a network.
- IPv4 supports unicast, multicast, and broadcast:
- Broadcast is used for tasks like address resolution and service discovery.
- IPv6 removes broadcast entirely:
- Uses multicast for functions broadcast used to handle.
- Introduces anycast as a formal address type
- IPv6 defines additional scoped address types:
- Link-local addresses required on every interface.
- Unique Local Addresses (ULA) for private, non-internet-routable addressing
- Global unicast addresses for internet routing
| Address Type | IPv4 | IPv6 |
|---|---|---|
| Unicast | Supported | Supported |
| Multicast | Supported | Supported, also replaces broadcast functions |
| Broadcast | Supported | Not supported |
| Anycast | Not supported | Supported |
| Link-local | Optional (APIPA, 169.254.0.0/16) | Required on every interface |
Link-local addresses are self-assigned, similar to IPv4’s APIPA (169.254.0.0/16), not to RFC 1918 private addressing. But unlike APIPA, a link-local address isn’t a fallback that a device replaces once a “real” address shows up. Every IPv6 interface keeps its link-local address for as long as it’s up, and it stays in permanent use for local control-plane traffic such as routing adjacencies, next-hop addressing, and FHRP.
Address Configuration Methods
Address configuration methods available to hosts also change between IPv4 and IPv6.
- IPv4 relies mainly on manual configuration or DHCP.
- IPv6 supports multiple configuration options:
- Stateless Address Autoconfiguration (SLAAC) using Router Advertisements
- Stateful DHCPv6 for managed address assignment
- Manual configuration still supported.
- IPv6 autoconfiguration cuts down on administrative overhead compared to IPv4.
| Method | IPv4 | IPv6 |
|---|---|---|
| Manual configuration | Supported | Supported |
| DHCP | Supported (DHCP) | Supported (DHCPv6, stateful or stateless) |
| SLAAC | Not available | Supported via Router Advertisements |
In practice, SLAAC and DHCPv6 are often combined rather than treated as either/or. SLAAC assigns the address itself, while DHCPv6 runs in stateless mode just to hand out DNS servers and other options. Support for full stateful DHCPv6, where the server assigns the address, is inconsistent across platforms. Android, for example, doesn’t implement it at all and depends on SLAAC.
Fragmentation and MTU Handling
Packet handling for packets that exceed the link MTU is another area where IPv4 and IPv6 differ.
- IPv4 allows fragmentation by both sending hosts and intermediate routers.
- IPv6 restricts fragmentation to the source host only:
- Routers don’t fragment IPv6 packets in transit.
- Path MTU Discovery becomes essential for IPv6 to avoid oversized packets.
- IPv6 moves fragmentation fields out of the base header into an extension header.
| Aspect | IPv4 | IPv6 |
|---|---|---|
| Who can fragment | Hosts and routers | Source host only |
| Router fragmentation in transit | Allowed | Not allowed |
| Path MTU Discovery | Optional | Essential |
| Fragmentation fields location | Base header | Extension header |
Address Resolution
We need to map a network layer address like IPv4 or IPv6 to a link-layer address. IPv4 and IPv6 do this differently.
- IPv4 uses Address Resolution Protocol (ARP):
- Relies on broadcast messages to resolve MAC addresses.
- IPv6 uses Neighbor Discovery Protocol (NDP):
- Uses ICMPv6 messages instead of a separate protocol.
- Relies on multicast rather than broadcast.
- Also handles router discovery and duplicate address detection.
| Aspect | ARP (IPv4) | NDP (IPv6) |
|---|---|---|
| Protocol | Address Resolution Protocol | Neighbor Discovery Protocol over ICMPv6 |
| Message delivery | Broadcast | Multicast |
| Additional functions | Address resolution only | Router discovery, duplicate address detection |
Security Integration
Finally, IPv4 and IPv6 take different approaches to security, though that difference is smaller today than it once was.
- IPv4 security (such as IPsec) is optional and added separately.
- IPv6 originally made IPsec support mandatory for every node, under the original specification in RFC 2460.
- RFC 6434, published in 2011, downgraded that requirement from mandatory to a recommendation (“SHOULD”). As a result, IPv6’s IPsec support is effectively optional today, as in IPv4.
- NAT was never itself a security mechanism. The protection came from stateful firewall behavior that blocks unsolicited inbound connections, and that same stateful filtering applies in IPv6 without needing NAT to hide addresses.
IPv4 and IPv6 Compatibility
IPv4 and IPv6 are not compatible at the protocol level. IPv6 isn’t just IPv4 with longer addresses. It’s a separate stack with its own header format, its own address resolution (NDP instead of ARP), and its own configuration methods. You can’t just pad an IPv4 address with zeros and get a valid IPv6 address, and a host needs an IPv6 stack to speak IPv6 at all.
Because of that, most networks run dual stack today: a device runs IPv4 and IPv6 side by side, and uses whichever protocol the destination supports. Where dual stack isn’t possible, transition mechanisms like NAT64 translate between IPv6-only and IPv4-only hosts so the two can still reach each other.