Computer Networks · CIDR
Problems with Classful Classification (Inflexibility of Class A/B/C Sizes)
Overview
Classful addressing divides the entire IPv4 address space into fixed classes (A–E) by leading bits, and each class is then cut into networks of one fixed size.
Because a user must take a whole pre-cut piece rather than the number of addresses actually needed, allocation is inflexible and wastes large amounts of address space.
This inflexibility is what motivated classless (CIDR) addressing.
Key concepts
- Classful addressing problem: The original IPv4 scheme fixes class boundaries by leading bits and then subdivides each class into networks of a single fixed size.
A user cannot obtain an arbitrary number of addresses; they must take a whole piece of a fixed size. - IANA (Internet Assigned Numbers Authority): Controls all IP addresses and allocates the smallest available unit, a Class C network, to a requesting office.
- Smallest allocatable unit: A Class C network of addresses. The minimum obtainable is 256 addresses.
- Inflexibility ("big cake" analogy): The address space is like a cake already cut into fixed pieces; you must take the entire piece, not the amount you need.
- Classless addressing: Introduced because classful classification was not flexible; addresses are no longer divided into Class A/B/C, and a user can request the exact number of addresses needed.
How it works
The classful scheme is built by repeatedly splitting the address space using leading bits:
- Total IPv4 space = addresses (32 bits).
- Look at the first bit: 0 or 1 splits the whole space into two halves. The half with first bit 0 is Class A.
- Take the remaining half (first bit 1) and look at the second bit: 10 or 11. The 10 block is Class B.
- Take the 11 block and look at the third bit: 110 or 111. The 110 block is Class C.
- The remaining 111 block is split into 1110 (Class D) and 1111 (Class E).
After forming the classes, each class is cut into networks of a single fixed size:
- Class A networks are each of size (≈ 16 million addresses).
- Class B networks are each of size .
- Class C networks are each of size .
Formulas
- Total IPv4 address space (32-bit addresses)
- Class A network size million addresses (24 host bits)
- Class B network size addresses (≈ 64,000)
- Class C network size addresses (smallest allocatable unit)
Worked examples
Need 100 addresses:
- Smallest available block = Class C = addresses.
- , so a Class C network is assigned.
- Wastage: addresses wasted; no smaller block exists.
Need 300 addresses:
- Class C gives only → insufficient.
- Must move up to Class B = addresses.
- Wastage: addresses wasted; no intermediate size exists.
Comparison
| Class | Leading bits | Network size (addresses per network) | Flexibility for small needs |
|---|---|---|---|
| A | 0 | ≈ 16 million | Very poor (huge block) |
| B | 10 | Poor (too big for ~300) | |
| C | 110 | Smallest unit; still too big for needs below 256 | |
| D | 1110 | (multicast) | — |
| E | 1111 | (reserved) | — |
Revision summary
- Classful addressing fixes both class boundaries (by leading bits) and the network size within each class — this causes inflexibility.
- The smallest block obtainable is a Class C network of 256 addresses; you cannot request fewer.
- If your requirement exceeds 256, you are forced to Class B (~64,000 addresses), causing massive over-allocation.
- "Big cake already cut" analogy: you must take the whole pre-cut piece, not the amount you need.
- Classful addressing was used through the 1990s; its inflexibility led to classless (CIDR) addressing, where the exact number of addresses requested can be allocated.
- IANA controls allocation of the entire IPv4 address space.
Previous-year exam insights
- A class occupies a fraction of the whole IPv4 space fixed by its prefix length: a class whose leading bits are fixed to k bits occupies 1/ of the space (and addresses in total).
Class A = 1/2, Class B = 1/4, Class C = 1/8, and Classes D and E = 1/16 each;
the five classes together partition the entire space exactly.
Asked inUGC NET 2019 - Number of networks in each class = : Class blocks (126 usable, since 0.x.x.x and 127.x.x.x are reserved), Class blocks, Class blocks.
Total addresses per class = (number of networks) x (addresses per network). - Usable host addresses per classful network = - 2 (one address for the network ID, one for the directed broadcast): Class A = 16,777,214, Class B = 65,534, Class C = 254.
When a requirement is stated in hosts, add 2 before choosing the block class, and when the requirement already exceeds 254 usable addresses a Class C block is insufficient. - Standard classful ranges, leading bits and default masks: A = 1-126, first bit 0, mask 255.0.0.0 (/8);
B = 128-191, prefix 10, mask 255.255.0.0 (/16);
C = 192-223, prefix 110, mask 255.255.255.0 (/24);
D = 224-239 (1110, multicast);
E = 240-255 (1111, reserved); 127.x.x.x is loopback and 0.x.x.x is 'this network'. - In classless (CIDR) addressing any prefix length p is allowed: a /p block contains addresses, so for a requirement of n addresses the smallest sufficient prefix is p = 32 - ceil(), and consecutive blocks of equal size can be aggregated (route summarised) into one larger block.
- The number of fixed-size blocks needed to satisfy a request is ceil(n / block size); taking many small blocks (e.g. multiple Class C networks) instead of one suitably sized block is exactly what increases routing-table size and motivates classless allocation.