networking ipv4 ipv6 cidr subnetting dev-tech

IP Networking and Subnetting Guide: IPv4, IPv6, and CIDR Explained

Master the foundations of the internet. Learn about IPv4 and IPv6 addresses, how CIDR works, and how to calculate subnet masks for your network.

2026-04-11

IP Networking and Subnetting Guide: IPv4, IPv6, and CIDR

At the core of the internet is the Internet Protocol (IP). It is the system that allows devices to find and communicate with each other across the global network. Understanding how IP addresses are structured and how networks are divided (subnetting) is fundamental for any IT professional.

1. IPv4 vs. IPv6

IPv4 (Internet Protocol version 4)

The most widely used version of IP. It uses 32-bit addresses, typically written in dotted-decimal format (e.g., 192.168.1.1).

  • Limitation: Only supports about 4.3 billion addresses, which has led to the exhaustion of available addresses.

IPv6 (Internet Protocol version 6)

The successor to IPv4, designed to solve the address exhaustion problem. It uses 128-bit addresses, written in hexadecimal (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).

  • Pros: Virtually unlimited addresses, built-in security (IPsec), and more efficient routing.

2. Subnetting and CIDR

Subnet Mask

A subnet mask (e.g., 255.255.255.0) is used to divide an IP address into two parts: the network address and the host address.

CIDR (Classless Inter-Domain Routing)

CIDR is a more flexible way to manage IP addresses than the old "Class A, B, C" system. It uses a suffix (the "slash" notation) to indicate the number of bits used for the network portion.

  • Example: 192.168.1.0/24 means the first 24 bits are the network, and the remaining 8 bits are for hosts (up to 254 devices).

3. Core Networking Concepts

NAT (Network Address Translation)

NAT allows multiple devices on a private network to share a single public IP address. This is how your home router allows all your devices to access the internet simultaneously.

DHCP (Dynamic Host Configuration Protocol)

A protocol that automatically assigns IP addresses and other network configuration (like DNS and gateway) to devices when they connect to a network.

ARP (Address Resolution Protocol)

Used to map an IP address to a physical MAC address on a local area network (LAN).

ICMP (Internet Control Message Protocol)

Used by network devices to send error messages and operational information. The most common use of ICMP is the ping command.


Subnetting Cheat Sheet (/24 to /32)

CIDR Subnet Mask Total Hosts Usable Hosts
/24 255.255.255.0 256 254
/26 255.255.255.192 64 62
/28 255.255.255.240 16 14
/30 255.255.255.252 4 2
/32 255.255.255.255 1 1

Conclusion

IP networking is the foundation of digital communication. While IPv4 still dominates today's landscape, the transition to IPv6 is essential for the future growth of the internet. Mastering CIDR and subnetting allows you to design efficient, secure, and scalable networks.