Network & delivery

9 min readUpdated

What 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.

IPv4IPv6
Address length32 bits128 bits
Number of addresses4,294,967,296 (2^32)About 3.4 × 10^38 (2^128)
Written as203.0.113.72001:db8::7
Header20 bytes minimum, longer with options40 bytes fixed, options in extension headers
Usual LAN size/24: 254 hosts/64: 64-bit interface IDs (RFC 4291)
Address sharingCommon: NAT at home, carrier-grade NAT at ISPsRarely needed
Private range10/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.

RangePurposeReachable from the internet?
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16Private networks (RFC 1918)No
100.64.0.0/10Carrier-grade NAT between ISP and customer (RFC 6598)No
Other space allocated by a registryPublic unicastYes, 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.

Finding local addresses (Linux commands run with iproute2 6.1 on Debian 12; the Windows command is from Microsoft's documentation)
# 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 /all

05Who 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).

QuestionCan the address answer it?Why
Which network or provider is this?YesRegistry records and BGP tie every routed prefix to an operator and an ASN
Which country?UsuallyAbove 99% at country level by MaxMind's figures, VPNs aside
Which city?SometimesTypically 20% to 75%, better in large cities on residential broadband
Who is the person?NoOnly the network operator's records link an address at a given time to a customer
Which device in the household?NoNAT puts every device behind one public address
One user or many?Not reliablyCarrier NAT, VPN exits, offices and universities share addresses
Is it a VPN?SometimesKnown 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.

TopicWhat it answersRead
Subnet masks and CIDRHow a mask splits network and host bits; cheat sheet; wildcard masksWhat is a subnet mask?
The /24 blockWhy 255.255.255.0 holds 254 hosts and is the smallest prefix routed globallyThe /24 subnet mask
Subnet arithmeticNetwork, broadcast and host range for any IPv4 prefixSubnet calculator
Who runs an addressASN, operator, prefix and country of any IPIP and ASN lookup
Autonomous systemsWhat ASNs are and how to find the one behind an IPWhat is an ASN?
RoutingHow networks announce their prefixes to each otherWhat is BGP?
One address, many sitesHow a single IP is served from many locationsWhat 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

Not from the address alone. Geolocation databases place most addresses in the right country and many in roughly the right region or city, but not at a street or a household. Linking an address at a particular time to a named customer needs the internet provider's subscriber records, which are not public. What an address does show reliably is the network operator it belongs to.

Often. Many home and mobile connections receive a dynamic address that changes when the router reconnects or its lease runs out, while business lines and servers usually keep a static one. IPv6 devices also create temporary addresses for outgoing connections and replace them regularly. Local private addresses can change too when DHCP hands out a different one, which is why printers and servers get fixed reservations.

A MAC address identifies a network interface on one local link, such as an Ethernet or Wi-Fi segment, and never leaves it, because routers replace the link-layer header at every hop. An IP address stays in the packet from end to end, so the destination can be found across the internet and the reply can return. ARP on IPv4 and neighbour discovery on IPv6 map one to the other locally.

No. 192.168.1.1 is in the private 192.168.0.0/16 block from RFC 1918 and is the default router address on many home networks. Millions of networks use the same address internally without conflict, because private addresses are never routed on the internet. Websites you visit see your router's public address instead, which an IP lookup shows you.

Because most networks run both protocols side by side, a set-up called dual stack. Your device prefers IPv6 when the website offers it and falls back to IPv4 otherwise. The IPv6 address is usually public and specific to your network, while the IPv4 address is usually shared through NAT, so seeing two different public addresses on a lookup page is normal.

On the public internet each address is assigned to one network, although anycast deliberately announces one address from many sites. In separate private networks, yes: every home can use 192.168.1.10. On the same local network a duplicate causes intermittent failures for both devices until one is changed, which is why DHCP servers track their leases and can probe before handing out an address.

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.

  1. 01RFC 791: Internet Protocol · RFC Editor
  2. 02RFC 8200: Internet Protocol, Version 6 (IPv6) Specification · RFC Editor
  3. 03RFC 5952: A Recommendation for IPv6 Address Text Representation · RFC Editor
  4. 04RFC 4291: IP Version 6 Addressing Architecture · RFC Editor
  5. 05RFC 1918: Address Allocation for Private Internets · RFC Editor
  6. 06RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space · RFC Editor
  7. 07RFC 4193: Unique Local IPv6 Unicast Addresses · RFC Editor
  8. 08RFC 5737: IPv4 Address Blocks Reserved for Documentation · RFC Editor
  9. 09RFC 3849: IPv6 Address Prefix Reserved for Documentation · RFC Editor
  10. 10RFC 8981: Temporary Address Extensions for Stateless Address Autoconfiguration in IPv6 · RFC Editor
  11. 11IANA IPv4 Special-Purpose Address Registry · IANA
  12. 12Number Resources · IANA
  13. 13Regional Internet Registries · Number Resource Organization
  14. 14Free Pool of IPv4 Address Space Depleted (3 February 2011) · Number Resource Organization
  15. 15IPv4 Run-out · RIPE NCC
  16. 16The RIPE NCC has run out of IPv4 Addresses (25 November 2019) · RIPE NCC
  17. 1718 Years Later, IPv6 Reaches Majority · Internet Society Pulse
  18. 18Understanding IP geolocation accuracy · MaxMind
  19. 19ipconfig · Microsoft Learn

Last updated