# Difference Between IPv4 and IPv6 (IPv4 vs IPv6) ## Introduction **Internet Protocol(IP)** is a unique identifier that recognizes each networking device uniquely on the Internet. For each device on a network, an IP address will be allocated and it is used for communication. An IP address is partitioned into two parts: network address and host address. Two types of IP addresses are: 1. IPv4 2. IPv6 ## What is IPv4? IPv4(Internet Protocol version 4) is the standard connectionless protocol for packet-switched networks used to connect our devices to the internet. The device is assigned with a unique numerical 32-bit IP address like 99.48.223.227, on connecting over the internet. ![](https://i.imgur.com/plaviwf.png) An IPv4 address format is x . x . x . x , where x is an octet and it must be a decimal value within the range 0 to 255. Each octet is separated by a period(.). An address of IPv4 must have 3 periods and 4 octets. ## Features of IPv4: - IPv4 is a connectionless internet protocol mainly used in packet-switched layer networks like Ethernet. - It works based on the best-effort delivery model where there is no guaranteed delivery and no proper sequencing or duplicate delivery avoidance is guaranteed. - By providing unique identification for each device, it helps to establish a logical connection between network devices. - There are multiple ways to configure IPv4 with all types of devices, which includes manual and automatic configurations depending on the type of network. - IPv4 has a 32-bit IP address written in 4 numbers separated by period(.) which is unique for each networking device. - It has a group of numbers separated by dots, which is called Octet (Example: 66.94.29.13). Each number in an octet is within the 0 to 255 range. This address can produce 4,294,967,296 unique addresses. Octet can have either 1 or 0 bit. If the bit is 1, then it will count the number represented by it. If the bit is 0, then it will not count the number represented by it. ## What is IPv6? IPv6 is the next generation of Internet Protocol(IP) intended to replace IPv4, it works similar to IPv4 i.e., it helps the computers to uniquely identify other computers or devices on the Internet. Every mobile phone, computer, IoT sensor, home automation component, and each device connected to the internet must have a numerical IP address for communicating with other devices. IPv4 was becoming exhaustive of address supply because of its worldwide usage from a proliferation of multiple connected devices. ![](https://i.imgur.com/BuLNT0x.png) A normal IPv6 address format is y : y : y : y : y : y : y : y where y is a segment and it can be any hexadecimal value within the range 0 to FFFF. Each segment is separated by a colon(:). A normal IPv6 address must have 7 colons and 8 segments. ## Features of IPv6: - IPv6 supports auto-configuration mode (stateful and stateless) of its host devices. - Large address space will be provided by IPv6, which enables allocating devices with unique IP addresses across the world. - After complete implementation of IPv6, every host can reach other hosts directly over the Internet, with few limitations such as organization policies, Firewall, etc. - IPv6’s header is simplified in comparison with the IPv4 header. It has moved all unnecessary data and options to the end of the IPv6 header. - IPv6 is a 128-bit hexadecimal IP address written using 8 sets of 16 bits each. These 8 sets of binary numbers are separated by a colon(:). Here, each hexadecimal character is constituted by a group of 4 bits. So, it requires the conversion of 4 bits into a hexadecimal number at a time. ## IPv4 vs IPv6 The following table provides the major differences between IPv4 and IPv6: | Basis for differences | IPv4 | IPv6 | | -------- | -------- | -------- | | **Definition** | IPv4(Internet Protocol version 4) is the standard connectionless protocol for packet-switched networks used to connect our devices to the internet. | IPv6 is the next generation of Internet Protocol(IP) intended to replace IPv4, it works similar to IPv4 i.e., it helps the computers to uniquely identify other computers or devices on the Internet. | | **Addressing method** | IPv4 is a numeric IP address, which has binary bit groups separated by a dot (.) | IPv6 is an alphanumeric IP address, which has binary bit groups(might include hexadecimal values) separated by a colon (:) | | **Security** | IPv4 is not designed by keeping security in the mind, security depends on applications | IPv6 protocol is having IPSec(Internet Protocol Security) with a proper key infrastructure | | **Checksum fields** | Checksum fields are present in packet header | Checksum fields does not exist in packet header | | **IP address size** | IPv4 is having 32-bit IP address length | IPv6 is having 128-bit IP address length | | **Header fields count**| Header fields count is 12 | Header fields count is 8 | | **Header field length** | Header field length is 20 | Header field length is 40 | | **Number of classes** | IPv4 allows 5 classes of IP Addresses i.e., Class A to E | IPv6 permits the storage of unlimited IP Addresses | | **Packet fragmentation** | Fragmentation means dividing a packets into smaller ones that will be reassembled later. It is performed by sending and forwarding routes | It is done by the sender | | **VLSM(Variable Length Subnet Mask) support** | It is supported by IPv4 | VLSM is not supported by IPv6 | | **Network Configuration** | Network configuration will be done through DHCP or manually. IPv4 had multiple overlays to control growth on the internet, which needs high maintenance efforts | IPv6 will support auto-configuration capabilities | | **Address Mask** | Address mask is used for the designated network from host portion | Address mask is not used in IPv6 | | **SNMP(Simple Network Management Protocol)** | SNMP is a system management related protocol that supports IPv4| It does not support IPv6 | | **Packet header** | Packet header does not helps to recognize packet flow for QoS(Quality of Service) handling | Packet header consists of Flow Label field that describes packet flow for QoS handling | | **Data packet size** | 576 bytes of size is required for a IPv4 packet, fragmentation is optional | 1208 bytes of size is required for a IPv6 packet, without fragmentation | | **Address configuration** | Done in a manual way or via DHCP | Stateless address auto-configuration is done using Internet Control Message Protocol version 6(ICMPv6) or DHCPv6 | | **Dynamic Host Configuration Server(DHCS)** | Clients have to approach DHCS when they want a network connection | Clients are provided with permanent addresses so that approaching a server for the network connection is not necessary | | **Optional fields** | IPv4 is having optional fields | IPv6 does not have any optional fields, but Extension headers are present | | **IPSec(Internet Protocol Security)** | IPSec regarding network security is optional | IPSec network security is compulsory | | **Address mapping** | For mapping with MAC address, IPv4 uses Address Resolution Protocol(ARP) | For mapping with MAC address, IPv6 uses Neighbour Discovery Protocol(NDP) | | **Compatibility with mobile devices** | IPv4 is not suitable for mobile networks as it uses the dot-decimal notation for address representation | IPv6 is highly suited for mobile networks as it uses hexadecimal and colon-separated notation for address representation | | **Best feature** | Use of NAT(Network address translation) devices which permits single NAT address to mask multiple non-routable addresses, which in turn makes end-to-end integrity possible | Because of huge address Space, IPv6 permits direct addressing | | **Address space** | It is capable of generating 4.29×10^9 address space | It can generate 3.4×10^38 address space | | **Encryption and Authentication of data** | This facility is not provided in IPv4 | IPv6 provides encryption and authentication facility | | **Example** | 12.244.232.164 | 2001:0ab8:0000:0000:0000:df00:0032:7859 | ### FAQ's #### 1. Which is faster IPv4 or IPv6? In general, there’s no much difference between speeds of IPv4 vs IPv6. But, you can find some evidence that proves IPv6 is slightly faster in some situations. One of the cause for why IPv6 might be faster is that it won't waste time on NAT(Network Address Translation). However, IPv6 has larger packet headers, so it might potentially be slower for few cases. #### 2. Why do we still use IPv4 instead of IPv6? IPv4 is still functioning adequately in various networks, because development in protocol enhancements has extended the IPv4 usability. The commonly used extension is NAT (Network Address Translation). #### 3. Does IPv6 completely replace IPv4? IPv6 is the Internet Protocol's latest version that will eventually replace IPv4 addressing, the version that is most commonly used on the Internet nowadays. It is a strongly established protocol that is having usage and deployment growth, mainly in mobile phone markets. So, it is must to replace IPv4 with IPv6 as we are running out of IPv4 addresses and IPv6 is considered as the solution. #### 4. Does enabling IPv6 speed up internet? According to theory, IPv6 is expected to be a little faster as it is not necessary to waste the cycles on NAT translations. But IPv6 has larger packets, which might make it slower for few use cases. So we can say that most of your network will work fine and faster with IPv6 enabled while a few older software may not work up to expectations. #### 5. Can IPv6 communicate with IPv4? They cannot communicate directly as they are two separate protocols, with incompatible packet headers and addressing. IPv6 applications that run on a dual-stack are allowed to use the IPv4 protocol. IPv6 applications will make use of an IPv4-mapped IPv6 address. The client is able to communicate with IPv4–only servers. It is also possible to communicate with IPv6 servers that run on either IPv6–only host or a dual host. #### 6. Can IPv6 cause problems? If you disable IPv6, it may cause problems. If your router and internet connection have previously migrated to IPv6, then you will not be permitted to use it properly when IPv6 is disabled. IPv6 is a must to replace IPv4 as we are running out of IPv4 addresses and IPv6 is considered as the solution. #### 7. Will IPv6 ever become standard? IPv6 is already considered a standard and is intended to replace IPv4. IPv6 is more secure, more efficient, and more mobile-friendly compared to IPv4. #### 8. Will IPv6 be exhausted? No, because there exists 340 trillion, trillion, trillion number of IPv6 addresses, which will be enough to support trillions of internet devices for the future. #### 9. Will IPv4 address depletion implies services to get switched off? No, both IPv4 and IPv6 will be running in parallel till there is no more necessity to do so. #### 10. What will happen when the IPv4 is over? IPv6 has been deployed on the Internet successfully and is being commonly used. It will permit continuous network growth, and there will be no problems when IPv4 is over. ### Conclusion The study on IPv4 and IPv6 networks showed that the IPv6 performs better than the IPv4 with mere difference, but still it has not shown 100% accurate performance over IPv4. IPv6 deployment is a necessity, it still needs a gradual change despite many advantages that come with the new version. IPv4 and IPv6 will hold a stable position for a long time, hence the necessity for methods of communication between the old and new variants will arise. The Dual-Stacking or Tunneling method may be used to get rid of subsequent problems in the internet networks because the related issues address spaces in the numbering system of the Internet Protocol version 4 (IPv4). This article will help you to understand the difference between IPv4 and IPv6. ### References - https://ukdiss.com/examples/ipv4-and-ipv6-differences.php - https://www.youtube.com/watch?v=ThdO9beHhpA - https://www.youtube.com/watch?v=8npT9AALbrI