Network & delivery
9 min readUpdatedWhat is an IP address? IPv4, IPv6, public and private addresses explained
Quick answer
An IP address is the number that identifies a network interface so the Internet Protocol can deliver packets to it. IPv4 addresses are 32 bits, written as four numbers such as 203.0.113.7; IPv6 addresses are 128 bits, written in hexadecimal such as 2001:db8::7. Public addresses are unique on the internet and come from IANA, the regional registries and ISPs; private ones work only inside a local network. An address reveals the network and rough location, not the person.
01What is an IP address?
An IP address is a number that identifies a network interface on a network that uses the Internet Protocol (IP). Every packet carries two of them in its header, a source and a destination. Routers forward the packet hop by hop by looking only at the destination, and the reply travels back to the source, which is why a server always learns the address a request came from.
The Internet Protocol is the shared delivery layer of the internet, defined for version 4 in RFC 791 (September 1981) and for version 6 in RFC 8200. It is deliberately simple: it addresses and forwards packets but promises neither delivery nor order. TCP and UDP run on top of it, as TCP vs UDP explains, and it sits at layer 3 of the OSI model, the Internet layer of the TCP/IP model.
Strictly, an address belongs to an interface, not to a device. A laptop with Wi-Fi and Ethernet has at least two, a server can hold hundreds, and one public address can stand for every device behind a home router.
02IPv4 vs IPv6: what is the difference?
IPv4 addresses are 32 bits long, which allows 4,294,967,296 addresses (2^32), written as four decimal numbers from 0 to 255. IPv6 addresses are 128 bits long, written as eight groups of four hexadecimal digits; RFC 5952 drops leading zeros and shortens the longest run of zero groups to ::, so 2001:0db8:0000:0000:0000:0000:0000:0007 becomes 2001:db8::7.
They are separate protocols, so an IPv4-only host cannot talk to an IPv6-only host without a translator, and most networks run both side by side (dual stack). IPv6 has now passed a milestone: on 28 March 2026, 50.10% of users reaching Google did so over native IPv6, the first time the share passed half, as the Internet Society's Pulse reported.
| IPv4 | IPv6 | |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Number of addresses | 4,294,967,296 (2^32) | About 3.4 × 10^38 (2^128) |
| Written as | 203.0.113.7 | 2001:db8::7 |
| Header | 20 bytes minimum, longer with options | 40 bytes fixed, options in extension headers |
| Usual LAN size | /24: 254 hosts | /64: 64-bit interface IDs (RFC 4291) |
| Address sharing | Common: NAT at home, carrier-grade NAT at ISPs | Rarely needed |
| Private range | 10/8, 172.16/12, 192.168/16 (RFC 1918) | fc00::/7 unique local (RFC 4193) |
03Public vs private IP addresses
A public address is globally unique and routed on the internet; a private address is valid only inside one network and is never routed between networks. RFC 1918 (February 1996) reserved three IPv4 blocks for private use so that every home and office can reuse them, and a router performing network address translation (NAT) rewrites outgoing packets to its single public address.
Two blocks are often mistaken for private space. 100.64.0.0/10 is shared address space for carrier-grade NAT (RFC 6598): if your router's WAN side shows an address from it, your ISP shares public addresses between many customers, and connections started from the internet cannot reach you directly. The documentation ranges from RFC 5737 and RFC 3849 exist so that examples, like the ones on this page, never point at a real host.
Loopback, link-local, IPv6 unique local and the other special-purpose blocks, with the ones an edge should filter, are listed in private IP address ranges.
| Range | Purpose | Reachable from the internet? |
|---|---|---|
| 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 | Private networks (RFC 1918) | No |
| 100.64.0.0/10 | Carrier-grade NAT between ISP and customer (RFC 6598) | No |
| Other space allocated by a registry | Public unicast | Yes, if routed and not filtered |
04How do I find my IP address?
There are two answers, and they usually differ. Your public address is the one websites see: the IP and ASN lookup shows it, with the network and prefix it belongs to. Your local address is the one your device holds on the home or office network, usually from a private range, and the operating system shows it.
If the two differ, a router is translating addresses, which is normal. If the lookup places you in another country, you are probably behind a VPN, a corporate proxy or a mobile carrier's gateway, and the address belongs to that exit.
# Linux: every interface and its addresses, one line each
ip -brief address show
# Linux: the source address and gateway used for an internet destination (sends nothing)
ip route get 192.0.2.1
# Linux: global IPv6 addresses only
ip -6 address show scope global
# Windows: addresses, subnet masks, gateways and DNS servers
ipconfig /all05Who assigns IP addresses?
Addresses are handed down a chain. IANA, whose functions are performed by PTI under ICANN, allocates large pools to the five regional internet registries: AFRINIC, APNIC, ARIN, LACNIC and the RIPE NCC. They allocate to members, mostly ISPs, hosting companies and large organisations, which assign addresses to customers. A device then gets one from the network it joins, by DHCP on IPv4 or, on IPv6, usually by building its own from the prefix the router advertises.
Holding addresses is separate from routing them. A network announces its blocks with BGP under its autonomous system number, and the registries record who holds each block, which is how lookup tools find the operator behind an address.
The dates that shaped today's address supply:
- September 1981: RFC 791 defines IPv4 and its 32-bit address
- February 1996: RFC 1918 reserves the private ranges
- December 1998: IPv6 is specified in RFC 2460, revised as RFC 8200 in July 2017
- 3 February 2011: IANA's free IPv4 pool runs out and its last five /8 blocks go one to each registry
- April 2012: RFC 6598 sets aside 100.64.0.0/10 for carrier-grade NAT
- 25 November 2019: the RIPE NCC makes its last regular IPv4 allocation and moves to a waiting list
- 28 March 2026: IPv6 passes 50% of users reaching Google for the first time
06What does an IP address reveal about you?
Less than most people fear. An address reliably identifies its network and usually the country, but not a person or a street address. MaxMind, a large geolocation provider, puts country-level accuracy above 99%, state or province level at 55% to 80% and city level typically at 20% to 75%, depending on the country and the type of connection.
Sharing is the other limit. Behind a home router every device shows the same public IPv4 address, and behind carrier-grade NAT or a VPN thousands of unrelated users can. IPv6 makes addresses more individual, which is why operating systems create temporary, rotating addresses for outgoing connections (RFC 8981).
| Question | Can the address answer it? | Why |
|---|---|---|
| Which network or provider is this? | Yes | Registry records and BGP tie every routed prefix to an operator and an ASN |
| Which country? | Usually | Above 99% at country level by MaxMind's figures, VPNs aside |
| Which city? | Sometimes | Typically 20% to 75%, better in large cities on residential broadband |
| Who is the person? | No | Only the network operator's records link an address at a given time to a customer |
| Which device in the household? | No | NAT puts every device behind one public address |
| One user or many? | Not reliably | Carrier NAT, VPN exits, offices and universities share addresses |
| Is it a VPN? | Sometimes | Known exit ranges can be listed, but new or residential exits look ordinary |
07How IP addresses are grouped into networks
Every address has two parts: a network prefix shared by all hosts on the same network, and a host part unique within it. The number after the slash in 192.168.1.10/24 says how many leading bits are network, and a subnet mask writes the same boundary in dotted form. Routers on the internet only look at prefixes, which is why the smallest block that travels reliably in BGP, the /24, matters to anyone who wants their own addresses routed.
| Topic | What it answers | Read |
|---|---|---|
| Subnet masks and CIDR | How a mask splits network and host bits; cheat sheet; wildcard masks | What is a subnet mask? |
| The /24 block | Why 255.255.255.0 holds 254 hosts and is the smallest prefix routed globally | The /24 subnet mask |
| Subnet arithmetic | Network, broadcast and host range for any IPv4 prefix | Subnet calculator |
| Who runs an address | ASN, operator, prefix and country of any IP | IP and ASN lookup |
| Autonomous systems | What ASNs are and how to find the one behind an IP | What is an ASN? |
| Routing | How networks announce their prefixes to each other | What is BGP? |
| One address, many sites | How a single IP is served from many locations | What is anycast? |
08Why IP addresses matter in DDoS attacks
Network floods are aimed at an address, not at a domain name. Once attackers know a server's public IP, they can send traffic straight to it and bypass anything placed in front of the website, which is why sites behind a proxy keep the origin address private: see how to hide your origin IP.
Source addresses are a weaker clue than they look. In direct UDP floods the source is often forged, and in reflection attacks the packets come from innocent third-party servers, so blocking either can hit an innocent party. In a botnet-driven DDoS attack the real sources number in the thousands, many of them home connections behind shared addresses. Filtering therefore has to look at traffic patterns, not only at address lists.
Questions
Frequently asked questions
Sources
Sources and verification
The Linux commands were run with iproute2 6.1.0 inside an isolated network namespace, and the address classifications checked with Python 3.11's ipaddress module, on Debian 12, October 2026. The Windows command was not run.
- 01RFC 791: Internet Protocol · RFC Editor
- 02RFC 8200: Internet Protocol, Version 6 (IPv6) Specification · RFC Editor
- 03RFC 5952: A Recommendation for IPv6 Address Text Representation · RFC Editor
- 04RFC 4291: IP Version 6 Addressing Architecture · RFC Editor
- 05RFC 1918: Address Allocation for Private Internets · RFC Editor
- 06RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space · RFC Editor
- 07RFC 4193: Unique Local IPv6 Unicast Addresses · RFC Editor
- 08RFC 5737: IPv4 Address Blocks Reserved for Documentation · RFC Editor
- 09RFC 3849: IPv6 Address Prefix Reserved for Documentation · RFC Editor
- 10RFC 8981: Temporary Address Extensions for Stateless Address Autoconfiguration in IPv6 · RFC Editor
- 11IANA IPv4 Special-Purpose Address Registry · IANA
- 12Number Resources · IANA
- 13Regional Internet Registries · Number Resource Organization
- 14Free Pool of IPv4 Address Space Depleted (3 February 2011) · Number Resource Organization
- 15IPv4 Run-out · RIPE NCC
- 16The RIPE NCC has run out of IPv4 Addresses (25 November 2019) · RIPE NCC
- 1718 Years Later, IPv6 Reaches Majority · Internet Society Pulse
- 18Understanding IP geolocation accuracy · MaxMind
- 19ipconfig · Microsoft Learn
Last updated