Classful and Classless addressing (CIDR)

Classful vs Classless Addressing & CIDR – Complete Exam Guide 2025
🌐 Networking · Competitive Exam 2025

Classful vs Classless
Addressing & CIDR

IP Classes A–E · Default Masks · CIDR Notation · VLSM · Binary Breakdown · Subnetting vs Supernetting · 30 MCQs — everything for SSC, IBPS, UPSC, Railway & Bank exams

SSC CGL/CHSLIBPS PO/ClerkRBI Grade B UPSC GS-IIIRailway NTPCNDA/CDSGATE CS
📚

Era: Pre-1993 · Still Tested in ExamsClassful Addressing

Classful Addressing was the original IPv4 addressing scheme used from the 1980s until 1993. In this system, every IP address belongs to one of five fixed classes (A–E), each with a rigid, pre-defined subnet mask. You could not change the mask — the class determined the network/host split automatically.

A
1.0.0.0 –
126.255.255.255
/8 · 255.0.0.0
16,777,214 hosts
126 networks
B
128.0.0.0 –
191.255.255.255
/16 · 255.255.0.0
65,534 hosts
16,384 networks
C
192.0.0.0 –
223.255.255.255
/24 · 255.255.255.0
254 hosts
2,097,152 networks
D
224.0.0.0 –
239.255.255.255
No mask
Multicast only
No hosts
E
240.0.0.0 –
255.255.255.255
No mask
Experimental
Reserved
ClassFirst Octet BitsRangeDefault MaskNetwork BitsHost BitsMax HostsUse
A0xxxxxxx1–126255.0.0.0 (/8)82416,777,214Very large orgs
B10xxxxxx128–191255.255.0.0 (/16)161665,534Medium orgs
C110xxxxx192–223255.255.255.0 (/24)248254Small networks
D1110xxxx224–239N/AMulticast
E1111xxxx240–255N/AExperimental
🎯 Exam Tricks — Classful
  • 127.x.x.x is SKIPPED from Class A — reserved for Loopback (127.0.0.1 = localhost)
  • 0.x.x.x also skipped — so Class A starts at 1, not 0
  • Memory trick: A = 1–126, B = 128–191, C = 192–223 (gap at 127)
  • Class identifier bits: A starts with 0, B with 10, C with 110, D with 1110, E with 1111
  • Classes D and E: No subnet mask, No usable hosts
  • Default masks: A = /8, B = /16, C = /24 — these three must be memorised
🔢

How Classes Are IdentifiedBinary Breakdown of IP Classes

How routers identify the class from the first octet (32-bit address)

Class A (/8)
0
N
N
N
N
N
N
N
← 24 HOST bits →
Class B (/16)
1
0
← 14 NET bits →
← 16 HOST bits →
Class C (/24)
1
1
0
← 21 NET bits →
← 8 HOST bits →
Network bits
Host bits
Network/Host boundary
📌 Class Identification Rule
  • If 1st bit = 0 → Class A (first octet 0–127, but 0 and 127 reserved)
  • If first 2 bits = 10 → Class B (first octet 128–191)
  • If first 3 bits = 110 → Class C (first octet 192–223)
  • If first 4 bits = 1110 → Class D / Multicast (224–239)
  • If first 4 bits = 1111 → Class E / Experimental (240–255)
⚠️

Why Classful FailedProblems with Classful Addressing

❌ Class A — Extreme Waste

Organisation needs 1,000 hosts → gets 16.7 million addresses

99.99% WASTED
1,000 used / 16,777,214 allocated

⚠️ Class B — Significant Waste

Organisation needs 300 hosts → gets 65,534 addresses

99.5% WASTED
300 used / 65,534 allocated
ProblemExplanationImpact
IP WastageClass A gives 16.7M addresses even for small orgs — most go unusedIPv4 exhaustion by 2011
Rigid BoundariesCannot split a Class B into 500-host subnets — all or nothingInefficient allocation
No VLSMOnly one mask size per class — no flexibilityNetwork design inflexibility
Routing Table BloatEvery organisation needed its own entry — millions of routesRouter memory overload
Class GranularityJump from 254 (Class C) to 65,534 (Class B) — no in-betweenAlways over or under
🎯

