What an IP address is and what it is used for
FundamentalsIPLevel: Beginner

What Is an IP Address and What Is It Used For?

The foundation of any network: what an IP address is, how it works, and why it is essential for devices to communicate.

Networking fundamentalsCIDR → HostsSubnetting guide

An IP address is one of those concepts everyone mentions when talking about networks, but it can sound confusing at first. The underlying idea is actually very simple: an IP address identifies a device within a network.

Just as a postal address tells you which house should receive a letter, an IP address tells network data which device it needs to reach.

Without IP addresses, devices would not be able to communicate with one another.

What is an IP address used for?

An IP address mainly serves two purposes:

  1. Identify a device within a network. Each device needs a unique IP address to avoid conflicts.
  2. Allow data to reach the correct destination. Every IP packet includes a source IP and a destination IP.
Thanks to IP addresses, the network knows who is sending, who is receiving, and where replies should go.

How an IP address works: the key idea

Imagine a network as a building:

  • The network is the building
  • The devices are the apartments
  • The IP address is each apartment number
  • The router is the exit from the building

Devices inside the same network can communicate with one another because they belong to the same “building.”

IPv4 and IPv6

IPv4

This is the classic format and is still widely used on local networks. It uses four numbers from 0 to 255 separated by dots.

192.168.1.25

IPv6

This is a newer and much longer format created to solve IPv4 address exhaustion.

2001:0db8:85a3:0000:0000:8a2e:0370:7334
For learning networking fundamentals and basic subnetting, IPv4 is easier to visualize.

Public and private IP addresses

Private IP address

This is the IP address a device uses inside a local network. It is not directly visible from the public internet.

192.168.x.x
10.x.x.x
172.16.x.x – 172.31.x.x

Public IP address

This is the address your internet provider assigns to your router or internet connection. It is the address visible from outside the local network.

A whole local network commonly reaches the internet through a single public IP address thanks to NAT.

Subnet mask

An IP address is usually paired with a subnet mask or CIDR prefix, which indicates which part identifies the network and which part identifies hosts.

192.168.1.25/24
  • Network: 192.168.1.0/24
  • Hosts: 192.168.1.1 – 192.168.1.254
  • Broadcast: 192.168.1.255

Gateway

The gateway is the IP address of the device that connects your network to other networks, usually the router.

192.168.1.1
If the destination is outside your local network, packets are sent to the gateway.

How IP addresses are assigned

DHCP

The router or DHCP server assigns IP addresses to devices automatically. This is the usual setup on home networks.

Static IP

The address is configured manually and is often used for servers, printers, or devices that should keep the same IP address.

Real home-network example

Network: 192.168.1.0/24
Router: 192.168.1.1
PC: 192.168.1.20
Phone: 192.168.1.30
TV: 192.168.1.40

Inside the network, devices can communicate directly. To reach the internet, they send packets to the router.

Final summary

An IP address identifies devices and allows data to reach the correct destination.
  • Private IP: used inside the local network
  • Public IP: used toward the internet
  • The subnet mask and gateway complete the basic IP configuration

Understanding this clearly is the first step toward mastering subnetting, routing, and computer networks in general.