Internet Protocol version 4 (IPv4) is the foundation of modern networking. Every device on a network requires an IP address to communicate, and IPv4 uses a 32-bit address space written in dotted decimal notation, such as 192.168.10.25. These addresses are divided into classes and further grouped into public and private ranges to support networks of different sizes and purposes.
Table 1 - IP version 4 with classes and its ranges
Originally, IPv4 addresses were organized into classes to simplify allocation:
Class A (1–126.x.x.x): Designed for very large networks, with millions of host addresses.
Class B (128–191.x.x.x): Intended for medium-sized organizations, supporting up to 65,000 hosts per network.
Class C (192–223.x.x.x): Assigned to smaller networks, each allowing up to 254 hosts.
Class D (224–239.x.x.x): Reserved for multicast traffic.
Class E (240–255.x.x.x): Experimental use only.
Although this classful addressing system provided simple structure, it proved inflexible and wasteful. For example, an organization requiring only 300 hosts could not fit into a Class C network and had to be allocated a Class B block, wasting thousands of addresses. This limitation led to the adoption of CIDR (Classless Inter-Domain Routing), which allows more efficient subnetting and aggregation.
IPv4 addresses are also classified into public and private ranges.
Public addresses are globally unique and routable across the internet. Examples include Google’s 8.8.8.8 or Cloudflare’s 1.1.1.1.
Private addresses are reserved for local use within organisations and are not routable on the public internet. They require NAT (Network Address Translation) to access external networks.
The private ranges, defined in RFC 1918, are:
Class A private: 10.0.0.0 – 10.255.255.255
Class B private: 172.16.0.0 – 172.31.255.255
Class C private: 192.168.0.0 – 192.168.255.255
These ranges are widely used in home networks, enterprise LANs, and internal systems.
In addition to public and private addresses, several special ranges exist:
Loopback (127.0.0.0/8) – testing local host communication.
APIPA (169.254.0.0/16) – automatically assigned when DHCP fails.
Broadcast (255.255.255.255) – sends traffic to all hosts on a subnet.
Multicast (224.0.0.0 – 239.255.255.255) – used by routing protocols and streaming.
Range: 0.0.0.0
Size: 1 address
Usage: Used as “unspecified address” (e.g., before an interface gets an IP). Also used in default routes.
Range: 1.0.0.0 – 126.255.255.255
Size: ~16.7 million addresses per network (total 2,147,483,648 addresses)
Usage: Originally designed for very large organisations. Supports /8 networks.
Private Subset: 10.0.0.0 – 10.255.255.255.
Range: 127.0.0.0 – 127.255.255.255
Size: 16.7 million addresses (reserved)
Usage: Internal host testing. Most common: 127.0.0.1 (localhost).
Range: 128.0.0.0 – 191.255.255.255
Size: ~65,534 hosts per network (total ~1,073,741,824 addresses)
Usage: Medium-sized networks with a /16 mask.
Private Subset: 172.16.0.0 – 172.31.255.255.
Range: 192.0.0.0 – 223.255.255.255
Size: 254 hosts per network (total ~536,870,912 addresses)
Usage: Small networks, common in home/office LANs. Uses /24 mask.
Private Subset: 192.168.0.0 – 192.168.255.255.
Range: 224.0.0.0 – 239.255.255.255
Size: ~268 million addresses
Usage: Reserved for multicast traffic (e.g., OSPF uses 224.0.0.5, and EIGRP uses 224.0.0.10).
Range: 240.0.0.0 – 254.255.255.255
Size: ~268 million addresses
Usage: Reserved for research/experimental use. Not publicly routable.
Broadcast (255.255.255.255)
Range: single address
Usage: Limited broadcast – sent to all hosts in the same local subnet.
CIDR is an abbreviation for Classless Inter-Domain Routing. This is one of two main improvements to classful addressing of the IPv4 standard introduced by the IETF (Internet Engineering Task Force) organisation.
When globalisation began in the beginning of 1990, the IPv4 addresses quickly ran out.
Now, to go into more details, I need to introduce three classless method components in order to comprehend a CIDR method:
Subnet mask
Variable-length subnet mask
Prefix length
Subnet mask: is a binary number that separates the network address from the host address. Subnet mask is expressed by slash symbol (/), following the decimal number from 8 to 31. We need to remember that subnet masks can also be expressed in binary numbers or by decimal numbers. Please see table 2 for details.
Figure 1 - Network prefix and host
Figure 2 - Network, subnet and host
Variable-length Subnet Mask: is the method giving the flexibility in creating separated networks called subnets. To be more specific, I would state that the VLSM (Variable-Length Subnet Mask) separates the borrowed host-bits into separated, "produced" subnets. The subnets "are produced" from the borrowed bits, but the overall address size stays constant with 24 bits. Probably, a better explanation will be if I say : the borrowed host bits are replaced with subnet bits. So, nothing is produced but rather changes its function.
Prefix length: refers to continuous bits at the beginning of the IP address representing the network part. The network and subnet components are included in the prefix length. For instance, with a prefix length of 24-bits (/24) the IPv4 mask address sequentially counts 24 bits in the whole 32-bit address: 11111111 11111111 11111111 00000000.
Table 2 - Classful Addressing
As was previously mentioned in this short article, the IPv4 addressing system uses the class concept to divide addresses into 5 groups (A, B, C, D, and E).
Group A is based on the first 8-bit octet, Group B is based on the two 16-bit octets, and Group C is based on the three 24-bit octets.
In Table 2, I demonstrate the classful network in binary and decimal format. In the third column, I convert the binary value of each octet into a decimal number. Finally, in the last column, I added the bits from the network part. For example, in the class "A,” we note a summarised value of 8 bits in the first octet (1+1+1+1+1+1+1+1 = 8-bit). We do this simple arithmetic for the next classes B and C.
Table 3 - Classless Addressing
The classless concept applied to the IPv4 address is still relatively easy exercise. Just what we need to do is calculate the binary number to the decimal value. For instance, in table 3, in the first row, we are adding all bits with a value of 1 (the same way as we did with table 2, but now we took into consideration all 1's). In total, there are 18 bits continuously counted off 1. Therefore, the prefix mask for this binary mask 11111111 111111111 11000000 00000000 is eighteen (8 + 8 + 2 = 18).
A network engineer can assign IPv4 addresses in an efficient and highly flexible manner, just using a CIDR. In this place, it is worth repeating all CIDR method benefits. The primary advantage of CIDR is its ability to expand the number of networks, previously restricted by the classful concept's size limitations. Also, CIDR provides better control over IP address allocation; as a result, we can more efficiently design the network.
Overall, CIDR is a significant improvement to the old classful method and provides flexibility, scalability, and even improved security of a network.