IP Addresses
In short: A logical address that uniquely identifies a device within a network and is used for routing data packets — as IPv4 (32 bits) or IPv6 (128 bits).
In more detail: Unlike the MAC address, which is permanently tied to the hardware, an IP address is logical and can change (e.g. with every connection setup via DHCP). A distinction is made between private addresses (only valid in the local network) and public addresses (unique on the internet).
In Depth
Hierarchical structure instead of fixed hardware binding
The most important difference from the MAC address is the hierarchy: a MAC address is burned into a piece of hardware and carries no information at all about location. An IP address, on the other hand, is structured by network membership — the front part identifies (together with the subnet mask) the network, the back part the specific device within it. It’s precisely this structure that makes routing over long distances practicable at all: a router doesn’t need to know every single address on the internet, only in which direction an entire address range lies — comparable to a postcode, which doesn’t direct post straight to the house but first only roughly into the right region.
192.168.1.42 / 255.255.255.0
└──────┬──────┘ └────┬───┘
network part device part (unique within the network)
Private vs. public addresses
Private address ranges (e.g. 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12) are reserved for use within local networks and may not be routed on the public internet — every home router in the world uses the same private ranges in parallel without conflicts, because only the router’s one public address is visible to the outside (network address translation, NAT, translates between the many internal private addresses and the one external public one). Public addresses, on the other hand, have to be unique worldwide so that a packet can be routed to the right destination at all — they are managed centrally by IANA and allocated regionally to providers.
Static vs. dynamic assignment
Devices get their IP address either statically (entered manually and fixed, common for servers that have to be reachable permanently at the same address) or dynamically via DHCP (common for end devices such as laptops or smartphones that constantly rejoin the network). A dynamically assigned address can change with every new connection or after the lease time expires, which isn’t a problem for most applications, but leads to complications with self-hosted services (which are supposed to be reachable from outside permanently at the same address) — that’s what dynamic DNS services are for, which automatically point a fixed domain at the current, changing IP address.
The path to IPv6
The scarcity of public IPv4 addresses (just over 4 billion in total, with far more internet-capable devices worldwide) is the main reason for IPv6 with its drastically larger address space (340 undecillion addresses). With IPv4, NAT and private address ranges make the problem practically manageable — the regional registries’ official IPv4 address reserves have been exhausted for years, which is why new addresses are now often traded at high prices. In the long term, IPv6, where theoretically every single device worldwide could get its own public address without NAT, is the structural solution, even though the actual switchover has been progressing only sluggishly for decades because of the infrastructure changes required.
See also: IPv4, IPv6, DHCP, MAC addresses, Subnet mask