IPv4

What is an IPv4 Address? Complete Guide with Classes and Ranges

J Jaspreet Singh July 8, 2025 5 min read
Animated diagram for What is an IPv4 Address? Complete Guide with Classes and Ranges, showing thirty two address bits in four octets with the network and host boundary sliding between a slash 24, a slash 26 and a slash 30

An IPv4 address is a 32-bit number that identifies a device’s network interface. It is written as four decimal numbers separated by dots, 192.168.1.10, where each number is one 8-bit octet with a value from 0 to 255.

Thirty-two bits gives 2³² = 4,294,967,296 possible addresses. That sounded limitless in 1981. It is not, and running out of them is why IPv6 and NAT exist.

The Structure of an IPv4 Address

Every IPv4 address is split into two parts:

  • The network portion, identifies which network the device is on. Every device on the same network shares it.
  • The host portion, identifies the specific device within that network.

What splits them is the subnet mask. In 192.168.1.10/24, the /24 means the first 24 bits are network, so the network is 192.168.1.0 and the host is .10.

Address:  192.168.1.10   = 11000000.10101000.00000001.00001010
Mask /24: 255.255.255.0  = 11111111.11111111.11111111.00000000
                            └──── network ────────┘ └─ host ─┘

Two hosts can only talk directly if their network portions match. If they do not, the traffic goes to the default gateway. This one rule explains most “I set a static IP and now nothing works” problems.

IPv4 Address Classes

The original design divided the address space into classes by the leading bits:

ClassFirst octetDefault maskNetworksHosts per networkIntended for
A1 – 126/8 (255.0.0.0)12616,777,214Very large organisations
B128 – 191/16 (255.255.0.0)16,38465,534Medium organisations
C192 – 223/24 (255.255.255.0)2,097,152254Small networks
D224 – 239MulticastOne-to-many delivery
E240 – 255ReservedExperimental, never deployed

127 is missing from Class A deliberately, the entire 127.0.0.0/8 range is reserved for loopback.

Classes are obsolete, and that matters

Classful addressing was abandoned in 1993 in favour of CIDR (Classless Inter-Domain Routing). The reason: the class sizes were catastrophically wasteful. An organisation needing 300 addresses could not use a Class C (254 hosts), so it was given a Class B, and wasted 65,000 addresses.

CIDR lets the mask sit at any bit boundary, so that organisation gets a /23 (510 hosts) instead. Classes still appear in exams and in default behaviour on some equipment, but no modern network is designed around them.

Private IP Address Ranges

RFC 1918 reserves three ranges that are never routed on the public internet. Anyone can use them internally, which is why 192.168.1.1 is the gateway on millions of unrelated home networks.

RangeCIDRAddressesTypically used by
10.0.0.0 – 10.255.255.25510.0.0.0/816,777,216Large enterprises, cloud VPCs
172.16.0.0 – 172.31.255.255172.16.0.0/121,048,576Medium networks, Docker
192.168.0.0 – 192.168.255.255192.168.0.0/1665,536Home and small office routers

Note the 172 range: it is 172.16 through 172.31, not all of 172. 172.32.0.0 is public address space belonging to someone.

Special-Purpose Addresses

Address / rangeMeaning
127.0.0.0/8Loopback, this machine. 127.0.0.1 is the usual one, but the whole /8 works.
169.254.0.0/16APIPA, self-assigned when DHCP fails. Seeing one means DHCP is broken, the same fault behind “Ethernet doesn’t have a valid IP configuration”.
0.0.0.0“This network” or “any address”, depending on context. In a routing table it means the default route.
255.255.255.255Limited broadcast, everyone on this segment, never forwarded by routers.
Network address (all host bits 0)Identifies the network itself, e.g. 192.168.1.0/24. Not assignable to a host.
Broadcast address (all host bits 1)Every host on that network, e.g. 192.168.1.255/24. Not assignable.
100.64.0.0/10Carrier-grade NAT space, used inside ISP networks.

