Every device on a network needs an address so that data can reach it. That address is the IP (Internet Protocol) address. Two versions are in use today: IPv4, the original, and IPv6, its much larger successor. This guide explains how IPv4 and IPv6 addresses work, how to read them and how they differ.

What an IP address does
An IP address identifies a device’s network interface and tells routers where to send packets. It works at the network layer, together with TCP or UDP at the transport layer, which is why people often speak of TCP/IP. Read more in the TCP/IP model.
IPv4 addresses
An IPv4 address is 32 bits long, written as four decimal numbers (octets) from 0 to 255, separated by dots, for example 192.168.1.10.

Converting to binary
Each octet is 8 bits with place values 128, 64, 32, 16, 8, 4, 2 and 1. To convert 29, add values until you reach it: 16 + 8 + 4 + 1 = 29, so 29 = 00011101.
Network and host portions
A subnet mask or prefix length splits the address into a network part and a host part. With 192.168.1.10/24, the first 24 bits (192.168.1) identify the network and the last 8 bits identify the host.
Classes and CIDR
Originally, IPv4 used fixed classes:
| Class | First octet | Default mask | Use |
|---|---|---|---|
| A | 1 to 126 | /8 | Very large networks |
| B | 128 to 191 | /16 | Medium networks |
| C | 192 to 223 | /24 | Small networks |
| D | 224 to 239 | — | Multicast |
| E | 240 to 255 | — | Reserved |
Since 1993, the internet has used CIDR (classless inter-domain routing), so networks can have any prefix length, such as /26 or /20. Classes now matter mostly for exams.
Private and special addresses
| Range | Purpose |
|---|---|
| 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 | Private networks (RFC 1918) |
| 127.0.0.0/8 | Loopback (localhost) |
| 169.254.0.0/16 | Link-local; often means DHCP failed |
| 100.64.0.0/10 | Carrier-grade NAT |
Because IPv4 has only about 4.3 billion addresses, most networks use private addresses with NAT to share public ones.
IPv6 addresses
An IPv6 address is 128 bits long, written as eight groups of four hexadecimal digits separated by colons, for example 2001:0db8:0000:0000:0000:ff00:0042:8329.

Shortening rules
- Drop leading zeros in each group:
0db8becomesdb8. - Replace one run of consecutive all-zero groups with
::, but only once per address.
So the example becomes 2001:db8::ff00:42:8329.
Common IPv6 address types
- Global unicast (2000::/3): public addresses.
- Unique local (fc00::/7): private addresses.
- Link-local (fe80::/10): used on a single link; every interface has one.
- Multicast (ff00::/8): one-to-many. IPv6 has no broadcast.
- Loopback:
::1.
IPv4 vs IPv6
| Feature | IPv4 | IPv6 |
|---|---|---|
| Length | 32 bits | 128 bits |
| Format | Dotted decimal | Hexadecimal with colons |
| Address space | About 4.3 billion | About 3.4 × 10³⁸ |
| Configuration | Manual or DHCP | SLAAC, DHCPv6 or manual |
| Broadcast | Yes | No (multicast instead) |
| NAT | Common | Not needed in normal designs |
| Header | Variable length with options | Fixed 40-byte header, extension headers |
Should you use IPv6?
Yes. Major mobile networks, cloud providers and content networks support it, and a large share of internet traffic in India already uses IPv6. Most networks run dual stack, using both versions at once. Remember to apply firewall rules to IPv6 too, because an unfiltered IPv6 path is a common security gap.
Related guides
Sources
Need help with network security? We test routers, firewalls, ACLs and segmentation as part of our VAPT services and hardening audits. Contact us for a quote.
