Computer Basics

What is an IP Address? IPv4, IPv6, and How IP Addressing Works

An IP address (Internet Protocol address) is a numerical label assigned to every device connected to a network that uses the Internet Protocol for communication. IP addresses serve 2 functions: host identification (which device) and location addressing (how to reach it). This guide covers IPv4 and IPv6 structure, public versus private addresses, NAT, DHCP, static versus dynamic IPs, and how to find your IP address.

What Is an IP Address?

An IP address is a unique numerical identifier that allows routers to deliver packets to the correct device on a network. Every device that sends or receives data on an IP network — computers, smartphones, servers, printers, IoT sensors — requires at least one IP address. Without an IP address, a device cannot participate in TCP/IP communication.

Two versions of the Internet Protocol are in use: IPv4 (the original, 32-bit addressing) and IPv6 (the modern replacement, 128-bit addressing). IPv4 remains the dominant protocol on most networks, but IPv6 adoption has grown to approximately 45% of global traffic as measured by Google’s IPv6 statistics in 2024.

IPv4 Structure and Address Space

An IPv4 address is a 32-bit number written as 4 decimal octets separated by dots (dotted-decimal notation), such as 192.168.1.1. Each octet represents 8 bits and ranges from 0 to 255. A 32-bit address space provides 2^32 = 4,294,967,296 (approximately 4.29 billion) unique addresses.

IPv4 addresses are divided into network and host portions by a subnet mask. A /24 subnet mask (255.255.255.0) reserves the first 24 bits for the network address and the last 8 bits for host addresses, allowing 254 usable host addresses (256 minus the network address and broadcast address) per subnet. CIDR (Classless Inter-Domain Routing) notation expresses the subnet mask as a prefix length appended to the IP address, e.g., 192.168.1.0/24.

IPv4 Address Exhaustion

IANA (Internet Assigned Numbers Authority) depleted its last block of unallocated IPv4 addresses on February 3, 2011. The 5 Regional Internet Registries (RIRs) have since managed remaining allocations from returned or reclaimed blocks.

ARIN (North America) reached exhaustion of its free pool in September 2015. RIPE NCC (Europe) reached final /22 allocations in November 2019.

IPv4 address exhaustion is mitigated by 2 mechanisms: NAT (Network Address Translation), which allows many private devices to share one public IP, and IPv6, which provides a practically unlimited address space.

IPv6 Structure and Address Space

An IPv6 address is a 128-bit number written as 8 groups of 4 hexadecimal digits separated by colons, such as 2001:0db8:85a3:0000:0000:8a2e:0370:7334. The total IPv6 address space is 2^128 = 340 undecillion (3.4 × 10^38) addresses — enough to assign approximately 670 quadrillion unique addresses to every square millimeter of Earth’s surface.

IPv6 addresses can be compressed by omitting leading zeros within groups and replacing one or more consecutive all-zero groups with ::. The address 2001:0db8:0000:0000:0000:0000:0000:0001 compresses to 2001:db8::1. The :: notation can only appear once in an address to avoid ambiguity.

Public vs Private IP Addresses

Public IP addresses are routable on the global Internet and are assigned by ISPs from blocks allocated by RIRs. Private IP addresses are defined in RFC 1918 and are not routable on the public Internet — routers on the Internet discard packets with private source or destination addresses.

RFC 1918 defines 3 private IP address ranges for IPv4.

  • 10.0.0.0/8: Addresses 10.0.0.0 – 10.255.255.255. Provides 16,777,216 addresses. Used in large enterprise networks.
  • 172.16.0.0/12: Addresses 172.16.0.0 – 172.31.255.255. Provides 1,048,576 addresses. Used in medium enterprise networks.
  • 192.168.0.0/16: Addresses 192.168.0.0 – 192.168.255.255. Provides 65,536 addresses. Used in home and small office networks.

NAT (Network Address Translation)

NAT (Network Address Translation) maps private IP addresses to one or more public IP addresses at the network boundary (typically the router or firewall). NAT allows thousands of internal devices using private RFC 1918 addresses to share a single public IP address assigned by the ISP.

NAT (Network Address Translation) - What is an IP Address? IPv4, IPv6, and How IP Addressing Works

The most common form, PAT (Port Address Translation) or NAT overload, tracks connections using unique source port numbers. A home router with one public IP can simultaneously support over 65,000 concurrent connections by mapping each connection to a different source port in the translation table. NAT provides a degree of security by hiding internal IP addresses from external networks, but it is not a firewall substitute — it does not inspect or filter traffic.

DHCP (Dynamic Host Configuration Protocol)

DHCP (Dynamic Host Configuration Protocol) automatically assigns IP addresses, subnet masks, default gateways, and DNS server addresses to devices joining a network. Without DHCP, administrators would have to configure each device’s IP address manually.

DHCP (Dynamic Host Configuration Protocol) - What is an IP Address? IPv4, IPv6, and How IP Addressing Works

DHCP operates in 4 steps (DORA): Discover (client broadcasts request), Offer (server offers an IP), Request (client requests the offered IP), Acknowledge (server confirms the assignment). The assigned address is called a lease. Default lease times range from 24 hours (home routers) to 8 days (enterprise environments).

