Download this article in .PDF format
If you are using Internet or almost any computer network you will likely using IPv4 packets. IPv4 uses 32-bit source and destination address fields. We are actually running out of addresses but have not fear, the Internet Engineering Task Force (IETF) is here with IPv6.
The IPv6 packet (Fig. 1) doesn't look much like its IPv4 (Fig. 2) cousin, except for the leading version field. The IPv6 address fields are 128-bits. The larger address space is one reason to migrate to IPv6 but there are many more differences that give IPv6 an advantage. For example, the header checksum field has been eliminated because transport reliability has gone up and its overhead was unnecessary.
The movement to IPv6 on a global scale is inevitable. It has been more of an issue of getting the infrastructure in place to make the move to cause the minimal number of problems. It is possible for IPv4 and IPv6 subnets to exchange traffic but there are issues that vary depending upon the network configuration and the type of network traffic.
Here are some of the major differences between IPv4 and IPv6. Both standards are extensive and many features are less obvious and important for only some environments.
IPv4/IPv6 Differences
IPv4 |
IPv6 |
|
Address | 32 bits (4 bytes) 12:34:56:78 |
128 bits (16 bytes)
1234:5678:9abc:def0:
1234:5678:9abc:def0
|
Packet size | 576 bytes required, fragmentation optional | 1280 bytes required without fragmentation |
Packet fragmentation | Routers and sending hosts | Sending hosts only |
Packet header | Does not identify packet flow for QoS handling | Contains Flow Label field that specifies packet flow for QoS handling |
Includes a checksum | Does not include a checksum | |
Includes options up to 40 bytes |
Extension headers used for optional data | |
DNS records | Address (A) records, maps host names |
Address (AAAA) records, maps host names |
Pointer (PTR) records, IN-ADDR.ARPA DNS domain |
Pointer (PTR) records, IP6.ARPA DNS domain |
|
Address configuration | Manual or via DHCP | Stateless address autoconfiguration (SLAAC) using Internet Control Message Protocol version 6 (ICMPv6) or DHCPv6 |
IP to MAC resolution | broadcast ARP | Multicast Neighbor Solicitation |
Local subnet group management | Internet Group Management Protocol (IGMP) | Multicast Listener Discovery (MLD) |
Broadcast | Yes | No |
Multicast | Yes | Yes |
IPSec | optional, external | required |
The IPv4/IPv6 Basics
The address space is the main difference between IPv4 (32-bit) and IPv6 (64-bit). The text representation has also been changed from a 2-digit partitioning for IPv4 to 4-digits for IPv6. An IPv4 example address is 12:34:56:78. An IPv6 example address is 1234:5678:9abc:def0:1234:5678:9abc:def0. The IPv6 representation also allows double colons (::) to represent a string of zero entries so 1234:0:9abc:0:0:0:0:def0 could be 1234:0:9abc::def0.
Packets for both IPv4 and IPv6 are variable and they can be up to 64 Kbytes. The problem is that the protocols can be used over a number transports that may have other limits. This is normally specified by the maximum transmission unit (MTU). Both protocols have a minimum MTU requirement. This is 576 bytes for IPv4 and 1280 bytes for IPv6.
Larger data payloads can be shipped around the network by breaking the data among multiple packet fragments. This is typically done by the host but in IPv4 this can also be done by routers. IPv6 hosts need to determine the MTU for a path to a destination. This approach simplifies routers but adds complexity at the host end. This is normally not an issue and the IPv6 minimum MTU can always be used with any path.
The other big difference between IPv4 and IPv6 is the header. There are changes in the number and type of fields and extensions are handled in a different fashion. The IPv6 header is always 40 bytes and can be followed by any number of extension headers and then the data. This approach is more flexible but harder to process since the number and size of additional headers is variable.
The first field for each extension header is the next header code that specifies the type. Header should be ordered although only those necessary headers need be included in a packet. If there is a Hop-by-Hop header then it must be immediately after the main header. Note that the last next header code specifies the upper layer type of data in the payload or No next header.
Header Codes
Order |
Header Type |
Next Header Code |
1 |
Basic IPv6 Header |
- |
2 |
Hop-by-Hop Options |
0 |
3 |
Destination Options (with Routing Options) |
60 |
4 |
Routing Header |
43 |
5 |
Fragment Header |
44 |
6 |
Authentication Header |
51 |
7 |
Encapsulation Security Payload Header |
50 |
8 |
Destination Options |
60 |
9 |
Mobility Header |
135 |
No next header |
59 |
|
Upper Layer |
TCP |
6 |
Upper Layer |
UDP |
17 |
Upper Layer |
ICMPv6 |
58 |
Today's network hardware and software often does deep packet scans since many IPv4 protocols needed to implement this type of approach in the data. IPv4 was more limited and had many fields located at fixed offsets making processing easier but it made extensions much harder to implement. IPv4 has a checksum that needs to be recalculated at each hop since the time-to-live field changes. In theory, it provides more reliability. IPv6 does not have a checksum field thereby eliminating the field because transmission is more reliable and other mechanisms are used to provide this reliability.
Advanced IPv4/IPv6
Domain Name System (DNS) servers provide a distributed mechanism for resolving domain names to IPv4 or IPv6 address. A DNS server can handle both types of addresses using different DNS database records. The A record provides domain name to IPv4 resolution information. The AAAA record does the same except for an IPv6 address.
DNS handles IP address to domain name translation as well. This uses the PTR record for both types of IP addresses. These are prefixed by in-addr.arpa for IPv4 addresses and ip6.arpa for IPv6 addresses.
Other than address changes, DNS changes for handling IPv6 are relatively minimal.
What most people think of IPv4 and IPv6 addresses are Unicast addresses that specify a particular node. IPv4 also has a single Broadcast address for a subnet while IPv6 has Multicast addresses that specify a group of nodes. IPv6 also has an Anycast address. An Anycast address is like multicast in that it can specify multiple nodes but, in terms of delivery, a packet need only be delivered to one node within the group.
IPv4 devices have a fixed IP address or obtain one using a DHCP (dynamic host configuration protocol) server. 127.0.0.1 is the IPv4 loopback address.
IPv6 devices have a fixed IP address or obtain one using a DHCPv6 server. Nodes can also use stateless address autoconfiguration (SLAAC) using Internet Control Message Protocol version 6 (ICMPv6). SLAAC will be used on networks that do not have a DHCPv6 server. It uses Router Advertisements from routers connected to the local network.
I will not get into lots of details on address generation for IPv6 but I did want to mention cryptographically generated addresses (CGA). CGA uses a public key mechanism that allows nodes to generate an address and to uniquely identify itself without requiring an external certifying system. Like many IPv6 features, it is optional but having a standard mechanism means it can be used in an interoperable fashion.
IPv4 addresses are also allocated in blocks allowing easy subnet specifications. A netmask is often used to specify the number of bits used in the subnet. 192.168.1.0/24 (the netmask is 255.255.255.0) is the typical home subnet used with many gateways. It has 256 addresses associated with the subnet including the broadcast address that is 192.168.1.255 in this case.
IPv4 has three private address space blocks. These include 10.0.0.0/24, 172.16.0.0/20 and 192.168.0.0/16 of which 192.168.1.0/24 is a subset. Private address blocks will never be used for public IP addresses.
There is just one IPv6 private address block. It is fc00::/7, also called a Unique Local Address. The specification works just like the one used with IPv4. This means the block uses 121-bits for local devices. Other special addresses include the ::1/128 loopback address (127.0.0.1/32 for IPv4), ff00::/8 multicast, fec0::/10 site-local prefix, and fe80::/10 link-local prefix. IPv4 addresses are actually mapped to the lower fields of ::/96. These are sometimes written as 0000:0000:0000:0000:0000:0000:192.168.1.2.
Some of the big differences between IPv4 and IPv6 include how extensions like security are implemented. The header extensions mentioned earlier are how these features are incorporated. IPsec is now a standard option rather than a specialized protocol with IPv4.
Quality-of-service (QoS) is handled a little differently than extensions. The flow label and priority fields are used to provide QoS support. These are found in all IPv6 packet headers although they may be unused if the subnets in a path do not support them.
IPv4/IPv6 Coexistance
IPv4 and IPv6 subnets have and will continue to coexist even as the overall Internet moves from IPv4 to IPv6. There are a number of mechnisms in place that facilitate this. These include Stateless IP/ICMP Translation (SIIT), 6rd, NAT, tunneling and proxy server support. Many of the techniques can be deployed in firewalls and routers between IPv4 and IPv6 subnets.
SIIT uses ::/96 address and maps the 32-bit IPv4 to the lower bits of an IPv6 address. This allows direct access of IPv4 hosts by IPv6 nodes.
6rd (IPv6 rapid deployment) uses IPv6 to bridge IPv4 subnets. It tunnels IPv4 packet over IPv6. It is sometimes a service provided by ISPs.
Proxy servers with dual stacks can operate in either direction providing IPv4 access to an IPv6 server and vice versa. Proxy servers tend to be a stopgap measure since each proxy must be explicity configured.
IPv4 NAT gateways provide a mechanism for linking IPv4 devices to the IPv6 Internet. Of course, this assumes that the gateway can connect to an IPv6 network. Most of the latest commercial and consumer devices can do this but older devices are IPv4 only. In this case, an additional gateway is required so the IPv4 to IPv6 translation occurs outside a customer's premises.
Dual stack hosts are likely to be common as well. A network can carry IPv4 and IPv6 traffic at the same time. A dual stack host can communicate with either type of device as well as having its traffic routed to the outside world if appropriate. Dual stack routers can be gateways as well.
Unfortunately, mixed IPv4/IPv6 environments are fragile and many of the techniques will not work well together. Combine this with IPv4 extensions such as IPsec and other protocols and there is the possibility that connections might be made but applications will not work. The only likely combinations that will work well will be IPv4-to-IPv4 and IPv6-to-IPv6.
One issue that will have to wait for another article is IPv6 security. Because of the differences and features of IPv6, firewalls and security software need to address additional security issues that IPv4 did not. For example, tunneling solutions mentioned earlier can bring the more open IPv6 into an IPv4 network. It is possible to prevent or mitigate attacks along these lines but only if proper security configurations are used and if the hardware support this.
So what happened to IPv5? IPv5 is a designation for a variant of the Internet Stream Protocol (ST) that started back in 1979 but abandoned. Many of the features of ST are found in Multiprotocol Label Switching (MPLS) standard. IPv6 was based on IPng (IP next generation) work and IPv6 was initially called IPng version 7.