Table of Contents
Overview
IPv4 and IPv6 are two versions of the Internet Protocol that define how devices are addressed and how packets are delivered across networks. IPv4 is the older, extremely widespread protocol. IPv6 is the newer protocol, created to solve address exhaustion and to improve and simplify some aspects of networking. They coexist on the Internet today.
This chapter focuses on comparing the two versions, not on explaining IPv6 basics again in full detail. You will see where they are similar, where they differ, and what that means in practice for network design and operation.
Address Space and Address Format
IPv4 uses 32 bit addresses. This gives a maximum of $2^{32}$ unique addresses, which is 4,294,967,296 possible addresses in theory. In practice, many blocks are reserved and cannot be used on the public Internet.
IPv6 uses 128 bit addresses. This gives a maximum of $2^{128}$ unique addresses, which is an astronomically large number. It is far more than enough addresses for every device that will ever exist.
IPv4 addresses are usually written in dotted decimal form, for example 192.168.10.5. Each of the four decimal numbers (called octets) represents 8 bits.
IPv6 addresses are written in hexadecimal, separated by colons, for example 2001:0db8:0000:0000:0000:ff00:0042:8329. There are rules to shorten IPv6 addresses, and you typically see compressed forms like 2001:db8::ff00:42:8329.
The huge difference in address space is the most famous distinction between IPv4 and IPv6. IPv6 was designed to eliminate the global shortage of public IP addresses that occurred with IPv4.
Key fact: IPv4 uses 32 bit addresses (about $4.3 \times 10^9$ total).
IPv6 uses 128 bit addresses (about $3.4 \times 10^{38}$ total).
Address Types and Concepts
Both IPv4 and IPv6 have unicast, multicast, and special addresses, but the details and usage differ.
IPv4 mainly uses unicast addresses for most communication. It has a limited range of multicast addresses and also uses broadcast addresses like 255.255.255.255 or the all hosts address inside a subnet.
IPv6 also uses unicast addresses for most traffic, but makes more extensive use of multicast as an integral part of the protocol. IPv6 does not use broadcast at all. Instead of broadcast, IPv6 uses special multicast groups to reach many hosts at once, such as all nodes on a link.
IPv4 defines common special ranges like private addresses (for example 10.0.0.0/8) and loopback (127.0.0.1). IPv6 defines its own special ranges, for example link local addresses and unique local addresses. Unlike IPv4, every IPv6 interface is required to have a link local address that only works on the local network segment.
In practice this leads to a different design style. IPv4 networks rely on private addressing plus Network Address Translation to deal with address scarcity. IPv6 networks can assign globally routable addresses directly to hosts without depending on NAT for scale.
Header Structure and Complexity
Both IPv4 and IPv6 put a header in front of user data, but the headers are different.
The IPv4 header is variable in length. It can carry optional fields, for example to support rarely used features such as security labels or routing options. Because the header length can vary, routers need to read a field that tells them where the header ends. The IPv4 header also contains a header checksum that every router must verify and recalculate at each hop.
The IPv6 basic header has a fixed length of 40 bytes. Optional information is not put into a variable header field. Instead IPv6 uses separate extension headers that may follow the main header in a chain. The IPv6 base header does not have a header checksum. This reduces the processing work that every router has to do.
The result is that IPv6 header processing is usually simpler and more consistent for routers. The separation into a fixed main header and optional extension headers was intended to make high speed forwarding easier to implement.
Fragmentation and MTU Handling
IPv4 allows routers in the path to fragment packets when a packet is larger than the Maximum Transmission Unit of an outgoing interface. The IPv4 header carries fragmentation flags and an offset field that help the receiver reassemble fragments. This behavior means that routers can split packets but also introduces extra load and complexity along the path.
IPv6 handles fragmentation differently. Routers do not fragment IPv6 packets. Instead, the sending host must discover the path MTU and send packets that fit. If a packet is too large, an intermediate router sends an ICMPv6 error back to the sender. Actual fragmentation, if needed, is managed by the source host using a dedicated fragmentation extension header.
This change places the responsibility for fragmentation on endpoints, not on routers. It improves performance inside the network core and lets routers focus on fast forwarding.
Address Configuration and Neighbor Discovery
In IPv4 networks, host address configuration is usually done with manual settings or with DHCP. For finding other devices on the local link, IPv4 uses ARP, which maps IPv4 addresses to MAC addresses using broadcast frames.
IPv6 supports several methods to configure addresses. Besides manual configuration and DHCPv6, IPv6 allows Stateless Address Autoconfiguration. With this method, hosts can create their own addresses based on information broadcast by routers. For local link neighbor information, IPv6 does not use ARP. Instead, it uses the Neighbor Discovery Protocol, which runs on top of ICMPv6 and uses multicast messages to discover neighbors.
The effect is that IPv6 can let hosts configure themselves more automatically, and IPv6 removes reliance on broadcast based address resolution.
NAT, End to End Connectivity, and Security Perception
IPv4 address scarcity led to a very common use of Network Address Translation. With IPv4, a whole private network can share one public address. This became standard in home and enterprise networks. It also changed the original end to end nature of the Internet, because the addresses used by internal devices are usually not visible on the public side.
IPv6, in contrast, has so many addresses that widespread NAT is not required to save address space. The original IPv6 design assumed that each device can have one or more globally routable addresses. This can restore end to end connectivity, where any host can potentially reach any other host directly across the Internet, subject to firewalls and security policies.
With IPv4, many people have become used to thinking of NAT as a security measure, because internal addresses are hidden. IPv6 still relies primarily on proper firewalling and filtering for protection, not on address hiding. Simple address translation does not replace the need for access control. Firewalls remain important in both IPv4 and IPv6 networks.
Coexistence and Transition
IPv4 and IPv6 are separate protocols. An IPv4 packet cannot travel over an IPv6 only segment, and an IPv6 packet cannot travel over an IPv4 only segment. The world has a very large installed base of IPv4, so full replacement is not realistic in the short term.
In practice, networks use several transition and coexistence strategies. The most basic strategy is dual stack, where devices and networks run both protocols at the same time, and use whichever is appropriate for a given communication. There are also various tunneling and translation techniques that carry one protocol inside the other or convert between them at network borders.
At the application and user level, the goal is that communication succeeds regardless of the underlying IP version. Many systems will prefer IPv6 if it is available and fall back to IPv4 otherwise. This gradual transition lets IPv6 deployment grow without requiring a sudden cutover.
Performance and Feature Differences
From a pure forwarding perspective, IPv6 was designed to be more efficient. The removal of the header checksum and the fixed header size simplify router design. The extensive use of multicast instead of broadcast can reduce unnecessary traffic on local networks. The larger address space also simplifies some routing designs, because address plans can be more hierarchical.
In day to day use, basic performance depends more on network design and implementation quality than on IP version. Some IPv6 deployments offer better connectivity simply because they are newer and more carefully planned, while some legacy IPv4 networks may be more optimized. The protocol itself does not guarantee faster speeds, but it enables cleaner designs.
IPv6 also integrates features that were optional or external in IPv4. For example, support for IPsec was originally defined as mandatory in IPv6 specifications. In IPv4, IPsec is possible but not tied into the protocol definition in the same way. In practice, both IPv4 and IPv6 can use IPsec when implemented, but IPv6 was built with secure communication in mind from the start.
Summary of Key Differences
The following table summarizes some of the most important contrasts between IPv4 and IPv6.
| Aspect | IPv4 | IPv6 |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Address notation | Dotted decimal (e.g. 192.0.2.1) | Hex with colons (e.g. 2001:db8::1) |
| Total address space | About $4.3 \times 10^9$ | About $3.4 \times 10^{38}$ |
| Header size | Variable (20 to 60 bytes) | Fixed 40 bytes basic header |
| Header checksum | Present, recalculated at each hop | Not present |
| Broadcast | Used (e.g. 255.255.255.255) | Not used, replaced by multicast |
| Address configuration | Manual, DHCP | Manual, DHCPv6, Stateless Autoconfiguration |
| Address resolution | ARP with broadcast | Neighbor Discovery with multicast |
| Fragmentation | Routers and hosts can fragment | Only source host fragments, routers do not |
| NAT usage | Common, for address conservation | Not required for scale, typically avoided |
| Coexistence | Widely deployed | Coexists with IPv4 through dual stack and other methods |
Understanding these differences helps you see why IPv6 was created, how it changes network behavior, and what to consider when designing or operating networks that use one or both versions.