A label for finding devices
Every device that communicates over the internet or a local network needs some way to be identified so that data can be delivered to the right place. That identifier is an IP address, where IP stands for Internet Protocol. It works a little like a postal address: data is sent to it, and the network uses it to work out how to get there.
What an address looks like
The most familiar format, IPv4, is four numbers separated by dots, each from 0 to 255, such as 203.0.113.25. (That example comes from a range reserved for documentation, so it does not belong to a real device.) Under the surface, the address is a 32-bit binary number, and each of the four numbers represents 8 bits. With 32 bits there are about 4.3 billion possible combinations, which turned out not to be enough. The newer format, discussed in the article on IPv6 addresses, uses much longer addresses written in hexadecimal with colons.
Parts of an address
An address is generally split into two parts: a network portion, identifying the network a device belongs to, and a host portion, identifying the device within that network. A value called a subnet mask, or a slash notation such as /24, states where the split falls. Routers use the network portion to decide where to forward packets, which is what makes routing across a huge network practical. They do not need to track every device individually.
Public and private addresses
Not every address is visible on the wider internet.
- Public addresses are unique across the internet and can be reached from outside, subject to firewalls and other rules. Internet service providers receive blocks of them and assign them to customers.
- Private addresses are reserved for use inside local networks. Several ranges are set aside for this, including those starting with
10., those from172.16.to172.31., and those starting with192.168.. The same private address can appear in countless homes at once because these addresses are never routed across the public internet.
A typical home has one public address assigned to the router, and each device inside gets a private one, often something like 192.168.1.23.
How many devices share one connection
The technique that makes this possible is network address translation, or NAT. When a laptop sends a request to a website, the router replaces the laptop’s private address with the household’s public address and remembers which internal device made the request. When the reply arrives, the router passes it back to the right device. To the outside world, all the traffic appears to come from one address.
NAT helped extend the life of IPv4 by letting many devices share a single public address. A side effect is that unsolicited incoming connections generally cannot reach devices inside the network unless the router is set up to allow them, which gives incidental protection, though it should not be mistaken for a complete security system.
How devices get their addresses
Most devices do not have addresses set by hand. A protocol called DHCP (Dynamic Host Configuration Protocol) handles it automatically. When a phone joins your Wi-Fi, it asks for an address, and a DHCP server, usually built into the router, hands one out for a limited period called a lease. The lease may be renewed, and the same device often keeps the same address, though that is not guaranteed.
- Dynamic addresses are assigned temporarily and may change.
- Static addresses are fixed, set manually or reserved by the router for a specific device. They are useful for printers, servers or anything that others need to find reliably.
Providers commonly give homes a dynamic public address that can change over time. Businesses often pay for a static one.
Special addresses
127.0.0.1, also called localhost, always refers to the device itself. Developers use it to test software on their own machine.- Addresses starting with
169.254.are self-assigned when a device cannot reach a DHCP server. Seeing one usually signals a connection problem on the local network. - Broadcast and multicast addresses are used to reach many devices at once.
Names versus numbers
People rarely type addresses. They use names, and the domain name system translates names into addresses behind the scenes. You can still reach many sites by entering their numeric address directly, but it is harder to remember, and some sites sharing one address would not respond properly.
What an address reveals
A website you visit can see the public address your traffic comes from. From it, it is often possible to estimate the general location, such as a country or city, and the internet provider. It generally cannot pinpoint your home or give your name. Providers know which customer had which address at a given time, and records may be requested through legal processes, subject to local law.
An address alone is not a full identity, but combined with other data such as browser cookies, it can contribute to tracking. A VPN or similar service replaces your visible address with the provider’s, which changes who can see what rather than making you invisible. Location tracking on phones usually relies on far more precise sources than the address.
Finding yours
Your device’s network settings show your local, private address. To see your public address, you can use one of many websites that report the address a request arrived from. If you use a VPN or a mobile network, the result may differ from what you expect.
Why the address system matters
Without a shared system of numeric addresses, packets could not be routed between independent networks. Everything built on top, from websites to video calls, depends on this simple labeling idea, even though most people never see it.