Difference between IPv4 and IPv6 Header
An IP (Internet Protocol) address is a numerical identifier that is assigned to every device connected to a computer network that communicates using the IP protocol.
An IP address is a number that identifies a device(systems/PCs) on a network. IP addresses are also called or known as Internet addresses or IP numbers.
The IP address defines the addressing and packets scheme’s technical format. IP and TCP are used in most networks (Transmission Control Protocol). It can also be used to create a virtual link between a source and a destination.
What is ad hoc network and why they are called ad hoc
IPv4 is a version of the Internet Protocol that is extensively used in addressing systems to identify devices on a network. It uses a 32-bit address system to hold 2^32 addresses or more than 4 billion addresses. It is the most essential Internet Protocol, with 94 percent of all Internet traffic passing over it.
The Internet Protocol version 6 (IPv6) is the recent version of IP. This new IP address version(IPv6) is being implemented to meet the need for additional IP addresses. It was created & invented with the goal of resolving IPv4 drawbacks. IPv6 is sometimes known as IPng (Internet Protocol Generation Next).
Version: Contains the IP version number in binary ie 0100.
Header Length: It is 4bit in length. The max. TCP header size is 60B(20+40)But 4bit can denote max. 15byte. So it is multiplied by 4 to get the actual header size.
Type of Service: Used to specify a datagram’s priority
Total Length: Denotes the total length of IPv4 fragment including header size.
Identification: This field is used to identify the fragments in header. All fragments of any particular packet contain the same fragment ID.
Flag: This is composed of 3bits R, M, D R–> reserved M–>more fragment D–>don’t fragment
Fragment Offset: Shows relative position of data in the fragment with respect to the whole data packet.
TTL: used to stop circulating of ipv4 packets. Generally, it is set equal to twice the number of routers in the network.
Protocol: used to denote higher layer protocol
Header Checksum: This is not a mandatory field. Contains a checksum for the header part only.
How to Protect Yourself from Phishing Attacks: Safeguard Your Online Security
Key Features
IPv4 uses a 32-bit address while IPv6 uses a 128-bit address.
IPv4 uses a numeric addressing scheme, whereas IPv6 uses an alphanumeric scheme.
IPv4 contains 12 header fields and 8 header fields in IPv6.
IPv4 supports broadcast, however, IPv6 does not.
IPv4 contains checksum fields but is absent in IPv6.
When comparing IPv4 and IPv6, we can see that IPv4 supports VLSM (Variable Length Subnet Mask), whereas IPv6 does not.
IPV4 Header :
Version (4-bits): It represents the version of IP, i.e. 0110.
Traffic Class (8-bits): The traffic class having 8 bits and is divided into two parts. The most crucial 6 bits are utilized for Type of Service, which informs the Router about the services that should be offered for this packet. For Explicit Congestion Notification, the least significant two bits are used (ECN).
Flow Label (20-bits): This label is used to maintain the sequential flow of the packets that belongs to a communication between two party.
The source assigns a label to the sequence to aid the router in determining if a packet belongs to a certain information flow. This parameter prevents data packets from being re-ordered.
Payload Length (16-bits): This field is used to tell routers how much information is contained in a packet’s payload. The payload is made up of Extension Headers and Upper Layer data.
With 16 bits, you can indicate up to 65535 bytes; however, if the Extension Headers contain Hop-by-Hop Extension Header, the payload may be larger than 65535 bytes, in which case this field is set to 0.
Next Header (8-bits): This field is used to specify the kind of Extension Header, or the Upper Layer PDU if the Extension Header is not present. The type of Upper Layer PDU has the same values as IPv4.
Hop Limit (8-bits): This field is used to avoid packets looping in the network infinitely. TTL in IPv4 is the same as this. As a link (router/hop) is sent, the value of the Hop Limit field is decremented by one. The packet is deleted when the field approaches 0.
IPv6 Extension Headers
In IPv6, the Fixed Header only carries the information that is required, eliminating information that is either not required or is utilized seldom. Extension Headers are used to store all of this information between the Fixed Header and the Upper-Layer Header.
A unique value identifies each Extension Header. The Next Header field of an IPv6 Fixed Header refers to the first Extension Header.
When Extension Headers are utilized. If there is another Extension Header, the ‘Next-Header’ field of the first one points to the second, and so on. The ‘Next-Header’ field in the last Extension Header links to the Upper Layer Header. As a result, all of the headers in the linked list refer to the next one.
If the Next Header field contains the value 59, it indicates that there are no headers after this header, not even the Upper-Layer Header.
Difference of IPv6 compared to IPv4:
Header Format SimplificationNo fragmentation on a router: fragmentation field and the option field has been relocated to the extension header. MTU discovery should be used by hosts.
No header checksum: Reduce the cost of header processing,no checksum updates at each router.
Feature | IPv4 | IPv6 |
Size of IP Address | 32-bit IP address | 128-bit IP address |
Addressing Method | Numeric, binary bits separated by a dot (.) | Alphanumeric, binary bits separated by a colon (:) with hexadecimal |
Number of Header Fields | 12 | 8 |
Length of Header Field | 20 bytes | 40 bytes |
Checksum | Has checksum fields | Does not have checksum fields |
Example | 12.244.233.165 | 2001:0DB8:0000:0000:0000:FF00:0042:7879 |
Network Transmission Types | Unicast, Broadcast, and Multicast | Unicast, Multicast, and Anycast |
Number of Classes | Five different IP address classes (Class A to E) | No specific classes; allows storing an unlimited number of IP addresses |
Configuration | Must be configured on a newly installed system | Configuration is optional, depending on functions needed |
VLSM Support | Supports VLSM (Variable Length Subnet Mask) | Does not offer support for VLSM |
Fragmentation | Done by sending and forwarding routers | Done by the sender |
Routing Information Protocol (RIP) | Supported by the routed daemon | Does not support IPv6; uses static routes |
Security | Dependent on applications; IPv4 not designed with security in mind | IPsec (Internet Protocol Security) is built into the IPv6 protocol |
Packet Size | Packet size 576 bytes required, fragmentation optional | Packet size 1208 bytes required without fragmentation |
Packet Fragmentation | Allows from routers and sending hosts | Done by sending hosts only |
Packet Header | Does not identify packet flow for QoS handling; includes checksum options | Flow Label field in packet header specifies packet flow for QoS handling |
DNS Records | Address (A) records, maps hostnames | Address (AAAA) records, maps hostnames |
Address Configuration | Manual or via DHCP | Stateless Address Autoconfiguration using 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) |
IPsec | Optional | Mandatory |
Dynamic Host Configuration Server (DHCS) | Clients approach DHCP server when connecting to a network | Clients do not have to approach any server as they are given permanent addresses |
Mapping | Uses ARP (Address Resolution Protocol) to map to MAC address | Uses NDP (Neighbor Discovery Protocol) to map to MAC address |
Compatibility with Mobile Devices | Address represented in dot-decimal notation, less suitable for mobile networks | Address represented in hexadecimal, colon-separated notation; better suited for mobile networks |
NAT (Network Address Translation) | Often used to conserve IPv4 addresses | Generally not required |