Difficulty: Beginner
Why was IPv6 introduced? Compare IPv4 and IPv6 in terms of address space, header, fragmentation and configuration.
Here is the honest story behind IPv6: IPv4 has 32 bits, which is about 4.3 billion addresses, and that sounded infinite in the 1980s. Then smartphones, IoT devices and cloud servers arrived, and by 2011 the central pool of free IPv4 blocks was exhausted. NAT bought us a lot of time by letting a whole home share one public address, but NAT is a patch, not a design. IPv6 is the real fix.
Address space is the headline difference. IPv6 addresses are 128 bits, giving 2^128 addresses, roughly 3.4 times 10^38. They are written as eight groups of four hex digits separated by colons, such as 2001:0db8:0000:0000:0000:ff00:0042:8329, and can be shortened by dropping leading zeros in each group and replacing one run of all-zero groups with a double colon, giving 2001:db8::ff00:42:8329. You can only use the double colon once, otherwise the address is ambiguous. The loopback is ::1, and link-local addresses start with fe80::.
The header is also cleaner. The IPv4 header is variable length (20 to 60 bytes) and contains fields like header checksum and options. The IPv6 header is a fixed 40 bytes, removes the header checksum (because link layer and transport layers already check integrity, and it saved routers from recomputing it at every hop), and moves optional stuff into extension headers. Fields like TTL became Hop Limit, and there is a Flow Label field that helps routers treat a stream of packets consistently.
Fragmentation differs: in IPv4 routers along the path can fragment a packet if it is too big. In IPv6 routers never fragment. Only the source can fragment, and it discovers the path MTU through Path MTU Discovery using ICMPv6 Packet Too Big messages. That makes forwarding faster, but it also means blocking ICMPv6 on a firewall breaks connectivity in subtle ways, which is a classic production incident.
Configuration and other features: IPv6 supports stateless address autoconfiguration (SLAAC), where a host builds its own address from the router-advertised prefix plus an interface identifier, so DHCP is optional (DHCPv6 still exists for extra options). IPv6 has no broadcast; it uses multicast and anycast, and ARP is replaced by the Neighbor Discovery Protocol running over ICMPv6. IPsec support was originally mandatory in the spec and is now recommended. Every device can in principle have a globally routable address, which restores the original end-to-end model and removes the need for NAT, although stateful firewalls are still needed for security.
For migration, three strategies matter. Dual stack runs both protocols side by side and is the most common. Tunnelling wraps IPv6 packets inside IPv4 (for example 6to4 or Teredo). Translation, such as NAT64 with DNS64, lets IPv6-only clients reach IPv4-only servers. A good closing line for the interview: IPv6 adoption in India is high, and Jio networks are largely IPv6, so this is not just theory.
Full : 2001:0db8:0000:0000:0000:ff00:0042:8329
Step 1 : drop leading zeros -> 2001:db8:0:0:0:ff00:42:8329
Step 2 : compress one zero run -> 2001:db8::ff00:42:8329
Wrong : 2001::1::8329 (two :: is ambiguous)
The double colon can appear only once per address.
IPv4, IPv6, Address Exhaustion, Dual Stack, Header Format