Network classes were designed with then-current situations in mind, where class A was designed to have the smallest number of networks but the largest number of hosts per network, and class C was designed to have the largest number of networks but the smallest number of hosts per network. The class A networks were distributed among the largest corporations that were supposed to have the largest number of hosts, and the class C networks were supposed to be distributed to the various companies that were smaller in size.
In classless addressing, the addresses no longer belong to class A, B, or C – as the name implies – but the suffix to the address is added. This defines how many high-order bits of the address belong to the network ID and how many belong to the host ID; this is also called CIDR.
For example, a 192.168.1.12 address is a class C address. However, in a CIDR notation, this address is noted as 192.168.1.12/24 if a default, class-specific subnet mask is used. In this case, /24 means that the 24 high-order bits are used for the network ID portion and the remaining 8 bits are used for the host ID portion:
The Internet Assigned Numbers Authority (IANA) is the authoritative body that assigns or issues the blocks of CIDR addresses to regional internet registries. For example, the body is responsible for addressing assignments to European, Asian, or North American internet registries, which then further assign the blocks of addresses to local internet registrars. By using classless addressing, finer and adjustable segmentation of the address space is possible, resulting in fewer addresses being wasted.
In a usual network addressing scheme, the number of addresses available for assignment to hosts is n-2, where n is the maximum number of available network IDs in a network. For example, there are 256 host IDs in a class C 192.168.1.0 network. The number of addresses that can be assigned to hosts is 256 - 2 = 254. The first host address (192.168.1.0, in this example) is always reserved for referring to the network itself and the last network ID (192.168.1.255, in this example) is always reserved to a broadcast address.
In more complex network environments, less common addressing schemes are possible, such as networks with a /31 and /32 suffix. These are one-host networks, where the host ID is equal to the broadcast address. However, these are beyond the scope of this book and won't be mentioned further.
The following table shows the values of IPv4 CIDR block prefixes, available addresses, and subnet masks:
In the next section, we will learn how to divide a network range into smaller, multiple networks.