IPv4 and IPv6 are the versions of internet protocol where IPv6 is the enhanced version of IPv4. There are various differences between IPv4 and IPv6 protocol including their features, but the crucial one is the number of addresses (Address space) it generates.
IP version 4 (IPv4) generates 4.29 x 109 unique network addresses which is insufficient in quantity and as a result Internet is running out of space. Whereas IP version 6 (IPv6) produces 3.4 x 1038 addresses and is a scalable and flexible solution to the current problem.
First of all, let us understand what is Internet protocol. The TCP/IP standard protocol that defines the IP datagram as the unit of information moved across the internet. It is an unreliable and connectionless datagram protocol – a best-effort delivery service. The internet is an abstraction of physical networks and provides the same functionalities like accepting and delivering packets.
IP provides three major things that are:
- Specification of the exact format of all data.
- It performs routing function and chooses path for sending the data.
- It includes a set of rules that embody the idea of unreliable packet delivery.
Content: IPv4 Vs IPv6
|Basis of comparison||IPv4||IPv6|
|Address Configuration||Supports Manual and DHCP configuration.||Supports Auto-configuration and renumbering|
|End-to-end connection integrity||Unachievable||Achievable|
|Address Space||It can generate 4.29 x 10||It can produce quite a large number of addresses, i.e., 3.4 x 10
|Security features||Security is dependent on application||IPSEC is inbuilt in the IPv6 protocol|
|Address length||32 bits (4 bytes)||128 bits (16 bytes)|
|Address Representation||In decimal||In hexadecimal|
|Fragmentation performed by||Sender and forwarding routers||Only by the sender|
|Packet flow identification||Not available||Available and uses flow label field in the header|
|Checksum Field||Available||Not available
|Message Transmission Scheme||Broadcasting||Multicasting and Anycasting|
|Encryption and Authentication||Not Provided||Provided|
Definition of IPv4
An IPv4 address is a 32- bit binary value, which can be displayed as four decimal digits. The IPv4 address space provides approximately 4.3 billion addresses. Of that address space, about 3.7 billion addresses are actually assignable. The other addresses are reserved for special purposes such as multicasting, private address space, loopback testing, and research.
IP version 4 (IPv4) uses Broadcasting for transferring packets from one computer to all computers; this probably generates problems sometimes.
Dotted-Decimal Notation of IPv4
An IPv4 datagram is a variable-length packet consist of a header (20 bytes) and data (up to 65,536 including header). The header contains information essential to routing and delivery.
Version: It defines the version number of IP, i.e., in this case,it is 4 with a binary value of 0100.
Header length (HLEN): It represents the length of the header in multiple of four bytes.
Service type: It determines how datagram should be handled and includes individual bits such as level of throughput, reliability, and delay.
Total length: It defines the total length of the IP datagram.
Identification: This field is used in fragmentation. A datagram is divided when it passes through different networks to match the network frame size. At that time each fragment is identified with a sequence number in this field.
Flags: The bits in the flags field deal with fragmentation and identifies the first, middle or last fragment;, etc.
Fragmentation offset: It’s a pointer that shows the offset of the data in the original datagram.
Time to live: It defines the number of hops a datagram can travel before it is rejected. In simple words, it specifies the duration for which a datagram remains on the internet.
Protocol: The protocol field defines which upper layer protocol data are encapsulated in the datagram (TCP, UDP, ICMP, etc.).
Header checksum: This is a 16-bit field ensure the integrity of the header values, not the rest of the packet.
Source address: It’s a four-byte internet address which identifies the source of the datagram.
Destination address: This is a 4-byte field which identifies the final destination.
Options: This provides more functionality to the IP datagram. Furthermore can carry fields like control routing, timing, management, and alignment.
IPv4 has two-level address structure (net id and host id) categorized into five classes (A, B, C, D, and E).
Definition of IPv6
An IPv6 address is a 128-bit binary value, which can be displayed as 32 hexadecimal digits. Colons separate entries in a series of 16-bit Hexadecimal fields. It provides 3.4 x 1038 IP addresses. This version of IP addressing is designed to fulfill the needs of exhausting IP’s and providing sufficient addresses for future Internet growth requirements.
As IPv4 uses two-level address structure where the use of address space is insufficient. That was the reason for proposing the IPv6, to overcome the deficiencies IPv4. The format and the length of the IP addresses were changed along with the packet format and protocols were also modified.
Hexadecimal Colon Notation of IPv6
IPv6 Packet format
Each packet is composed of a mandatory base header followed by the payload. The payload consists of two parts: optional extension headers and data from an upper layer. The base header occupies 40 bytes, whereas the extension headers and data from the top layer usually contain up to 65,535 bytes of information.
Version: This four-bit field defines the version of the IP. That is 6 in this case.
Priority: It defines the priority of the packet concerning traffic congestion.
Flow label: The reason for designing this protocol is to provide special handling for a particular flow of data.
Payload length: It defines the total length of the IP datagram excluding the base header.
Next header: It’s an eight-bit field specifying the header that follows the base header in the datagram. The next header is one of the optional extension headers which IP uses or the header for an upper layer protocol such as UDP or TCP.
Hop limit: This eight-bit hop limit field serves the same purpose at the TTL field in IPv4.
Source address: It is a 16 bytes internet address identifies the source of the datagram.
Destination address: This is 16-byte internet address that usually identifies the final destination of the datagram.
Key Differences Between IPv4 and IPv6
Let us look at the major difference between IPv4 and IPv6.
- IPv4 has 32-bit address length whereas IPv6 has 128-bit address length.
- IPv4 addresses represent the binary numbers in decimals. On the other hand, IPv6 addresses express binary numbers in hexadecimal.
- IPv6 uses end-to-end fragmentation while IPv4 requires an intermediate router to fragment any datagram that is too large.
- Header length of IPv4 is 20 bytes. In contrast, header length of IPv6 is 40 bytes.
- IPv4 uses checksum field in the header format for handling error checking. On the contrary, IPv6 eliminates the header checksum field.
- In IPv4, the base header does not include a field for header length, and 16-bit payload length field replaces it in the IPv6 header.
- The option fields in IPv4 are employed as extension headers in IPv6.
- The Time to live field in IPv4 refers to as Hop limit in IPv6.
- The header length field which is present in IPv4 is eliminated in IPv6 because the length of the header is fixed in this version.
- IPv4 uses broadcasting to transmit the packets to the destination computers while IPv6 uses multicasting and anycasting.
- IPv6 provides authentication and encryption, but IPv4 doesn’t provide it.
IPv6 retains many of the core concepts from the current protocol, IPv4 but changes most details. IPv4 was designed as a transport and communications medium, but the number of addresses came to an exhaustion that was the reason for the development of IPv6. IPv6 provides scalability, flexibility and seamless possibilities in the field of networking.