Understanding IP address classes and subnetting for beginners

Every device on a network needs an address so data can reach the correct destination. An IP address identifies a host, while the subnet mask shows which part identifies the network and which part identifies the device. Learning how these pieces work makes it easier to troubleshoot connections, design local networks, and understand routing.

Older networking lessons often begin with IP address classes. Although modern networks mainly use CIDR notation, classful addressing remains useful because it explains why certain ranges were created and how subnetting developed. Once these basics are clear, binary calculations and practical network planning become much less intimidating.

Subnetting is the process of dividing one larger network into smaller logical networks. It can reduce broadcast traffic, improve address management, and separate departments, services, or security zones. You can also verify many of the values discussed here with online utilities such as a subnet calculator while learning the underlying method.

What an IP address represents

An IPv4 address contains 32 bits, divided into four 8-bit sections called octets. These octets are normally written as decimal numbers separated by periods, such as 192.168.1.25. Each octet can range from 0 through 255 because eight binary bits can represent 256 possible values.

An address has two logical parts: the network portion and the host portion. The network portion identifies the local network, while the host portion identifies a particular interface or device within that network. The subnet mask, or its shorter CIDR prefix, determines where that division occurs.

For example, the mask 255.255.255.0 is equivalent to /24. The first 24 bits describe the network, leaving eight bits for host addresses. In a typical /24 network, the first address identifies the network itself and the last address is reserved for broadcast traffic, leaving 254 usable host addresses.

The traditional IPv4 address classes

Classful addressing divided IPv4 into five categories, although Classes A, B, and C were the main classes used for ordinary unicast networks. The class could be recognized from the first octet, and each class came with a default subnet mask.

Class A networks supported very large numbers of hosts, while Class C networks supported smaller groups. Class D was reserved for multicast traffic, and Class E was reserved for experimental purposes. Modern routing does not rely on these class boundaries, but the terminology still appears in textbooks, legacy systems, and certification materials.

Class First-octet range Default mask Typical purpose
A 1–126 255.0.0.0 (/8) Very large networks
B 128–191 255.255.0.0 (/16) Medium-sized networks
C 192–223 255.255.255.0 (/24) Smaller networks
D 224–239 Not applicable Multicast
E 240–255 Not applicable Experimental use

The ranges 0.0.0.0 and 127.0.0.0/8 have special meanings. The first is associated with unspecified or default routes, while 127.0.0.0/8 is reserved for loopback testing. The familiar address 127.0.0.1 points back to the local computer.

Why CIDR replaced classful networking

Classful allocation often wasted addresses. An organization needing 300 host addresses could receive an entire Class B network with more than 65,000 possible host addresses, while a Class C network would be too small. Classless Inter-Domain Routing, or CIDR, solved this problem by allowing prefixes of different lengths.

CIDR writes the number of network bits after a slash. A /16 prefix uses 16 network bits, a /24 uses 24, and a /28 uses 28. The remaining bits provide host addresses. This flexible system supports more efficient allocation and allows routers to summarize multiple networks into a shorter route.

CIDR also makes route aggregation possible. Several adjacent networks can sometimes be represented by one larger prefix, reducing the size of routing tables. This is one reason modern network design focuses more on prefixes and masks than on the old class labels.

How subnetting divides a network

To subnet a network, you borrow bits from the host portion and use them as additional network bits. Each borrowed bit doubles the number of subnets while reducing the number of hosts available in each subnet. The balance depends on the network’s purpose.

Suppose a /24 network is changed to /26. Four host bits have been borrowed, creating 2⁴, or 16? Actually, a /24 to /26 borrows two bits, creating four subnets. Each subnet has six host bits, producing 64 total addresses and 62 traditionally usable host addresses.

The four resulting ranges are 192.168.1.0–63, 192.168.1.64–127, 192.168.1.128–191, and 192.168.1.192–255. In each range, the first address is the network address and the last is the broadcast address. The usable host range lies between them.

A simple method for subnet calculations

Start by identifying the prefix length and the number of host bits. For IPv4, subtract the prefix from 32. The host capacity is generally 2 raised to the number of host bits, minus two for the network and broadcast addresses.

Next, find the subnet block size in the octet where the mask stops being 255. If that octet is 192, the block size is 256 minus 192, or 64. Counting in increments of 64 reveals the network boundaries. This method is quick once you practice it with common prefixes such as /24, /26, /27, and /28.

Some modern networks use special cases. Point-to-point links may use /31 prefixes, and IPv6 does not use IPv4-style broadcast addresses. Virtual networks, cloud platforms, and container systems may also apply their own conventions, so always check the platform’s documentation when moving beyond basic IPv4 exercises.

Private ranges and practical network planning

Private IPv4 addresses are intended for internal networks and are not routed directly across the public internet. The three major private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Home routers commonly assign addresses from the last range, while larger organizations often use the first.

A good subnet plan leaves room for growth and separates systems according to function. For example, employee computers, guest Wi-Fi, servers, cameras, and management devices can each use different subnets. Routing and firewall rules can then control which groups are allowed to communicate.

Clear documentation is as important as correct arithmetic. A network that works today can become difficult to manage when its address ranges, VLANs, and routing rules are not recorded.

For hands-on learning, write down a prefix, calculate its mask, identify the block size, and list each resulting subnet. Then test your answer with a DNS, ping, IP, or address-conversion utility. Practical repetition helps connect binary theory with the behavior of real networks.

Understanding IP addressing becomes much easier when classes are treated as historical foundations rather than strict modern limits. Focus on subnet masks, CIDR prefixes, host capacity, and network boundaries, then apply those concepts to small lab networks. Build a few subnetting exercises, inspect the results with online tools, and use the method to plan a cleaner, more reliable network.