IP address

On this page 7

An IP address is the numeric identifier of a network interface that the Internet Protocol uses to deliver packets between hosts. In Internet addressing, it serves two functions at once: it identifies the interface and it indicates its location in the routing hierarchy, so routers can forward a packet toward its destination one hop at a time.

Two versions are in use. IPv4 addresses are 32 bits long, giving about 4.3 billion possible values, while IPv6 addresses are 128 bits long, a space large enough to give every subnet its own vast range. Most networks today run both in parallel, an arrangement known as dual stack.

How an IP address is structured

Every IP address splits into a network prefix and a host part. The prefix identifies the network that routers must reach, and the host part identifies the interface inside that network. The boundary is expressed in CIDR notation as a slash and a prefix length, so 192.0.2.10/24 means the first 24 bits name the network and the last 8 bits the host.

IPv4 addresses are written in dotted decimal, four octets from 0 to 255 such as 198.51.100.7. IPv6 addresses are written as eight groups of four hexadecimal digits separated by colons; leading zeros may be dropped and one run of zero groups may be replaced by ::, so 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1.

PropertyIPv4IPv6
Address length32 bits128 bits
NotationDotted decimal, 203.0.113.5Hexadecimal groups, 2001:db8::5
Typical subnet size/24 with 254 usable hosts/64 for every LAN
Header checksumYesNo, left to other layers
Address configurationStatic or DHCPSLAAC, DHCPv6 or static
BroadcastSupportedReplaced by multicast
IPv4 and IPv6 addresses compared

Types of IP addresses by scope and delivery

Not every address is reachable from everywhere. Scope decides where an address is valid, and the delivery model decides how many receivers get a packet. Both are encoded in reserved ranges, so a router knows from the address alone how to treat it.

CategoryIPv4 rangeIPv6 rangeMeaning
Public unicastMost of the space2000::/3Globally routable, unique
Private10/8, 172.16/12, 192.168/16fc00::/7 (unique local)Used inside organizations only
Loopback127.0.0.0/8::1Traffic stays inside the host
Link-local169.254.0.0/16fe80::/10Valid on one network segment
Multicast224.0.0.0/4ff00::/8Delivered to a group of receivers
Shared address space100.64.0.0/10Not applicableCarrier-grade NAT inside ISPs
Important address ranges and their meaning

Most addresses are unicast, meaning one sender and one receiver. Anycast reuses one unicast address at many locations, and routing delivers each packet to the nearest instance, which is how large DNS and CDN services spread load. Multicast sends one stream to every member of a group.

How addresses are assigned and allocated

IP addresses are distributed through a hierarchy of registries. IANA holds the global pool and hands large blocks to the five regional internet registries, which allocate smaller blocks to internet service providers, hosting companies and large organizations. Those holders in turn assign addresses to customers and devices.

On an individual network, a host obtains its address in one of three ways. A static address is configured by hand and suits servers and routers. DHCP leases an address from a pool for a limited time, often hours to days. In IPv6, stateless address autoconfiguration lets a host build its own address from the router-advertised /64 prefix, frequently with randomized privacy addresses that change over time.

Because the IPv4 pool is exhausted at the regional level, new IPv4 space is now obtained mainly through transfer markets and waiting lists, while IPv6 space remains readily available.

Public and private addresses and NAT

Most homes and offices use private IPv4 addresses internally and share one public address toward the internet. A router performing network address translation rewrites outgoing packets so they appear to come from its public address, keeping a table of port mappings to send replies back to the right device.

NAT has conserved IPv4 space for decades, but it breaks end-to-end reachability: devices behind it cannot easily accept incoming connections without port forwarding. When a provider adds a second NAT layer, called CGNAT, even the customer router lacks a public address. IPv6 avoids this by giving every device a globally unique address, with a firewall instead of translation providing protection.

SituationRecommended approachReason
Public web serverStatic public IPv4 and IPv6Stable DNS records and reachability
Office workstationsPrivate IPv4 via DHCP plus IPv6 SLAACSimple management, future-ready
Home network behind CGNATUse IPv6 or a tunnel for inbound accessNo public IPv4 is available
Internal labPrivate or unique local rangesAvoids conflicts with real networks
Choosing an addressing approach

Common misconceptions and pitfalls

An IP address identifies an interface, not a person or a device. A laptop with Wi-Fi and Ethernet has at least two, a server may hold dozens, and many users can share one public address behind NAT. Treating an address as a reliable personal identifier leads to wrong conclusions in logging, licensing and investigations.

  • Geolocation is approximate: databases map ranges to regions, often accurate only to a country or city.
  • Addresses change: dynamic leases and IPv6 privacy addresses rotate, so long-term tracking by address is unreliable.
  • Overlapping private ranges cause conflicts when two networks using 192.168.1.0/24 are joined by a VPN.
  • Hardcoding addresses in applications makes migrations painful; DNS names are the better reference.

Another frequent error is ignoring IPv6 in firewall rules. A host protected only by IPv4 filters may be fully exposed over IPv6 if both stacks are active.

In everyday language

An IP address works like a postal address for network traffic. Every connected device needs one so data can find its way there. When you open a website, your device sends a request to the site’s address. The reply comes back to your address.

Older addresses are short, like 192.0.2.10, and the world has run out of new ones. Newer IPv6 addresses are much longer, so there are enough for every device. Many homes share one public address, and the router sorts out which device gets which reply.

Seen in the real world

A small accounting firm wants staff to reach a file server in the office while working from home. The server has the private address 192.168.10.20, which is not reachable from the internet. The administrator checks the router and finds that its outside address is in 100.64.0.0/10, meaning the provider uses carrier-grade NAT and no port forwarding is possible.

The firm asks the provider for a static public IPv4 address, which costs a small monthly fee, and configures a VPN on the router. The provider also offers a /56 IPv6 prefix, so the administrator enables IPv6 and adds firewall rules for both protocols.

Staff now connect through the VPN to the router’s public address and reach the server by its private address. The remote access works reliably, and the firm has an IPv6-ready network for future services.