Computer Networks · CIDR
Classless Addressing: Allocating Exact Block Sizes
Overview
Classless addressing (CIDR) abolishes the fixed Class A, B and C divisions and treats the whole address space as one pool. A user is given exactly the number of addresses requested, as a block that may fall anywhere in the space.
This matters because the network-ID/host-ID split is no longer implicit, so CIDR must state it explicitly.
Key concepts
- Classless addressing (CIDR – Classless Inter-Domain Routing): The old fixed classes (A, B, C) are abolished; the entire address space is kept as one pool, and a user is given exactly the number of IP addresses requested, regardless of where that block falls (it may span what used to be Class A, B or C space).
- Block: The chunk of addresses given to a user.
- No class from the address: Since there are no classes, looking at an IP address alone tells you nothing about which class it belongs to — the concept of Class A/B/C no longer applies.
- Implicit split (classful): In classful addressing the network-ID/host-ID division is known from the class, so nobody has to specify it.
- Explicit split (classless): In CIDR the split is not implicit; it must be determined or specified, because given an IP address from a CIDR block it is not clear which part is the network ID (also called block ID) and which part is the host ID.
- CIDR notation: To remove this confusion, CIDR uses a notation that explicitly states the number of bits in the network ID part.
How it works
- The address space is not divided into classes; it is left as it is, one single pool.
- When a user needs IP addresses, he requests the exact number he wants.
- The allocating authority cuts the address space and hands over whatever block the user wanted, irrespective of whether it falls in the old Class A, Class B or Class C range.
- Because classes are gone, given an IP address you cannot tell whether it is Class A, Class B or Class C.
- To resolve which part is network ID and which is host ID, CIDR notation explicitly states the number of bits in the network ID part.
Comparison
| Aspect | Classful addressing | Classless (CIDR) addressing |
|---|---|---|
| Division of address space | Fixed classes A, B, C | No classes; single pool, cut into blocks on demand |
| Size given to user | Fixed by class | Exactly the number of addresses the user asks for |
| Location of block | Must lie within its class range | Irrespective of where it falls (A/B/C range) |
| Network ID / Host ID split | Implicit — known from the class, no one needs to specify it | Not implicit — must be determined/specified |
| Class A split | 8 bits network ID, 24 bits host ID | — |
| Class B split | 16 bits network ID, 16 bits host ID | — |
| Class C split | 24 bits network ID, 8 bits host ID | — |
| Main difficulty | None (split is known) | Given an IP address, which part is network ID and which part is host ID? |
Revision summary
- CIDR = Classless Inter-Domain Routing: no classes;
assign the exact number of addresses requested;
the block may fall anywhere in the address space. - The allocated chunk is called a block.
- Advantage of classful addressing: the network-ID/host-ID division is implicit (Class A: 8/24, Class B: 16/16, Class C: 24/8), so nobody has to specify it.
- Main disadvantage/difficulty of classless addressing: given an IP address from a CIDR block, it is not clear which part is the network ID (block ID) and which part is the host ID.
- CIDR notation explicitly states the number of bits in the network ID part, removing that confusion.
- An address alone no longer reveals a class; the class A/B/C concept does not apply.
Previous-year exam insights
- For a prefix /n the block size is addresses; the block's first address must have all host bits zero, i.e. the address must be a multiple of the block size.
To satisfy a requirement of k addresses, choose the smallest n with ; for k usable hosts, require .
Asked inGATE 2026GATE 2020GATE 2012UGC NET 2018 - A block of size addresses can be split into two halves of size by increasing the prefix length by 1; the lower half keeps the same network address and the upper half has the (m−1)-th bit set.
Asked inGATE 2012UGC NET 2018 - To test whether an address belongs to a block, AND the address with the block's mask (/n → n ones followed by 32−n zeros) and compare with the block's network address.
Asked inISRO 2014GATE 2022 - Route aggregation (supernetting): a set of subnets can be summarised by the longest common prefix of their network addresses; the aggregate prefix length equals the number of leading bits all the subnets share.
Asked inGATE 2022GATE 2020 - A valid CIDR block must not have any host bits set in its network address; an address with nonzero bits beyond the prefix length is not a valid block identifier.
Asked inGATE 2026GATE 2012UGC NET 2018 - The number of addresses in a /n block is ; usable host addresses are when the all-zeros (network) and all-ones (broadcast) addresses are excluded.
Asked inGATE 2020GATE 2026