Introduced 1993 · RFC 1519Classless Addressing — CIDR

CIDR = Classless Inter-Domain Routing. Introduced in 1993 (RFC 1519) to replace classful addressing. CIDR removes the A/B/C class boundaries and allows any prefix length from /0 to /32. The slash notation (e.g. /26) tells you exactly how many bits are network bits — giving full flexibility.

❌ Classful (Old)
  • Fixed masks only: /8, /16, /24
  • Class determines mask: no choice
  • Massive IP wastage common
  • No route aggregation possible
  • Huge routing tables in routers
  • Obsolete since 1993
✅ Classless / CIDR (Modern)
  • Any prefix /0 to /32 allowed
  • You choose the exact mask needed
  • Minimal IP wastage with right sizing
  • Route aggregation: many routes → one
  • Smaller routing tables, faster routing
  • Used everywhere today
📌 CIDR Notation Explained
  • Format: IP Address / Prefix Length — e.g. 192.168.1.0/26
  • /26 means the first 26 bits = network, remaining 6 bits = host
  • Host bits = 32 − prefix → 32 − 26 = 6 host bits
  • Usable hosts = 2⁶ − 2 = 62 (subtract 2 for Network ID + Broadcast)
  • CIDR was standardised in RFC 1519 (1993)
  • CIDR enables both subnetting (longer prefix) and supernetting (shorter prefix)
📋

Must Memorise for ExamsCIDR Reference Table

/24
255.255.255.0
254
Block: 256
/25
255.255.255.128
126
Block: 128
/26
255.255.255.192
62
Block: 64
/27
255.255.255.224
30
Block: 32
/28
255.255.255.240
14
Block: 16
/29
255.255.255.248
6
Block: 8
/30
255.255.255.252
2
P2P links
PrefixSubnet MaskHost BitsTotal IPsUsable HostsBlock SizeSubnets from /24
/8255.0.0.02416,777,21616,777,214Class A default
/16255.255.0.01665,53665,534Class B default
/24255.255.255.082562542561 (full /24)
/25255.255.255.12871281261282
/26255.255.255.19266462644
/27255.255.255.22453230328
/28255.255.255.240416141616
/29255.255.255.248386832
/30255.255.255.252242464
/32255.255.255.255011 host only1Host route
✅ Pattern to Remember — Hosts per Subnet
  • Each step from /24 → /30 halves the hosts: 254 → 126 → 62 → 30 → 14 → 6 → 2
  • Block sizes halve each step down: 256, 128, 64, 32, 16, 8, 4
  • /30 = 2 hosts — always used for point-to-point WAN links
  • Formula: Hosts = 2^(32 − prefix) − 2
🧩

Key CIDR FeatureVLSM — Variable Length Subnet Masking

VLSM = Variable Length Subnet Masking. It is a feature enabled by CIDR that allows different subnet sizes within the same network. Instead of forcing all subnets to use the same mask, VLSM lets you assign the exact right size — a /25 for a large dept, a /28 for a small one, a /30 for a WAN link.

FeatureClassful (No VLSM)CIDR with VLSM
Subnet mask sizesOne fixed mask per classAny mask, any size
IP efficiencyVery wastefulMaximum efficiency
Routing protocolsRIP v1 (classful only)OSPF, RIPv2, EIGRP, BGP
Example useAll subnets /24/25 + /26 + /28 + /30 in same network

📌 VLSM Design — Allocate 192.168.10.0/24 for: HR=100 hosts, IT=50 hosts, WAN link=2 hosts

1
HR — 100 hosts needed

2ʰ − 2 ≥ 100 → h=7 → 126 hosts → use /25 → allocate 192.168.10.0/25 (.0–.127)

2
IT — 50 hosts needed

2ʰ − 2 ≥ 50 → h=6 → 62 hosts → use /26 → allocate 192.168.10.128/26 (.128–.191)

