1. Gyanastra
  2. Computer Networks
  3. CIDR
  4. Classless Addressing: Allocating Exact Block Sizes
Free lesson, no account needed 5 min read 66 practice questions after it
Asked in past papers8 times
  • GATE CSE2026202220202012
  • ISRO20172014
  • UGC NET20222018

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

  1. The address space is not divided into classes; it is left as it is, one single pool.
  2. When a user needs IP addresses, he requests the exact number he wants.
  3. 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.
  4. Because classes are gone, given an IP address you cannot tell whether it is Class A, Class B or Class C.
  5. 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

AspectClassful addressingClassless (CIDR) addressing
Division of address spaceFixed classes A, B, CNo classes; single pool, cut into blocks on demand
Size given to userFixed by classExactly the number of addresses the user asks for
Location of blockMust lie within its class rangeIrrespective of where it falls (A/B/C range)
Network ID / Host ID splitImplicit — known from the class, no one needs to specify itNot implicit — must be determined/specified
Class A split8 bits network ID, 24 bits host ID—
Class B split16 bits network ID, 16 bits host ID—
Class C split24 bits network ID, 8 bits host ID—
Main difficultyNone (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 232−n2^{32−n} 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 232−n≥k2^{32-n} \ge k; for k usable hosts, require 232−n≥k+22^{32-n} \ge k + 2.
    Asked inGATE 2026GATE 2020GATE 2012UGC NET 2018
  • A block of size 2m2^{m} addresses can be split into two halves of size 2m−12^{m−1} 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 232−n2^{32−n}; usable host addresses are 232−n−22^{32-n} - 2 when the all-zeros (network) and all-ones (broadcast) addresses are excluded.
    Asked inGATE 2020GATE 2026
Pages 1–2 of 2