What Is an IP Address? IPv4, IPv6, and How Addressing Works
Every device on the internet has an IP address. Learn the difference between IPv4 and IPv6, public and private addresses, how DHCP assigns them, and what NAT does to conserve them.
What Is an IP Address?
An IP address (internet [protocol](/learning-center/what-is-TCP-ip-the-internets-core-protocol) address) is a numerical label assigned to every device connected to a network that uses the Internet Protocol. It serves two purposes:
- Identification: Who is this device?
- Location: Where is this device in the network?
Just as a postal address identifies a building and its location, an IP address identifies a device and its position in the network hierarchy. Routers use IP addresses to forward packets from source to destination across multiple networks.
IPv4 Addresses
IPv4 is the fourth version of the internet [protocol](/learning-center/what-is-TCP-the-internets-core-protocol)-ip-the-internets-core-protocol), introduced in 1983 and still the most widely used today. An IPv4 address is 32 bits long, written as four decimal numbers separated by dots:
192.168.1.100Each number is an octet (8 bits), ranging from 0 to 255. There are 2^32 = approximately 4.3 billion possible IPv4 addresses.
IPv4 Address Classes (Historical)
The original design divided IPv4 into classes:
| Class | Range | Default Mask | Typical use | |---|---|---|---| | A | 0.0.0.0 to 127.255.255.255 | /8 | Very large organisations | | B | 128.0.0.0 to 191.255.255.255 | /16 | Medium organisations | | C | 192.0.0.0 to 223.255.255.255 | /24 | Small networks | | D | 224.0.0.0 to 239.255.255.255 | N/A | Multicast | | E | 240.0.0.0 to 255.255.255.255 | N/A | Reserved/experimental |
Classful addressing is largely obsolete — CIDR-subnets-and-cidr-explained) (Classless Inter-domain-kerberos-directory-services-explained) [Routing](/learning-center/what-is-the-network-layer-osi-model-layer-3)) replaced it for more flexible allocation.
Special IPv4 Addresses
| Address / Range | Purpose | |---|---| | 127.0.0.0/8 (127.0.0.1 typical) | Loopback — refers to the local device itself | | 0.0.0.0 | Unspecified / "any address" | | 255.255.255.255 | Limited broadcast-address-resolution-protocol-explained) (all devices on local network) | | 10.0.0.0/8 | private network-network-address-translation-explained) (RFC 1918) | | 172.16.0.0/12 | private network-network-address-translation-explained) (RFC 1918) | | 192.168.0.0/16 | private network-network-address-translation-explained) (RFC 1918) — home router addresses | | 169.254.0.0/16 | APIPA — auto-assigned when DHCP fails |
APIPA (Automatic private [IP](/learning-center/what-is-NAT-network-address-translation-explained) Addressing): If a device cannot reach a [DHCP server](/learning-center/what-is-dhcp-dynamic-host-configuration-protocol-explained), it self-assigns an address in the 169.254.x.x range. This allows limited local communication but no internet access.
Public vs Private IP Addresses
Private IP Addresses
Used within private networks (homes, offices). Not routable on the public internet. Routers use NAT to translate private addresses to a public [IP](/learning-center/what-is-nat-network-address-translation-explained) before traffic leaves the local network.
Public IP Addresses
Globally unique addresses assigned by ISPs, routable on the internet. Your home router-network-address-translation-explained) has one public [IP](/learning-center/what-is-nat-network-address-translation-explained) address shared by all devices on your home network (via NAT).
[Laptop 192.168.1.10] ─┐
[Phone 192.168.1.11] ─┤── [Router NAT] ──── [Public IP: 203.0.113.5] ──── Internet
[TV 192.168.1.12] ─┘How IP Addresses Are Assigned
Static IP
Manually configured — always the same address. Used for servers, printers, and network devices that need a predictable address.
Dynamic IP
Assigned automatically by a [DHCP server](/learning-center/what-is-dhcp-dynamic-host-configuration-protocol-explained) (Dynamic Host Configuration Protocol) each time the device connects. Most home devices use dynamic addresses. DHCP leases are temporary — the address may change when the lease expires.
DHCP Process (DORA)
- Discover: Client broadcasts "I need an IP address"
- Offer: [DHCP server](/learning-center/what-is-dhcp-dynamic-host-configuration-protocol-explained) offers an available IP address
- Request: Client accepts the offer
- Acknowledge: Server confirms the lease
IPv6: The Solution to Address Exhaustion
IPv4 address exhaustion was declared complete by IANA in 2011 — all address blocks were assigned to Regional Internet Registries. IPv6 provides the solution.
An IPv6 address is 128 bits long, written as eight groups of four hexadecimal digits:
2001:0db8:85a3:0000:0000:8a2e:0370:7334Shortened notation rules:
- Leading zeros in each group can be dropped:
2001:db8:85a3:0:0:8a2e:370:7334 - One or more consecutive all-zero groups can be replaced by
::(only once):2001:db8:85a3::8a2e:370:7334
IPv6 provides 2^128 ≈ 340 undecillion addresses — enough for billions of addresses per person on Earth.
Special IPv6 Addresses
| Address | Purpose | |---|---| | ::1 | Loopback (equivalent to 127.0.0.1) | | :: | Unspecified address | | fe80::/10 | Link-local (automatically configured, not routed) | | 2001:db8::/32 | Documentation examples (never used in production) | | fc00::/7 | Unique local (equivalent to RFC 1918-network-address-translation-explained) private ranges) | | 2000::/3 | Global unicast (public internet addresses) |
IPv4 vs IPv6
| Feature | IPv4 | IPv6 | |---|---|---| | Address size | 32 bits | 128 bits | | Address count | ~4.3 billion | ~340 undecillion | | Format | Decimal, dot-separated | Hexadecimal, colon-separated | | Header size | Variable (20-60 bytes) | Fixed 40 bytes | | NAT required | Yes (to compensate for exhaustion) | No (vast space) | | Built-in security | Optional (IPsec-how-virtual-private-networks-work)) | Mandatory (IPsec) | | Configuration | Manual or DHCP | Auto-configuration (SLAAC) |
IP Address and Security
- IP geolocation: Your IP address reveals your approximate location (city/region level) and your ISP. VPNs replace your public IP-network-address-translation-explained) with the VPN server's IP.
- IP reputation: threat intelligence-security-operations-centre-SIEM-incident-response-explained) databases track IP addresses associated with spam, malware, or scanning. Firewalls use these blocklists.
- IP spoofing: Forging the source IP in packets — used in DDoS amplification attacks. Egress filtering at ISPs is the main defence.
- Dynamic IPS and anonymity: Changing your IP does not guarantee anonymity — ISPs keep logs mapping IPs to subscribers at any given time.
Summary
- An IP address is a numerical label that identifies a device and its network location
- IPv4 uses 32-bit addresses (4.3 billion total); IPv6 uses 128-bit addresses (virtually unlimited)
- private [IP](/learning-center/what-is-NAT-network-address-translation-explained) addresses (10.x, 172.16-31.x, 192.168.x) are used on internal networks and translated via NAT for internet access
- DHCP dynamically assigns IP addresses; static IPS are manually configured
- IPv6 was designed to solve IPv4 exhaustion and is increasingly deployed alongside IPv4