---
title: "Classful and classless addressing"
subject: "Computer Networks and Security"
chapter: 4
key: "semester_7/computer_networks_and_security:classful-classless-address"
source: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/classful-classless-address
site: BCT Engineering
---

# Classful and classless addressing

Computer Networks and Security · Chapter 4: Network Layer

- Asked in: 2074 Asoj
- Video: [Classful vs. Classless IP Networks](https://www.youtube.com/watch?v=HWOBUUtvRkY) — Prowse Tech
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/computer_networks_and_security/classful-classless-address
- Whole chapter: https://www.bctengineer.com/md/semester_7/computer_networks_and_security/chapter-4

## Question

What is classful and classless address?

## Short answer

Classful addressing divides IPv4 into fixed classes A-E with rigid network/host boundaries, causing address waste. Classless (CIDR) uses variable prefix lengths (/n) allowing any block size, enabling VLSM and route aggregation to reduce routing tables and conserve addresses. Example: 192.168.8.0/22 provides 1024 addresses with mask 255.255.252.0.

## Answer

#### Classful addressing
In classful IPv4 addressing the 32-bit address space is divided into **five fixed classes** (A to E). The network part (netid) and host part (hostid) have a fixed boundary by class, identified by the leading bits.

| Class | First bits | First octet | Netid / Hostid | Default mask | Hosts per network |
|---|---|---|---|---|---|
| A | 0 | 1 to 126 | 8 / 24 | 255.0.0.0 | 16,777,214 |
| B | 10 | 128 to 191 | 16 / 16 | 255.255.0.0 | 65,534 |
| C | 110 | 192 to 223 | 24 / 8 | 255.255.255.0 | 254 |
| D | 1110 | 224 to 239 | Multicast | | |
| E | 1111 | 240 to 255 | Reserved | | |

Problem: it is wasteful. A company needing 500 hosts gets a class B (65,534 hosts) and the rest are wasted, so the address space was soon exhausted.

#### Classless addressing (CIDR)
In classless addressing (Classless Inter-Domain Routing), the classes are ignored. A block of addresses of any size (power of 2) is given, and the **prefix length** is written as /n: for example **192.168.8.0/22** (1,024 addresses, 192.168.8.0 to 192.168.11.255). The mask can be any length from /0 to /32, so the network/host boundary can be anywhere.

- Block size is 2^(32 − n); the first address must be divisible by the block size.
- Allows **VLSM** and **route aggregation** (supernetting), which reduces routing table size.
- Saves addresses: 500 hosts needs a /23 (512 addresses).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is Class B's default mask and first-octet range?
   A. 255.0.0.0, 1-126
   B. 255.255.0.0, 128-191
   C. 255.255.255.0, 192-223
   D. 255.255.0.0, 224-239
   Answer: B. Class B: leading bits 10, 16/16. (Key point: Class B)

2. Why is classful wasteful?
   A. Too many classes
   B. A 500-host company gets a class B with 65,534 addresses
   C. Masks vary
   D. No masks
   Answer: B. Fixed sizes waste addresses. (Key point: Classful problem)

3. In CIDR, 500 hosts needs which prefix?
   A. /22
   B. /23
   C. /24
   D. /16
   Answer: B. /23 gives 512 addresses. (Key point: CIDR)

4. CIDR allows:
   A. Fixed classes
   B. VLSM and route aggregation
   C. Only /8, /16, /24
   D. Class D
   Answer: B. Aggregation reduces routing tables. (Key point: Benefits)

## Related in Computer Networks and Security

- [Need of classless IP addressing](https://www.bctengineer.com/question.md?key=semester_7%2Fcomputer_networks_and_security%3Aclassless-need-example) — Computer Networks and Security, chapter 4