When a lease expires, the device must renew it or obtain a new IP address. DHCP reservations (also called static DHCP or DHCP binding) assign the same IP to a device’s MAC address consistently while still using the DHCP protocol.

Static vs Dynamic IP Addresses

A static IP address is manually configured and does not change. A dynamic IP address is assigned by DHCP and may change when the lease expires or the device reconnects.

  • Static IP: Required for servers, printers, and network equipment that must be reachable at a consistent address. Static IPs eliminate dependency on DHCP renewal and simplify DNS and firewall rule management.
  • Dynamic IP: Standard for end-user devices (laptops, phones). ISPs assign dynamic public IPs to most residential customers from a shared pool, reducing the number of public IPs required.

Loopback Addresses

The loopback address allows a device to send network traffic to itself for testing and local services. For IPv4, the loopback address is 127.0.0.1 (the entire 127.0.0.0/8 range is reserved for loopback).

For IPv6, the loopback address is ::1. Traffic sent to the loopback address never leaves the device — it is processed entirely within the network stack without reaching a physical interface.

How to Find Your IP Address

Finding the current device IP address differs by operating system and whether the private (LAN) or public IP is needed.

  • Windows private IP: Run ipconfig in Command Prompt. The IPv4 Address field shows the local IP assigned by DHCP or manual configuration.
  • Linux/macOS private IP: Run ip addr (Linux) or ifconfig (macOS) in Terminal to list all network interfaces and their IP addresses.
  • Public IP address: Visit a service such as https://api.ipify.org or run curl ifconfig.me in a terminal. The returned address is the public IP seen by external servers — the NAT exit point at the router or ISP.

IPv4 vs IPv6 Comparison

FeatureIPv4IPv6
Address length32 bits128 bits
Address formatDotted decimal (192.168.1.1)Colon-hex (2001:db8::1)
Total addresses4.29 billion340 undecillion (3.4 × 10^38)
Address exhaustionIANA pool depleted February 2011No foreseeable exhaustion
Header size20 bytes (minimum)40 bytes (fixed, simplified)
NAT requiredYes (for most private networks)No — every device gets a global address
Auto-configurationRequires DHCPSLAAC (Stateless Address Autoconfiguration) built in
SecurityIPsec optionalIPsec mandated by design (optional in practice)
Loopback address127.0.0.1::1

Key Takeaways

  • IPv4 uses 32-bit addresses (4.29 billion total). IANA exhausted its allocation pool in February 2011.
  • IPv6 uses 128-bit addresses providing 340 undecillion unique addresses — enough for every device on Earth for the foreseeable future.
  • RFC 1918 defines 3 private IPv4 ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These are not routable on the public Internet.
  • NAT maps private IPs to a shared public IP using port numbers. PAT supports over 65,000 concurrent connections per public IP.
  • DHCP assigns IPs automatically using 4 steps (DORA). Leases expire and must be renewed, typically every 24 hours on home networks.
  • The loopback address is 127.0.0.1 for IPv4 and ::1 for IPv6. Traffic sent to loopback never leaves the device.

What is an IP address in simple terms?

An IP address is a unique number assigned to every device on a network that identifies its location so data can be delivered to it. IPv4 addresses look like 192.168.1.1; IPv6 addresses look like 2001:db8::1.

What is the difference between IPv4 and IPv6?

IPv4 uses 32-bit addresses (4.29 billion total, now exhausted). IPv6 uses 128-bit addresses (340 undecillion). IPv6 eliminates the need for NAT, has a simplified fixed-size header, and includes SLAAC for automatic configuration.

What is a private IP address?

A private IP address is from one of the 3 RFC 1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) and is not routable on the public Internet. NAT at the router translates private addresses to a public IP for Internet access.

What does DHCP do?

DHCP automatically assigns an IP address, subnet mask, default gateway, and DNS server to a device when it joins a network. The assignment is called a lease, typically valid for 24 hours on home networks before renewal.

What is the loopback IP address?

The loopback address is 127.0.0.1 for IPv4 and ::1 for IPv6. Traffic sent to the loopback address is processed within the device’s network stack and never transmitted to a physical network interface.

Last Thoughts on IP Addresses

IP addresses are the foundation of all Internet and network communication. IPv4’s 4.29 billion address space, exhausted at the IANA level in 2011, is extended by NAT but not replaced by it. IPv6’s 340 undecillion addresses eliminate NAT dependency and support end-to-end connectivity.

DHCP automates assignment for most devices; static addresses remain standard for servers and infrastructure. Understanding the distinction between public and private addresses, and the role NAT plays at the network boundary, is essential for network configuration, troubleshooting, and security planning.

Nizam Ud Deen

Nizam Ud Deen is the founder of theCoreiTech, a tech-focused platform dedicated to simplifying the world of computers, hardware, and digital innovation. With nearly a decade of experience in digital marketing and IT, Nizam combines strategic marketing insight with deep technical understanding. As a passionate entrepreneur, he has built multiple successful digital products and online ventures, helping bridge the gap between technology and everyday users. His mission through theCoreiTech is to empower readers to make informed decisions about computers, hardware, and emerging tech trends through clear, data-driven, and actionable content.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button