IPv4 vs IPv6: Key Differences Explained
Advertisement
This page compares IPv4 and IPv6 and describes the differences between them. The major difference between them is that IPv4 uses a 32-bit address, whereas IPv6 uses a 128-bit address.
Introduction
Both IPv4 and IPv6 are IP address schemes available for assigning IP addresses to computers connected to the network. We will explore the differences between IPv4 and IPv6 here. IP is a layer-3 protocol in the OSI stack. Packets are routed with the help of the destination address.
The functions of IP are as follows:
- Connectionless best-effort data delivery based on the destination IP address.
- Fragmentation and re-assembly of datagrams to support links with different MTUs (Maximum Transmission Units).
IPv4
IPv4 has a 32-bit IP address space. There are different classes: Class A, Class B, Class C, Class D, and Class E.
The figure depicts IPv4 header fields used in the IP protocol. IPv4 is defined in RFC 791.
Table-1 below mentions all the fields of the IPv4 header with functional descriptions.
IPv4 header field | Description |
---|---|
Version | It signifies the version of IPv4 or IPv6 in use |
IHL (Header length) | Datagram length in 32-bit words |
Type of Service | Specifies how upper layers would like the datagram to be handled. |
Total Length (data + header) | Size in bytes before fragmentation |
Identification | Helps in reassembly of fragments of the datagram. The same ID has been assigned to all the fragments of a datagram |
Flags (3 bits) | 2 lower bits are used; the lowest one signifies whether the packet can be fragmented or not, the middle one specifies whether the packet is the last one in the series of fragments of the packet |
Fragment offset | Indicates the offset position of the data fragment from the starting position of the datagram |
Time to Live | A counter that decrements to zero at the point of discarded datagrams. This helps to prevent any misrouted packets. |
Protocol | Indicates whether the higher layer is TCP (value 6) or UDP (value 17) |
Header Checksum | Required for error detection at the destination host |
Source address | Address of the sending node |
Destination address | Address of the receiving node |
Options | Supports various other options such as security, etc. |
Data | Contains upper layer data information |
IPv6
IPv6 has a 128-bit IP address, which helps support one billion networks, hence extends the drawbacks of the IPv4 system.
The figure depicts IPv6 header fields used in the IP protocol. IPv6 is defined in RFC 2460.
Table-2 below mentions all the fields of the IPv6 header with functional descriptions.
IPv6 header field | Description |
---|---|
Version (4bit) | Contains 0110 |
Traffic Class (8 bit) | Equivalent to the Type of Service field of IPv4, used to classify IPv6 priorities |
Flow label (20 bit) | Used by the source node to label a sequence of packets for which it requests a special type of handling by IPv6 routers. |
Payload length (16 bit) | Length of payload in bytes |
Next Header (8 bit) | Indicates the type of header IPv6 follows, such as TCP, UDP, ICMPv4, or ICMPv6 |
Hop Limit (8 bit) | Decrements by 1 after forwarding the packets by each node. When zero, packets are discarded, and an error message is returned. This is equivalent to the Time to Live field of the IPv4 protocol header. |
Source address (128 bit) | Origin of IPv6 packet |
Destination address (128 bit) | Destination of IPv6 packet |
Both IPv4 and IPv6 coexist in a multiprotocol configuration. To do this task, the network access layer should support multiplexing of IPv4 and IPv6 packets.
There are three methods of transition strategies from the IPv4 to IPv6 protocol format. They are dual-stack, tunneling, and header translation.
It is recommended to have both IPv4 and IPv6 protocol stacks in the device before migrating to IPv6.
Tabular Difference Between IPv4 and IPv6
The following table mentions the difference between IPv4 and IPv6.
IPv4 | IPv6 |
---|---|
In IPv4, there are only 232 possible ways to represent an address, which is about 4 billion. | In IPv6, there are 2128 possible ways. |
IPv4 address is written in dotted decimal notation. Example: 121.2.8.12 | IPv6 address is written in hexadecimal notation consisting of 8 groups with 4 hexadecimal digits or 8 groups of 16 bits each. Example: FABC:AC77:7834:2222:FACB:AB98:5432:4567 |
IPv4 header consists of 20 (minimum) to 60 bytes (maximum). It houses 13 fields. | IPv6 header consists of 40 bytes in length and houses only 8 fields. |
IPv4 header has a checksum which must be computed by each router. | IPv6 header does not use any checksum. |
IPv4 header contains an 8-bit field called service type. | IPv6 header contains an 8-bit field called traffic class field. |
IPv4 node has only stateful auto-configuration. | IPv6 node has both stateful and stateless address auto-configuration mechanisms. |
Security in IPv4 networks is limited to tunneling between two networks. | IPv6 has been designed to satisfy the growing and expanded need for network security. |
Source and destination addresses are 32 bits in length. | Source and destination addresses are 128 bits in length. |
IPsec support is optional. | IPsec support is required. |
No identification of packet flow for QoS handled by routers is present within the IPv4 header. | Packet flow identification for QoS handled by routers is included in the IPv6 header using the “flow label field”. |
ARP (Address Resolution Protocol) uses broadcast ARP request frames to resolve an IPv4 address to a link layer address. | ARP request frames are replaced with multicast neighbor solicitation messages. |
Must be configured either manually or through DHCP. | Does not require manual configuration or DHCP. |
Header includes options. | All optional data is moved to IPv6 extension headers. |
”ICMP router discovery” is used to determine the IPv4 address of the best default gateway, and it is optional. | ”ICMP router discovery” is replaced with “ICMPv6 router solicitation and router advertisement” messages, and it is required. |