An IP address is a unique number assigned to every device on a network so data can be sent to and from the right place. It works like a postal address for the internet: routers use it to forward packets of data across networks until they reach the correct destination.
The Basic Idea: Addressing for Networks
Every device that connects to a network—whether it's a laptop, phone, smart TV, or server—needs an address so other devices can find it. The Internet Protocol (IP) provides that addressing system. When you send an email or load a web page, your data is broken into small packets. Each packet carries the source and destination IP addresses, much like an envelope shows the sender and receiver. Routers read the destination address and pass the packet along the best path toward its goal.
IP addresses come in two main versions: IPv4 and IPv6. IPv4, the older and still most common version, uses 32-bit addresses written as four numbers separated by dots, such as 192.168.1.1. That gives about 4.3 billion possible addresses—a number that seemed huge in the 1980s but has since been exhausted. IPv6 uses 128-bit addresses written as eight groups of hexadecimal digits, like 2001:0db8:85a3:0000:0000:8a2e:0370:7334. This provides an astronomically large address space, enough to give every grain of sand on Earth a unique address many times over.
How IPv4 Addresses Are Structured
An IPv4 address is split into two parts: the network portion and the host portion. The network portion identifies the network the device belongs to, and the host portion identifies the specific device on that network. The boundary between them is defined by the subnet mask, a number that looks like an IP address (e.g., 255.255.255.0). A subnet mask of 255.255.255.0 means the first three numbers (octets) identify the network, and the last octet identifies the host. So in 192.168.1.25 with that mask, the network is 192.168.1.0 and the host is 25.
Subnetting allows a large network to be divided into smaller, more manageable pieces. This improves performance and security by keeping local traffic local and reducing congestion. For example, a company might use one subnet for its office computers and another for its guest Wi-Fi, even though both share the same internet connection.
Public vs. Private IP Addresses
Not all IP addresses are reachable from the internet. Private IP addresses are reserved for use within local networks and are not routed on the public internet. The private address ranges are:
- 10.0.0.0 to 10.255.255.255
- 172.16.0.0 to 172.31.255.255
- 192.168.0.0 to 192.168.255.255
Your home router typically assigns private addresses to your devices, such as 192.168.1.10. The router itself has a public IP address assigned by your internet service provider (ISP), which is how the outside world sees your network. When your device sends data to the internet, the router performs Network Address Translation (NAT), replacing the private source address with its public address. When the reply comes back, the router remembers which internal device made the request and forwards the data accordingly. This is why dozens of devices in a home can share a single public IP address.
How Data Travels: Routing and Packets
When you request a web page, your device creates data packets with the destination IP address of the web server. These packets go to your router, which sends them to your ISP. From there, they hop through a series of routers across the internet. Each router examines the destination address and consults its routing table to decide the next hop. This process repeats until the packet reaches the network where the destination IP resides. The destination device then reassembles the packets into the original data.
Routing is hierarchical. The internet is divided into autonomous systems (ASes), each controlled by an organization such as an ISP or a large company. Border Gateway Protocol (BGP) is the routing protocol that lets these systems exchange information about which IP address ranges they can reach. This is how a router in Tokyo knows how to forward a packet destined for a server in London.
Static vs. Dynamic IP Addresses
IP addresses can be assigned in two ways: statically or dynamically. A static IP address is manually configured and does not change. It's often used for servers that need a consistent address, or for devices like printers that should always be found at the same address. A dynamic IP address is assigned automatically by a DHCP (Dynamic Host Configuration Protocol) server, typically running on your router. Most home and office devices use dynamic addresses because they are easier to manage and conserve addresses. Your ISP may also assign your public IP dynamically, which is why your home IP can change occasionally.
Common Problems and Misconceptions
One common misconception is that an IP address identifies a person. In reality, it identifies a device or network interface at a given time. ISPs can map an IP address to a subscriber, but that requires legal process and is not publicly available. Another misconception is that IP addresses are permanent. As noted, most are dynamic and can change. Also, an IP address does not inherently reveal your physical location beyond a general region. Geolocation databases estimate location based on where blocks of addresses are registered, but they can be inaccurate, especially with VPNs or mobile networks.
IP conflicts occur when two devices on the same network are assigned the same address, causing connectivity issues. This usually happens when a static address is set manually within the range used by DHCP. Resolving it involves identifying the conflicting devices and either changing the static address or adjusting DHCP settings.
Frequently Asked Questions
What is the difference between IPv4 and IPv6?
IPv4 uses 32-bit addresses (about 4.3 billion), while IPv6 uses 128-bit addresses, providing a vastly larger number. IPv6 also simplifies routing and includes built-in security features like IPsec, though both versions can support it.
Can I hide my IP address?
Yes, you can use a VPN (Virtual Private Network) or a proxy server, which routes your traffic through an intermediary, so websites see the intermediary's IP address instead of yours. Tor is another option that provides stronger anonymity.
How do I find my IP address?
On a computer, you can check your network settings; on Windows, run ipconfig in Command Prompt; on macOS or Linux, use ifconfig or ip addr. To find your public IP, visit a website like whatismyip.com. On a phone, look in Wi-Fi settings.
What is a subnet mask?
A subnet mask is a 32-bit number that separates the network portion of an IP address from the host portion. It tells devices which addresses are on the same local network.
Why do IP addresses change?
Dynamic IP addresses are assigned by DHCP and can change when a device reconnects or after a lease period expires. ISPs may also rotate public IPs for operational reasons.
Is an IP address personal data?
Under regulations like the GDPR, an IP address can be considered personal data because it can indirectly identify a person when combined with other information held by an ISP. However, on its own, it identifies a device, not a person.