3
WAN link — 2 hosts

2ʰ − 2 ≥ 2 → h=2 → use /30 → allocate 192.168.10.192/30 (.192–.195)

✅ Efficient VLSM Allocation
192.168.10.0/25
HR (126 usable)
192.168.10.128/26
IT (62 usable)
192.168.10.192/30
WAN (2 usable)
.196–.255 free
Future growth
✂️

CIDR in ActionSubnetting with CIDR

Subnetting = dividing a large network into smaller ones by borrowing bits from the host part, making the prefix longer (e.g. /24 → /26). Each borrowed bit doubles the number of subnets and halves the hosts per subnet.

Starting NetworkBorrowNew PrefixSubnetsHosts Each
192.168.1.0/241 bit/252126
192.168.1.0/242 bits/26462
192.168.1.0/243 bits/27830
192.168.1.0/244 bits/281614
📌 Key Subnetting Facts
  • Network ID = first IP of subnet (all host bits = 0) — cannot be assigned to host
  • Broadcast = last IP of subnet (all host bits = 1) — cannot be assigned to host
  • Block size = 256 − last octet of mask (e.g. 256−192 = 64 for /26)
  • Formula: Hosts = 2^h − 2 | Subnets = 2^b (b = borrowed bits)
  • Wildcard mask = 255.255.255.255 − subnet mask
🔗

Opposite of SubnettingSupernetting / Route Aggregation

Supernetting = combining multiple smaller networks into one large network by shortening the prefix (e.g. /24 → /22). Also called Route Aggregation or Route Summarization. Used by ISPs to reduce routing table size.

Networks CombinedCountNew Supernet MaskMask (dotted)Total IPs
192.168.0.0/24 + .1.0/242/23255.255.254.0512
192.168.0.0/24 → .3.0/244/22255.255.252.01,024
192.168.0.0/24 → .7.0/248/21255.255.248.02,048
192.168.0.0/24 → .15.0/2416/20255.255.240.04,096
192.168.0.0/24 → .31.0/2432/19255.255.224.08,192
📌 3 Rules for Supernetting — All Must Be Met
  • Rule 1 — Consecutive: Networks must be adjacent with no gaps
  • Rule 2 — Same Mask: All networks must have the same prefix length
  • Rule 3 — Boundary Aligned: First network must start at correct boundary (multiple of count)
⚖️

Most Asked Table in ExamsClassful vs Classless — Master Comparison

AspectClassful AddressingClassless (CIDR)
Year introduced1981 (RFC 791)1993 (RFC 1519)
Subnet maskFixed (A=/8, B=/16, C=/24)Variable — any /0 to /32
IP efficiencyHighly wastefulVery efficient
VLSM support❌ Not supported✅ Full VLSM support
Routing tableLarge (class-based entries)Small (aggregated)
Route aggregation❌ Not possible✅ Core feature
Routing protocolsRIP v1, IGRPRIPv2, OSPF, EIGRP, BGP
Prefix in routingImplied by classExplicit prefix length
Status todayObsolete / LegacyIndustry standard
SubnettingOnly classful subnettingAny prefix subnetting
IP exhaustionAccelerated wastageSlowed down exhaustion
RFCRFC 791RFC 1519 (updated RFC 4632)
🔬

Practice TheseWorked Examples

📌 Example 1 — How many hosts in 192.168.1.0/27?

1
Find host bits

32 − 27 = 5 host bits

2
Calculate usable hosts

2⁵ − 2 = 32 − 2 = 30 usable hosts

3
Block size and subnets

Mask = 255.255.255.224 → Block = 256−224 = 32 → 8 subnets from /24

✅ Result
30
Usable Hosts
32
Total IPs
255.255.255.224
Subnet Mask
8
Subnets from /24

📌 Example 2 — Supernet: What mask combines 192.168.4.0/24 to 192.168.7.0/24?

1
Count networks

4 consecutive /24 networks (.4, .5, .6, .7)

2
Bits to reduce

4 = 2² → reduce prefix by 2 bits

3
New supernet

