Computer Basics

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

An IP address (Internet Protocol address) is the numeric label that identifies a device on a network so data can reach it – much like a mailing address for your phone, laptop, or server. It does two jobs at once: it says which device you are (host identification) and how to get there (location addressing). Below: what an IP address looks like, IPv4 versus IPv6, public versus private, static versus dynamic, and how to find your own.

In shortAn IP address is a unique number assigned to every device on a network so routers can deliver data to it. IPv4 is 32-bit (~4.3 billion addresses, e.g. 192.168.1.1); IPv6 is 128-bit (340 undecillion, e.g. 2001:db8::1). Public IPs face the internet; private IPs (RFC 1918) stay inside your network; DHCP hands most of them out automatically.
32-bit
IPv4 address length
~4.3B
IPv4 addresses
128-bit
IPv6 address length
340 undecillion
IPv6 addresses

What Is an IP Address?

An IP address is a unique numeric identifier that lets routers deliver data packets to the correct device on a network:

  • Identifies the device: every computer, phone, server, printer, and IoT sensor that sends or receives data needs at least one IP address.
  • Routes the data: routers read the destination IP and forward each packet hop by hop until it arrives.
  • Two versions in use: IPv4 (the original 32-bit scheme) and IPv6 (the 128-bit replacement); IPv6 now carries roughly 45% of traffic to Google, IPv4 still dominates most networks.
Quick analogyThink of an IP address like a postal address: the network number is the street, the host number is the house. Without it, the network has no way to find your device.

IPv4 Structure and Address Space

An IPv4 address is a 32-bit number written as four decimal octets separated by dots (dotted-decimal), such as 192.168.1.1:

  • Four octets, 0-255 each: every octet is 8 bits, so values run from 0 to 255 (for example 192.168.1.1).
  • ~4.3 billion total: a 32-bit space holds 2^32 = 4,294,967,296 unique addresses.
  • Network + host split: a subnet mask divides the address; a /24 (255.255.255.0) leaves 254 usable host addresses per subnet, written in CIDR as 192.168.1.0/24.

IPv4 Address Exhaustion

IPv4 ran out of fresh addresses because 4.3 billion was never enough for billions of always-on devices:

  • IANA depleted its pool on February 3, 2011; the five Regional Internet Registries have managed only returned or reclaimed blocks since.
  • Regional exhaustion followed: ARIN (North America) emptied its free pool in September 2015; RIPE NCC (Europe) reached its final /22 allocations in November 2019.
  • Two workarounds keep IPv4 alive: NAT (many private devices sharing one public IP) and IPv6 (a practically unlimited space).

IPv6 Structure and Address Space

An IPv6 address is a 128-bit number written as eight groups of four hexadecimal digits separated by colons, such as 2001:0db8:85a3:0000:0000:8a2e:0370:7334:

  • 340 undecillion addresses: 2^128 (3.4 x 10^38) – enough to never realistically run out.
  • Shorthand compression: drop leading zeros and replace one run of all-zero groups with ::, so 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1.
  • :: appears once only: using it twice would make the address ambiguous.

Public vs Private IP Addresses

The split is public IPs are routable on the global internet, while private IPs stay inside your local network:

Public IP

Globally unique and routable, assigned by your ISP from RIR blocks. Every device behind one home router shares the same public IP to the outside world.

Private IP

Defined in RFC 1918, reusable across networks, and dropped by internet routers. Used inside homes and offices; reaches the internet only through NAT.

RFC 1918 reserves three private IPv4 ranges, sized for different networks:

  • 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 is the trick that lets many private devices share a single public IP at the router or firewall:

NAT (Network Address Translation) - What is an IP Address? IPv4, IPv6, and How IP Addressing Works
  • One public IP, many devices: NAT maps internal RFC 1918 addresses to the one public IP your ISP assigns.
  • PAT (port overload): the common form tracks each connection by a unique source port, so a single public IP can carry over 65,000 concurrent connections.
  • Not a firewall: hiding internal IPs adds a little privacy, but NAT does not inspect or filter traffic.

DHCP (Dynamic Host Configuration Protocol)

DHCP is the service that automatically hands devices an IP address (plus subnet mask, gateway, and DNS) when they join a network:

DHCP (Dynamic Host Configuration Protocol) - What is an IP Address? IPv4, IPv6, and How IP Addressing Works
  • No manual setup: without DHCP an admin would configure every device’s IP by hand.
  • Four-step DORA handshake: Discover, Offer, Request, Acknowledge – then the device holds a timed lease (about 24 hours on home routers, up to 8 days in enterprises).
  • Reservations: DHCP can pin the same IP to a device’s MAC address while still using the protocol (static DHCP).

Static vs Dynamic IP Addresses

A static IP is set manually and never changes; a dynamic IP is assigned by DHCP and can change on renewal or reconnect:

  • 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.
Which to usePick static for servers, printers, and gear that must always be reachable at the same address. Leave dynamic (the default) for laptops and phones – it is simpler and conserves public IPs.

Loopback Addresses

A loopback address is a reserved IP a device uses to send traffic to itself for testing and local services:

  • IPv4: 127.0.0.1 (the whole 127.0.0.0/8 range is reserved for loopback).
  • IPv6: ::1.
  • Never leaves the device: loopback traffic is handled inside the network stack and never touches a physical interface.

How to Find Your IP Address

Finding your IP depends on your operating system and whether you need the private (LAN) or public address:

  • 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.
Public vs localThe public IP is the one the internet sees – the NAT exit point at your router or ISP, shared by every device on your connection. The local IP differs per device and is set by your router via DHCP.

IPv4 vs IPv6 Comparison

The table compares IPv4 and IPv6 across address length, format, total size, exhaustion, NAT, auto-configuration, and security:

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

Last Thoughts on IP Addresses

IP addresses are the foundation of all internet and network communication. IPv4’s 4.3 billion address space, exhausted at the IANA level in 2011, is stretched by NAT but not replaced by it; IPv6’s 340 undecillion addresses remove the NAT dependency and restore end-to-end connectivity. DHCP automates assignment for everyday devices, while static addresses stay standard for servers and infrastructure.

For anyone configuring or troubleshooting a network, the levers that matter are the public-versus-private distinction, the role NAT plays at the boundary, and whether an address is static or DHCP-assigned. Get those three straight and most addressing and connectivity problems become easy to reason about.

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.

Frequently Asked Questions (FAQs)

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.

Nizam Ud Deen

Muhammad Nizam Ud Deen Usman is the founder of theCoreiTech and the author of The Local SEO Cosmos. Nizam works as an SEO consultant and content strategy expert with more than a decade of experience in digital marketing and IT, and he also founded ORM Digital Solutions, a digital agency serving medium and large businesses. He holds a degree from the University of Education, Lahore (Multan Campus), and was listed among the top 20 SEO experts in Pakistan in 2024. Nizam started theCoreiTech in 2012 to make computers easier to understand and use for everyone. Connect with Nizam on LinkedIn (seoobserver), X (@SEO_Observer), or at nizamuddeen.com.

Leave a Reply

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

Back to top button