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
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.
126.255.255.255
126 networks
191.255.255.255
16,384 networks
223.255.255.255
2,097,152 networks
239.255.255.255
No hosts
255.255.255.255
Reserved
| Class | First Octet Bits | Range | Default Mask | Network Bits | Host Bits | Max Hosts | Use |
|---|---|---|---|---|---|---|---|
| A | 0xxxxxxx | 1–126 | 255.0.0.0 (/8) | 8 | 24 | 16,777,214 | Very large orgs |
| B | 10xxxxxx | 128–191 | 255.255.0.0 (/16) | 16 | 16 | 65,534 | Medium orgs |
| C | 110xxxxx | 192–223 | 255.255.255.0 (/24) | 24 | 8 | 254 | Small networks |
| D | 1110xxxx | 224–239 | N/A | — | — | — | Multicast |
| E | 1111xxxx | 240–255 | N/A | — | — | — | Experimental |
- 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)
- 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
⚠️ Class B — Significant Waste
Organisation needs 300 hosts → gets 65,534 addresses
| Problem | Explanation | Impact |
|---|---|---|
| IP Wastage | Class A gives 16.7M addresses even for small orgs — most go unused | IPv4 exhaustion by 2011 |
| Rigid Boundaries | Cannot split a Class B into 500-host subnets — all or nothing | Inefficient allocation |
| No VLSM | Only one mask size per class — no flexibility | Network design inflexibility |
| Routing Table Bloat | Every organisation needed its own entry — millions of routes | Router memory overload |
| Class Granularity | Jump from 254 (Class C) to 65,534 (Class B) — no in-between | Always 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.
- 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
- 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
- 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
| Prefix | Subnet Mask | Host Bits | Total IPs | Usable Hosts | Block Size | Subnets from /24 |
|---|---|---|---|---|---|---|
/8 | 255.0.0.0 | 24 | 16,777,216 | 16,777,214 | — | Class A default |
/16 | 255.255.0.0 | 16 | 65,536 | 65,534 | — | Class B default |
/24 | 255.255.255.0 | 8 | 256 | 254 | 256 | 1 (full /24) |
/25 | 255.255.255.128 | 7 | 128 | 126 | 128 | 2 |
/26 | 255.255.255.192 | 6 | 64 | 62 | 64 | 4 |
/27 | 255.255.255.224 | 5 | 32 | 30 | 32 | 8 |
/28 | 255.255.255.240 | 4 | 16 | 14 | 16 | 16 |
/29 | 255.255.255.248 | 3 | 8 | 6 | 8 | 32 |
/30 | 255.255.255.252 | 2 | 4 | 2 | 4 | 64 |
/32 | 255.255.255.255 | 0 | 1 | 1 host only | 1 | Host route |
- 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.
| Feature | Classful (No VLSM) | CIDR with VLSM |
|---|---|---|
| Subnet mask sizes | One fixed mask per class | Any mask, any size |
| IP efficiency | Very wasteful | Maximum efficiency |
| Routing protocols | RIP v1 (classful only) | OSPF, RIPv2, EIGRP, BGP |
| Example use | All 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
2ʰ − 2 ≥ 100 → h=7 → 126 hosts → use /25 → allocate 192.168.10.0/25 (.0–.127)
2ʰ − 2 ≥ 50 → h=6 → 62 hosts → use /26 → allocate 192.168.10.128/26 (.128–.191)
2ʰ − 2 ≥ 2 → h=2 → use /30 → allocate 192.168.10.192/30 (.192–.195)
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 Network | Borrow | New Prefix | Subnets | Hosts Each |
|---|---|---|---|---|
| 192.168.1.0/24 | 1 bit | /25 | 2 | 126 |
| 192.168.1.0/24 | 2 bits | /26 | 4 | 62 |
| 192.168.1.0/24 | 3 bits | /27 | 8 | 30 |
| 192.168.1.0/24 | 4 bits | /28 | 16 | 14 |
- 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 Combined | Count | New Supernet Mask | Mask (dotted) | Total IPs |
|---|---|---|---|---|
| 192.168.0.0/24 + .1.0/24 | 2 | /23 | 255.255.254.0 | 512 |
| 192.168.0.0/24 → .3.0/24 | 4 | /22 | 255.255.252.0 | 1,024 |
| 192.168.0.0/24 → .7.0/24 | 8 | /21 | 255.255.248.0 | 2,048 |
| 192.168.0.0/24 → .15.0/24 | 16 | /20 | 255.255.240.0 | 4,096 |
| 192.168.0.0/24 → .31.0/24 | 32 | /19 | 255.255.224.0 | 8,192 |
- 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
| Aspect | Classful Addressing | Classless (CIDR) |
|---|---|---|
| Year introduced | 1981 (RFC 791) | 1993 (RFC 1519) |
| Subnet mask | Fixed (A=/8, B=/16, C=/24) | Variable — any /0 to /32 |
| IP efficiency | Highly wasteful | Very efficient |
| VLSM support | ❌ Not supported | ✅ Full VLSM support |
| Routing table | Large (class-based entries) | Small (aggregated) |
| Route aggregation | ❌ Not possible | ✅ Core feature |
| Routing protocols | RIP v1, IGRP | RIPv2, OSPF, EIGRP, BGP |
| Prefix in routing | Implied by class | Explicit prefix length |
| Status today | Obsolete / Legacy | Industry standard |
| Subnetting | Only classful subnetting | Any prefix subnetting |
| IP exhaustion | Accelerated wastage | Slowed down exhaustion |
| RFC | RFC 791 | RFC 1519 (updated RFC 4632) |
Practice TheseWorked Examples
📌 Example 1 — How many hosts in 192.168.1.0/27?
32 − 27 = 5 host bits
2⁵ − 2 = 32 − 2 = 30 usable hosts
Mask = 255.255.255.224 → Block = 256−224 = 32 → 8 subnets from /24
📌 Example 2 — Supernet: What mask combines 192.168.4.0/24 to 192.168.7.0/24?
4 consecutive /24 networks (.4, .5, .6, .7)
4 = 2² → reduce prefix by 2 bits
/24 − 2 = /22 → 192.168.4.0/22
📌 Example 3 — Find Network ID and Broadcast for 10.10.5.77/28
Mask = 255.255.255.240 → Block = 256−240 = 16
Blocks: .64–.79, .80–.95… → .77 is in .64 block
Network = 10.10.5.64 | Broadcast = .64 + 16 − 1 = 10.10.5.79
Tap Any Option to Reveal AnswerMCQ Practice — 30 Questions
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
