IP Address

⏱ 7 min read

In one sentence: An IP address is a number that identifies a device on a network, so that packets can be delivered to that device.

Why should I care?

In Packets, you saw that every packet header holds the sender's address and the receiver's address. On the internet, those addresses are IP addresses. "IP" stands for Internet Protocol, one of the protocols of TCP/IP.

Your phone has an IP address whenever it is online. So does every website's computer. When you type a website's name, a system called DNS usually finds that computer's IP address.

Analogy

An IP address is like the postal address of a house. A letter needs the receiver's address, or the post office cannot deliver it. A packet needs the receiver's IP address in the same way.

A name and an address are different things. The IP standard from 1981, called RFC 791, says: "A name indicates what we seek. An address indicates where it is." (An RFC is a public document that describes how a part of the internet works.) A website name like wikipedia.org is a name. An IP address is an address.

Where the analogy breaks down: a house keeps its address for years. A device often gets a new IP address when it joins a different network. One device can also have more than one IP address. And many homes use the same "inside" addresses (more on this below), which no real street would allow.

How it actually works

What an IP address looks like

When people say "IP address", they usually mean an IPv4 address (Internet Protocol, version 4). An IPv4 address is 32 bits long. It is written as four numbers separated by dots, like 192.168.1.10.

32 bits ÷ 4 = 8 bits, so each number is one Byte, between 0 and 255.

How many IPv4 addresses are there? Each extra bit doubles the number of patterns. So 32 bits give 2 × 2 × … × 2 (32 times) = 4,294,967,296 patterns: about 4.3 billion addresses.

Addresses inside every packet

The header of each packet holds two IP addresses: the source address (the sender) and the destination address (the receiver). Routers read the destination address and pass the packet on.

Who hands out the addresses

Addresses on the internet are handed out in steps:

  1. IANA (the Internet Assigned Numbers Authority) organizes IP addresses for the whole world. It gives large blocks (groups) of addresses to five Regional Internet Registries, such as AFRINIC for Africa.
  2. The registries give smaller blocks to organizations such as Internet Service Providers (ISPs): the companies that link your network to the internet.
  3. Your ISP gives your network an address.

Inside a network, a device usually gets its IPv4 address automatically, with a protocol such as DHCP (Dynamic Host Configuration Protocol). DHCP can give an address for a limited time, so your address can change.

Public and private addresses

A document from 1996, RFC 1918, set aside three groups of private addresses, for use inside a home or office network:

  • 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

Private addresses have no meaning on the public internet. Packets with a private address are not meant to travel across the internet. So many networks can reuse the same private addresses.

To reach the internet, the router of your network uses NAT (Network Address Translation). In each packet that leaves your network, it replaces the private address with the network's public address, an address used on the internet. It keeps track of which device sent what, so each answer goes back to the right device. So many devices can share one public address. (This is simplified: an ISP can also share addresses in a similar way.)

Many devices share one public addressIn a home network, a phone with the private address 192.168.1.10 and a laptop with the private address 192.168.1.11 both connect to the home router. The router has one public address and connects to the internet. Websites on the internet see only the router's public address.

Home network (private addresses)

Phone
192.168.1.10

Laptop
192.168.1.11

Router
one public address

The internet
websites see only
the public address

Running out, and IPv6

On 3 February 2011, the Number Resource Organization, the group of the five registries, announced that IANA had no more free IPv4 blocks to give out.

The newer version is IPv6 (Internet Protocol, version 6). An IPv6 address is 128 bits long instead of 32. That gives 2 to the power of 128 addresses: a number with 39 digits. People write IPv6 addresses in base 16 (see Counting Systems: Base 10 and Other Bases), as up to eight groups separated by colons. Each group has one to four base-16 digits (0 to 9 and A to F). Two colons together (::), allowed only once, stand for one or more groups of zeros that were left out. For example: 2001:DB8::8:800:200C:417A. Today, the recommended way is small letters: 2001:db8::8:800:200c:417a.

How it came to be

You do not need to remember these names and numbers. The Internet Protocol, with its 32-bit addresses, was described in RFC 791 in September 1981, edited by Jon Postel. As you saw in ARPANET, the ARPANET switched to TCP/IP on 1 January 1983.

IPv6 was described in RFC 1883, by S. Deering and R. Hinden, in December 1995.

🧪 Try it in your browser

You will see the IP addresses of the computers that send a web page. You need a computer with a keyboard. These steps change nothing.

  1. In Chrome, Edge or Firefox, open a website, for example wikipedia.org.
  2. Open the network tool:
    • Chrome and Edge: press Ctrl + Shift + J (Mac: Cmd + Option + J). This opens the console. Click the tab named Network. In Edge, if you do not see it, click the More tools button and choose Network.
    • Firefox: press Ctrl + Shift + E (Mac: Cmd + Option + E).
  3. The list is empty at first. Reload the page with the browser's reload button. Rows appear. Each row is one file the browser asked for.
  4. Right-click the row of column names at the top of the list. A menu appears.
    • Chrome and Edge: click Remote Address.
    • Firefox: click Remote IP.
  5. What you should see: a new column with an address in each row: the address of the computer that sent that file. It is either four numbers separated by dots (IPv4) or groups separated by colons (IPv6). Rows may differ: a page can come from several computers. If a row is empty or says "unknown", look at another row.
  6. An address may end with a colon and a short number, such as :443. That number is a port: a number for one service on that computer. 443 is the usual port for HTTPS. It is not part of the IP address. An IPv6 address is then put inside square brackets, like [2001:db8::1]:443.
  7. When you are done, close the tab with the website.

Common misunderstandings

  • "My device always has the same IP address." Not usually. It often gets a new address on another network.
  • "Every device on the internet has its own public address." No. With NAT, many devices in one home share one public address.
  • "An IP address and a website name are the same thing." No. DNS translates a website name (a domain name) into an IP address.

Recap

  • An IP address identifies a device on a network. Each packet carries a source and a destination address.
  • IPv4 addresses are 32 bits, written as four numbers from 0 to 255: about 4.3 billion in total.
  • With private addresses and NAT, many devices share one public address. IANA's free IPv4 blocks ran out in 2011; IPv6 uses 128 bits.

Sources

Written with AI · Reviewed by AI · Not yet checked by a human

Found a mistake, or something you did not understand? Report a problem.