/24 − 2 = /22 → 192.168.4.0/22

✅ Supernet: 192.168.4.0/22 — covers all 4 networks (1,022 usable hosts)

📌 Example 3 — Find Network ID and Broadcast for 10.10.5.77/28

1
/28 block size

Mask = 255.255.255.240 → Block = 256−240 = 16

2
Which block contains .77?

Blocks: .64–.79, .80–.95… → .77 is in .64 block

3
Network ID and Broadcast

Network = 10.10.5.64 | Broadcast = .64 + 16 − 1 = 10.10.5.79

✅ Result
10.10.5.64
Network ID
10.10.5.79
Broadcast
.65 – .78
Host Range
14
Usable Hosts
📝

Tap Any Option to Reveal AnswerMCQ Practice — 30 Questions

Score: 0 / 0
Q.01Classful🔥 Most Asked
What is the default subnet mask for a Class B IP address?
✔ Correct: B — 255.255.0.0 (/16)
Class A = 255.0.0.0 (/8) | Class B = 255.255.0.0 (/16) | Class C = 255.255.255.0 (/24). These three default masks are the most tested facts in any networking MCQ.
Q.02CIDR🔥 Most Asked
CIDR was introduced in which year to replace classful addressing?
✔ Correct: C — 1993
CIDR was introduced in 1993 via RFC 1519 to solve IPv4 address exhaustion caused by classful addressing’s rigidity and wastage.
Q.03CIDR🔥 Most Asked
In CIDR notation 192.168.1.0/26, what does “/26” represent?
✔ Correct: B — 26 bits for network
The prefix number in CIDR = number of network bits. /26 → 26 network bits, 6 host bits. Usable hosts = 2⁶ − 2 = 62.
Q.04Class A
How many bits are used for the network portion in classful Class A?
✔ Correct: A — 8 bits
Class A = /8 = 8 network bits, 24 host bits. That’s why it supports 16,777,214 hosts per network but only 126 networks.
Q.05Hosts🔥 Most Asked
How many usable hosts are in the network 192.168.1.0/26?
✔ Correct: B — 62
/26 → host bits = 32−26 = 6 → 2⁶ − 2 = 64 − 2 = 62 usable hosts. Mask = 255.255.255.192, block size = 64.
Q.06Classful Range🔥 Most Asked
Which address range is assigned to Class C in classful addressing?
✔ Correct: C — 192.0.0.0 – 223.255.255.255
Class C range = 192–223 in the first octet. Default mask = 255.255.255.0 (/24), 254 usable hosts. Class D (224–239) = Multicast.
Q.07Class A Hosts
Maximum usable hosts per Class A network is:
✔ Correct: C — 16,777,214
Class A has 24 host bits → 2²⁴ − 2 = 16,777,214. Class B = 65,534 (16 host bits). Class C = 254 (8 host bits).
Q.08Mask🔥 Most Asked
What is the subnet mask for CIDR notation /27?
✔ Correct: C — 255.255.255.224
/27 → 27 bits on. Last octet = 11100000 = 128+64+32 = 224. Block size = 256−224 = 32. Usable hosts = 30.
Q.09CIDR Advantage🔥 Most Asked
What is the KEY advantage of CIDR over classful addressing?
✔ Correct: B — Flexible, efficient allocation
CIDR removes class boundaries, enabling any prefix length → allocate exactly what’s needed → no wastage → route aggregation → smaller routing tables.
Q.10Classful Disadvantage
The major disadvantage of classful addressing was:
✔ Correct: B — Massive IP wastage
Classful gave Class A (16.7M hosts) or Class B (65K hosts) — no in-between. A company needing 300 hosts got 65,534 → 65,000+ wasted. This accelerated IPv4 exhaustion.
Q.11Route Aggregation
What is the purpose of route aggregation in CIDR?
✔ Correct: B — Combine multiple routes into one
Route aggregation (supernetting) replaces many routing entries with one summarised route — e.g. 4 × /24 → 1 × /22 entry. Reduces routing table size → faster routing.
Q.12Multicast
Which IPv4 class is reserved for multicast traffic?
✔ Correct: C — Class D
Class D (224.0.0.0–239.255.255.255) = Multicast — sends to a group of hosts. Class E (240–255) = Experimental. Neither has hosts or a default mask.
Q.13Supernet🔥 Most Asked
Which of the following represents a supernet?
✔ Correct: A — Combining /24s into /22
Supernetting = combining smaller networks into larger ones → shorter prefix. /24 → /22 means 4 networks combined (mask shortened by 2 bits). Option B = subnetting (longer prefix).
Q.14VLSM🔥 Most Asked
VLSM stands for:
✔ Correct: B — Variable Length Subnet Masking
VLSM = using different subnet mask sizes within the same network. Enabled by CIDR. Requires classless routing protocols (OSPF, RIPv2, EIGRP).
Q.15Largest subnet
Which CIDR notation represents the LARGEST possible subnet (most hosts)?
✔ Correct: C — /8
Smaller prefix = more host bits = more hosts. /8 = 24 host bits = 16,777,214 usable hosts. /32 = 0 host bits = single host route only.
Q.16Total IPs
Total number of IP addresses in network 10.0.0.0/8 is:
✔ Correct: B — 16,777,216
/8 → 24 host bits → 2²⁴ = 16,777,216 total IPs (16,777,214 usable). 10.0.0.0/8 is the largest private IP block (Class A private).
Q.17Prefix meaning
In CIDR, what does prefix “/16” signify?
✔ Correct: A — 16 network bits
CIDR prefix = count of network bits. /16 = 16 network bits, 16 host bits → 65,534 usable hosts. This matches Class B’s default mask.
Q.18CIDR mask value🔥 Most Asked
255.255.255.192 in CIDR notation is:
✔ Correct: A — /26
192 in binary = 11000000 = 2 ones in the last octet. Total = 24+2 = 26 → /26. Block size = 64. Usable hosts = 62.
Q.19Subnets from /30
How many /30 subnets can be created from a 192.168.1.0/24 network?
✔ Correct: D — 64
Borrowed bits = 30−24 = 6 → 2⁶ = 64 subnets. Each /30 has 4 IPs, 2 usable. 64 × 4 = 256 = full /24 space.
Q.20CIDR classful routing
Which routing protocol does NOT support CIDR / classless routing?
✔ Correct: A — RIP version 1
RIPv1 is classful — it does not include subnet mask in routing updates. RIPv2, OSPF, EIGRP, BGP are all classless and support CIDR/VLSM.
Q.21Class identifier bits
An IP address starting with bits “110” in the first octet belongs to which class?
✔ Correct: C — Class C
Class identifier bits: A=0xxx, B=10xx, C=110x, D=1110, E=1111. “110” in first octet = Class C (192–223).
Q.22Supernet combine🔥 Most Asked
192.168.0.0/24 and 192.168.1.0/24 combined gives supernet:
✔ Correct: B — 192.168.0.0/23
2 networks → reduce prefix by 1 bit → /24 − 1 = /23. The /23 supernet covers both .0.0 and .1.0, giving 510 usable hosts.
Q.23Block size
The block size (increment between subnets) for a /28 mask is:
✔ Correct: C — 16
/28 mask = 255.255.255.240 → block = 256 − 240 = 16. Subnets: .0, .16, .32, .48… Usable hosts = 14 each.
Q.24Class comparison
In classful addressing, which class provides the MOST hosts per network but FEWEST networks?
✔ Correct: A — Class A
Class A: 126 networks but 16.7M hosts each. Class C: 2M networks but only 254 hosts each. More network bits = fewer networks but more hosts.
Q.25RFC
CIDR was defined in which RFC?
✔ Correct: C — RFC 1519
CIDR was published in RFC 1519 (1993). RFC 791 = IPv4 original spec. RFC 1918 = Private IP addresses. RFC 2460 = IPv6.
Q.26192.168.1.0/24🔥 Most Asked
What does 192.168.1.0/24 represent?
✔ Correct: B — 256 total, 254 usable
/24 → 8 host bits → 2⁸ = 256 total IPs → 256 − 2 = 254 usable hosts. Network ID = .0, Broadcast = .255, hosts = .1 to .254.
Q.27Classless property
Which statement is TRUE about classless (CIDR) addressing?
✔ Correct: B — Flexible and efficient
CIDR’s defining characteristic = variable-length prefix → flexible allocation → efficient IP use. No class system, no fixed masks.
Q.28Supernet of 4 networks🔥 Most Asked
What is the supernet of 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, and 192.168.3.0/24?
✔ Correct: B — 192.168.0.0/22
4 networks (.0, .1, .2, .3) → 4 = 2² → reduce by 2 bits → /24 − 2 = /22. Covers .0.0 to .3.255 (1,022 usable hosts).
Q.29Classful status
The current status of classful addressing is:
✔ Correct: C — Obsolete since 1993
Classful addressing is obsolete. CIDR replaced it in 1993. All modern routing uses CIDR. Classful is only studied for exam/historical understanding and for understanding IP class ranges.
Q.30Applied — hosts needed🔥 Most Asked
An organisation needs exactly 500 hosts in one subnet. Which is the SMALLEST CIDR prefix that fits?
✔ Correct: B — /23 (510 usable hosts)
/24 = only 254 (too few). /23 → 9 host bits → 2⁹ − 2 = 510 (fits 500). /22 = 1022 (wasteful). Always pick the smallest prefix that still fits the requirement.

