IP Address Basics – Everything You Need to Know

IP addresses are the foundation of how the internet works. This guide covers everything from the basics to subnetting, helping you understand how devices communicate online.

Quick Answer

An IP address is a unique number assigned to every device connected to the internet. It works like a mailing address – it tells data where to go. IPv4 addresses look like 192.168.1.1 (four numbers), while IPv6 addresses are longer hex strings. Every device needs one to communicate online.


What Is an IP Address?

IP stands for “Internet Protocol.” An IP address is the unique identifier for a device on a network, enabling that device to send and receive data.

Think of it like a phone number: when you make a call, the phone system needs to know which device to connect you to. Similarly, when you request a webpage, the internet needs to know where to send the response.

Key Characteristics

  • Unique: No two devices on the same network can have the same IP
  • Numerical: Made up of numbers (and hex characters in IPv6)
  • Hierarchical: Organized to allow efficient routing
  • Essential: Required for any internet communication

IPv4 Explained

IPv4 (Internet Protocol version 4) is the original and still most widely used IP format.

Format

Four numbers (0-255) separated by dots:

192.168.1.1
10.0.0.254
172.16.50.100

Structure

Each number is called an “octet” (8 bits). A complete IPv4 address is 32 bits:

192.168.1.1 = 11000000.10101000.00000001.00000001

Total Addresses

IPv4 allows for about 4.3 billion unique addresses (2³²). This seemed like plenty in the 1980s, but with billions of devices now online, we’ve essentially run out of public IPv4 addresses.

Special Addresses

  • 0.0.0.0: “This network” or “any interface”
  • 127.0.0.1: Localhost (your own computer)
  • 255.255.255.255: Broadcast to all devices on network

IPv6 Explained

IPv6 was created to solve the IPv4 address shortage. It provides essentially unlimited addresses.

Format

Eight groups of four hexadecimal characters separated by colons:

2001:0db8:85a3:0000:0000:8a2e:0370:7334

Shortened by removing leading zeros and consecutive zero groups:

2001:db8:85a3::8a2e:370:7334

Total Addresses

IPv6 is 128 bits, allowing for 340 undecillion addresses (2¹²⁸). That’s enough for every atom on Earth to have billions of IP addresses.

Adoption Status

IPv6 adoption is growing but IPv4 still dominates. Most systems support both (dual-stack). Major websites and ISPs increasingly support IPv6.


Public vs Private IP Addresses

Public IP Addresses

Assigned by your ISP. Unique across the entire internet. This is what websites see when you connect.

Your home typically has one public IP shared by all devices via NAT (Network Address Translation).

Private IP Addresses

Used within local networks. Can be reused across different networks (your 192.168.1.5 and your neighbor’s 192.168.1.5 are different devices).

Reserved private ranges:

RangeAddressesTypical Use
10.0.0.0 – 10.255.255.25516.7 millionLarge organizations
172.16.0.0 – 172.31.255.2551 millionMedium networks
192.168.0.0 – 192.168.255.25565,536Home networks

Private addresses cannot be reached directly from the internet – your router performs NAT to translate between public and private addresses.


Static vs Dynamic IP Addresses

Dynamic IP (DHCP)

Assigned automatically by DHCP (Dynamic Host Configuration Protocol). Most home connections use dynamic IPs.

How it works:

  1. Device connects to network
  2. Device asks DHCP server for an IP
  3. Server assigns an available IP with a “lease” time
  4. When lease expires, process repeats (may get same or different IP)

Advantages: Automatic, no configuration, efficient use of addresses

Disadvantages: IP can change, harder to run servers or set up port forwarding

Static IP

Manually configured and never changes (unless you change it).

When to use:

  • Running a web server
  • Port forwarding for remote access
  • Network printers
  • Security cameras
  • Any device others need to find consistently

Advantages: Consistent address, easier to manage specific devices

Disadvantages: Manual setup, risk of IP conflicts if configured wrong


How ISPs Assign IP Addresses

ISPs receive large blocks of IP addresses from Regional Internet Registries (RIRs). They then assign individual addresses or smaller blocks to customers.

For Home Users

  • Usually one dynamic public IP per household
  • IP may change periodically (hours to months)
  • Static IP available for extra cost

For Businesses

  • Often assigned a block of static IPs
  • More expensive plans
  • Required for hosting services

CGNAT (Carrier-Grade NAT)

Due to IPv4 shortage, some ISPs (especially mobile carriers) use CGNAT – multiple customers share one public IP. This can cause issues with gaming, hosting, and some VPN protocols.


Subnet Basics

A subnet (subnetwork) divides a larger network into smaller segments. This improves security, performance, and organization.

Subnet Mask

Defines which part of an IP address is the network and which is the host.

Common home network:

IP Address: 192.168.1.100
Subnet Mask: 255.255.255.0
Network: 192.168.1.x (first 3 octets)
Host: .100 (last octet)

All devices with IPs in 192.168.1.x are on the same subnet and can communicate directly.

CIDR Notation

A shorthand for subnet masks:

  • /24 = 255.255.255.0 (256 addresses)
  • /16 = 255.255.0.0 (65,536 addresses)
  • /8 = 255.0.0.0 (16.7 million addresses)

Example: 192.168.1.0/24 means the network includes 192.168.1.0 through 192.168.1.255

Gateway

The gateway (usually your router) connects your subnet to other networks. For home networks, this is typically 192.168.1.1 or 192.168.0.1.


Frequently Asked Questions

What happens if two devices have the same IP?

This creates an “IP conflict.” Both devices will have connectivity problems – data sent to that IP won’t consistently reach either device. DHCP normally prevents this, but it can happen with manual configuration mistakes.

Why is my IP address different from my friend’s on the same network?

You each have different private IPs on the local network, but you share the same public IP. When either of you accesses the internet, websites see the same public IP. The router uses NAT to direct responses to the correct device.

Can I run out of private IP addresses?

A typical home network (192.168.1.x with /24 mask) can have 254 devices. That’s plenty for most homes. If you somehow needed more, you could use a different subnet or a larger range like 10.x.x.x.

Why haven’t we completely switched to IPv6?

Backwards compatibility. IPv4 and IPv6 aren’t directly compatible – devices need to support IPv6, networks need upgrading, and some applications need updates. NAT and CGNAT have extended IPv4’s life. The transition is happening but takes time.

What’s 127.0.0.1 (localhost)?

127.0.0.1 is the “loopback” address – it always refers to the current device. It’s used for testing and for services running on your own computer. When you access localhost, you’re talking to yourself.


Summary

  • IP addresses are unique identifiers for devices on networks
  • IPv4 (192.168.1.1) is the common format; IPv6 (2001:db8::1) is the future
  • Public IPs are internet-visible; private IPs are for local networks
  • Dynamic IPs change automatically; static IPs stay fixed
  • Subnets divide networks; NAT allows multiple devices to share one public IP
  • Most users never need to manually configure IPs – DHCP handles it

Related Guides