The network and broadcast addresses are why a /24 gives you 254 usable hosts, not 256.

Calculating Usable Hosts

Usable hosts = 2^(host bits) − 2. Full method in subnetting explained, with the numbers on one page in the subnetting cheat sheet.

CIDRSubnet maskHost bitsUsable hosts
/30255.255.255.25222, point-to-point links
/29255.255.255.24836
/28255.255.255.240414
/27255.255.255.224530
/26255.255.255.192662
/25255.255.255.1287126
/24255.255.255.08254
/23255.255.254.09510
/22255.255.252.0101,022
/16255.255.0.01665,534

Our subnet calculator does this for any address and mask, and the IP to binary converter shows the bit-level view if you are learning subnetting. The IP header is where these fields actually live on the wire, and subnetting explained walks through splitting a network step by step.

Static vs Dynamic Assignment

StaticDHCPDHCP reservation
Set whereOn the deviceAutomatically by the serverOn the DHCP server, keyed to the MAC
Changes on rebootNoPossiblyNo
Best forRouters, switches, firewallsLaptops, phones, guestsPrinters, servers, NAS, cameras

DHCP reservations are almost always the right answer for devices needing a fixed address. You get the stability of static addressing with central management, and no risk of handing out an address the DHCP pool later tries to reuse.

Why IPv4 Ran Out

IANA allocated its final blocks to the regional registries in February 2011. The regional registries exhausted their pools over the following decade, APNIC in 2011, RIPE in 2019, ARIN in 2015. There is no free IPv4 space left; addresses now change hands on a transfer market at real prices.

Three things kept IPv4 alive past exhaustion:

  • NAT, thousands of devices behind one public address.
  • CIDR, allocations sized to actual need instead of class boundaries.
  • Carrier-grade NAT, ISPs putting entire subscriber bases behind shared public addresses.

IPv4 vs IPv6

IPv4IPv6
Size32 bits128 bits
Total addresses~4.3 billion~340 undecillion
NotationDotted decimal, 192.168.1.1Hex, colon-separated, 2001:db8::1
HeaderVariable, 20–60 bytesFixed 40 bytes
BroadcastYesNo, replaced by multicast
Address configManual or DHCPSLAAC or DHCPv6
NATEssentialUnnecessary
FragmentationBy routers and hostsHosts only

The two run side by side (dual stack) on most networks today, and will for years.

Frequently Asked Questions

Why is 192.168.1.1 so common?

It is the first usable address in 192.168.1.0/24, a private range from RFC 1918, and router manufacturers converged on it as the default gateway. See our 192.168.1.1 router login guide, or the ISP-specific ones for Suddenlink and AT&T ATTWiFiManager.

Can two devices have the same IP address?

Not on the same network, you get an address conflict and intermittent failure for both. On different private networks it is completely normal, which is exactly what NAT makes possible.

What does the /24 mean?

It is CIDR notation for the subnet mask: the number of leading bits belonging to the network portion. /24 equals 255.255.255.0.

Is my public IP the same as my device’s IP?

Usually not. Your device holds a private address; your router holds the public one and translates between them. This is why every device in your house shows the same address to a “what is my IP” site.

Why can’t I use all 256 addresses in a /24?

Because the first (all host bits zero) is the network address and the last (all host bits one) is the broadcast address. Neither can be assigned to a host, leaving 254.

What is the difference between a public and a private IP address?

Public addresses are globally unique and routed on the internet. Private addresses come from the RFC 1918 ranges, are reused freely across the world, and are dropped by internet routers.

JA
Written by

Jaspreet Singh

Hey! I'm Jaspreet Singh and I completed a degree in Bachelor of Computer Applications. I have 7+ years of experience in the Network & Security Domain as well as the Cloud Infra Domain. So I love to explore my technical knowledge with you.

Leave a Reply

Your email address will not be published. Required fields are marked *