IP Addresses

What is an IP address and how does it work in a computer network?

An IP address is a numeric label that lets devices find each other on a network. Learn how IPv4 and IPv6 addresses are formatted, assigned, and routed.

On this page
  1. Short answer
  2. What IP addresses look like
  3. How addresses are assigned
  4. The network part and the host part
  5. Private and public addresses
  6. How routing uses the address
  7. Checking your own address

Short answer

An IP address is a numeric label that lets a device send and receive data on a network. Each packet carries a source address and a destination address. Routers read the destination address and forward the packet toward the network that holds it.

What IP addresses look like

  • IPv4: four numbers from 0 to 255, separated by dots, such as 192.168.1.20.
  • IPv6: groups of hexadecimal digits separated by colons, such as 2001:db8::1. The 2001:db8::/32 range is reserved for documentation examples, so you will see it in guides rather than on real devices.

How addresses are assigned

  • Dynamic: a DHCP server hands out an address automatically. Most home and office devices work this way, and the address can change over time.
  • Static: an administrator sets the address by hand. Some servers, printers, and network devices use static addresses so they stay easy to find.
  • Link-local: if a Windows computer cannot reach a DHCP server, it may pick an address in the 169.254.0.0/16 range. Such an address works only on the local link, not beyond it.

The network part and the host part

An IPv4 address has two parts: a network part and a host part. The subnet mask shows where the split falls. With the mask 255.255.255.0, the first three numbers identify the network, and the last number identifies the device. This is often written as /24.

Devices on the same subnet can talk to each other directly. For traffic to anything outside the subnet, a device sends it to its default gateway, which is usually the router.

Private and public addresses

Some IPv4 ranges are reserved for private networks: 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255. A home router usually gives devices private addresses and uses network address translation (NAT) to share one public address with the internet. Public addresses are assigned by internet service providers and regional internet registries.

Whether an address is static or dynamic is a separate question. Someone who wants a fixed public address for a server may ask “can you get a static IP address on cable internet?” because the answer depends on the internet provider.

How routing uses the address

Each router reads the destination address and checks its routing table for the best path. It then forwards the packet to the next hop. This repeats until the packet reaches a device on the same network as its destination. The router is the device described in “what device is used to connect different networks?”

Checking your own address

On Windows, run ipconfig and read the IPv4 Address line. On Linux, run ip addr show and look at the inet line for your network interface. Tools for this are listed in “what are the best networking tools for linux?”

If you want to know whether the address you have is fixed, “how to see if an IP address is static?” covers the checks.

The complete guide to ip addresses

What Is the Unique Identification Number of a Computer on a Network?
Read the guide

Keep exploring

Guides from other topics

All topics →