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 involves a collection of rules that support the idea of unreliable packet delivery.
Content: IPv4 Vs IPv6
Comparison Chart
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 109 addresses. | It can produce quite a large number of addresses, i.e., 3.4 x 1038 . |
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 offers about 4.3 billion addresses. Only 3.7 billion addresses can only be assigned out of 4.3 billion address. The other addresses are conserved for specific 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
128.11.3.31
Packet Format
An IPv4 datagram is a variable-length packet comprised of a header (20 bytes) and data (up to 65,536 along with header). The header contains information essential to routing and delivery.
Base Header
- 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 signifies the entire 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 determined with a sequence number in this field.
- Flags: The bits in the flags field handles fragmentation and identifies the first, middle or last fragment, etc.
- Fragmentation offset: It’s a pointer that represents 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 specifies which upper layer protocol data are encapsulated in the datagram (TCP, UDP, ICMP, etc.).
- Header checksum: This is a 16-bit field confirm 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 is a two-level address structure (net id and host id) classified into five categories (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 isolate entries in a sequence 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
FDEC:BA98:7654:3210:ADBF:BBFF:2922:FFFF
IPv6 Packet format
Each packet is consist of a mandatory base header succeeded by the payload. The payload includes two parts namely optional extension headers and data from an upper layer. The base header consumes 40 bytes, inversely the extension headers and data from the top layer usually hold up to 65,535 bytes of information.
Base Header
- Version: This four-bit field specifies the version of the IP, i.e., 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 facilitate with special controlling for a certain flow of data.
- Payload length: It defines the total length of the IP datagram excepting the base header.
- Next header: It’s an eight-bit field describe the header that trails 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 assist with the same functions 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 generally describes the final destination of the datagram.
Key Differences Between IPv4 and IPv6
Let us look at the substantial 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 removes the header checksum field.
- In IPv4, the base header does not contain 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.
Conclusion
IPv6 retains many of the core concepts from the current protocol, IPv4 but changes most details. IPv4 was devised as a transport and communications means, but the number of addresses came to exhaustion that was the reason for the development of IPv6. IPv6 provides scalability, flexibility and seamless possibilities in the field of networking.
Abraham Y. Chen says
Great article.
prem says
Good article.
alok says
Can I know the writer of this article?
Rohan says
Really Great Information. Got an in-depth idea about ipv4 and ipv6 after reading this.