"Understanding the evolution of IP addressing, from IPv4 to IPv6, with real-world usage, technical concepts, and code examples."
By Tushar
09/04/2025
The Internet as we know it runs on IP addresses, which uniquely identify devices online. For decades, IPv4 served this purpose. But with billions of devices online today, IPv4’s limitations have led to the rise of IPv6. This blog explains the differences, transition strategies, technical concepts like subnet masking and IP address classes, and even offers some coding examples.
IPv4 (Internet Protocol version 4) uses 32-bit addresses, usually written in dot-decimal notation like 192.168.1.1.
X.X.X.X (e.g., 172.16.254.1)IPv6 is the next-gen protocol with 128-bit addresses. It’s written in hexadecimal, e.g., 2001:0db8:85a3::8a2e:0370:7334.
Migrating the entire internet to IPv6 overnight is impossible. Transition happens via:
A subnet mask determines how IP addresses are split into networks and hosts.
Example:
192.168.1.10255.255.255.0/24 (24 bits for network)CIDR (Classless Inter-Domain Routing) uses suffixes like /24 instead of masks.
IPv4 is divided into classes to simplify address allocation:
IPv6 doesn’t use subnet masks the way IPv4 does. Instead:
/64 (first 64 bits for network)2001:db8:abcd:0012::/64Source: Google IPv6 Statistics
const http = require('http');
const server = http.createServer((req, res) => {
res.end('Hello from IPv6 server!');
});
server.listen(3000, '::1', () => {
console.log('Server listening on http://[::1]:3000');
});#include <iostream>
#include <cstring>
#include <arpa/inet.h>
#include <unistd.h>
int main() {
int sockfd = socket(AF_INET6, SOCK_STREAM, 0);
sockaddr_in6 serverAddr {};
serverAddr.sin6_family = AF_INET6;
serverAddr.sin6_port = htons(8080);
inet_pton(AF_INET6, "::1", &serverAddr.sin6_addr);
if (connect(sockfd, (sockaddr*)&serverAddr, sizeof(serverAddr)) == 0) {
std::cout << "Connected to IPv6 server!" << std::endl;
} else {
perror("Connection failed");
}
close(sockfd);
return 0;
}/64, /56, etc.) over manual subnettingping6, traceroute6, etc.IPv6 is no longer optional—it’s essential. As the world scales up in connected devices, only IPv6 can offer the necessary flexibility, security, and scalability.
Ready to build the internet of the future? Make sure your stack supports IPv6 today.