Last-Minute PrepQuick Revision Flash Cards

📚 Classful System

  • Pre-1993 | RFC 791
  • A: 1–126 | /8 | 16.7M hosts
  • B: 128–191 | /16 | 65,534 hosts
  • C: 192–223 | /24 | 254 hosts
  • D: 224–239 | Multicast
  • E: 240–255 | Experimental
  • 127.x.x.x = Loopback

🎯 CIDR / Classless

  • Introduced 1993 — RFC 1519
  • Any prefix /0 to /32
  • Enables VLSM
  • Enables route aggregation
  • Smaller routing tables
  • Used with OSPF, RIPv2, BGP
  • RIPv1 = classful (NOT CIDR)

📋 CIDR Reference

  • /24 → 254 | Block 256
  • /25 → 126 | Block 128
  • /26 → 62 | Block 64
  • /27 → 30 | Block 32
  • /28 → 14 | Block 16
  • /29 → 6 | Block 8
  • /30 → 2 (P2P links)

🧮 Formulas

  • Hosts = 2^(32−prefix) − 2
  • Host bits = 32 − prefix
  • Block = 256 − mask octet
  • Subnets = 2^(borrowed bits)
  • Wildcard = 255.255.255.255 − mask
  • Broadcast = Network ID + Block − 1

✂️ Subnetting

  • Splits large → smaller networks
  • Prefix becomes LONGER
  • Network ID = first IP (all host bits=0)
  • Broadcast = last IP (all host bits=1)
  • Banks use: ATM, branch LAN, servers

🔗 Supernetting

  • Combines small → large networks
  • Prefix becomes SHORTER
  • = Route Aggregation/Summarization
  • 2 × /24 → /23
  • 4 × /24 → /22
  • 8 × /24 → /21
  • Used mainly by ISPs

⚖️ Classful vs CIDR

  • Classful = Fixed masks (waste) | Obsolete
  • CIDR = Variable masks (efficient) | Modern
  • VLSM: classful = ❌ | CIDR = ✅
  • Route aggregation: classful = ❌ | CIDR = ✅
  • Classful RFC: 791 | CIDR RFC: 1519

🎯 Binary Class Markers

  • A: first bit = 0
  • B: first 2 bits = 10
  • C: first 3 bits = 110
  • D: first 4 bits = 1110
  • E: first 4 bits = 1111
📌 Must-Know Full Forms
CIDRVLSMRFC 1519 OSPFRIPv2BGP IPv4 / IPv6NATRFC 791 Route AggregationSupernetting RIPv1 = ClassfulMulticast = Class D