IPv4 Classes — Understanding Classful IP Addressing¶
In the early days of the Internet, IPv4 addresses were divided into predefined classes known as Class A, B, C, D, and E. Each class was designed to support networks of different sizes, from small organisations to global enterprises. Although modern networks primarily use CIDR (Classless Inter-Domain Routing), understanding IPv4 classes remains important because they are frequently discussed in networking courses, certification exams, and technical interviews. Every Linux administrator, DevOps engineer, Cloud Architect, Platform Engineer, Site Reliability Engineer (SRE), and Network Engineer should understand IPv4 classes and their historical significance.
Learning Path¶
Course Progress
What You'll Learn¶
After completing this lesson, you'll be able to:
- Understand IPv4 classful addressing
- Identify Class A, B, C, D, and E addresses
- Explain default subnet masks
- Calculate network and host capacities
- Understand why CIDR replaced classful networking
- Recognise IPv4 classes in real-world scenarios
Prerequisites¶
Complete:
Why Learn IPv4 Classes?¶
Before CIDR was introduced, routers determined the network size based on the first octet of an IP address.
Example:
Immediately tells us:
Similarly,
Although modern networking uses CIDR, understanding these classes makes subnetting and IP planning much easier.
What is Classful Addressing?¶
Classful Addressing divides the IPv4 address space into five predefined classes.
Each class has:
- A specific address range
- A default subnet mask
- A different number of networks
- A different number of hosts
IPv4 Class Overview¶
| Class | First Octet | Default Mask | Purpose |
|---|---|---|---|
| A | 1–126 | 255.0.0.0 (/8) | Very Large Networks |
| B | 128–191 | 255.255.0.0 (/16) | Medium Networks |
| C | 192–223 | 255.255.255.0 (/24) | Small Networks |
| D | 224–239 | N/A | Multicast |
| E | 240–255 | N/A | Experimental |
Class A¶
Range:
Default subnet mask:
Network bits:
Host bits:
Binary Pattern¶
Class A addresses always begin with:
Example:
Binary (first octet):
Leading bit:
Capacity¶
| Item | Value |
|---|---|
| Networks | 126 |
| Hosts per Network | 16,777,214 |
Formula:
(Two addresses are reserved: network and broadcast.)
Common Example¶
Widely used in:
- Large enterprises
- Cloud networks
- Data centres
Class B¶
Range:
Default subnet mask:
Network bits:
Host bits:
Binary Pattern¶
Class B addresses begin with:
Example:
Binary (first octet):
Leading bits:
Capacity¶
| Item | Value |
|---|---|
| Networks | 16,384 |
| Hosts per Network | 65,534 |
Formula:
Common Example¶
Often used by medium-sized organisations.
Class C¶
Range:
Default subnet mask:
Network bits:
Host bits:
Binary Pattern¶
Class C addresses begin with:
Example:
Binary (first octet):
Leading bits:
Capacity¶
| Item | Value |
|---|---|
| Networks | 2,097,152 |
| Hosts per Network | 254 |
Formula:
Common Example¶
Used in:
- Homes
- Small businesses
- Labs
Class D¶
Range:
Purpose:
Used for:
- Video streaming
- IPTV
- Routing protocols
- Group communication
Class D addresses are not assigned to individual hosts.
Class E¶
Range:
Purpose:
These addresses are generally not used in normal production networks.
Reserved Addresses¶
Some IPv4 addresses are reserved.
| Address | Purpose |
|---|---|
| 0.0.0.0 | Default/Unspecified |
| 127.0.0.0/8 | Loopback |
| 255.255.255.255 | Limited Broadcast |
These ranges have special meanings and cannot be assigned as normal host addresses.
Class Comparison¶
| Class | Network Bits | Host Bits | Default Mask |
|---|---|---|---|
| A | 8 | 24 | /8 |
| B | 16 | 16 | /16 |
| C | 24 | 8 | /24 |
Why Did Classful Addressing Fail?¶
Suppose a company needed:
Class C:
Class B:
This caused significant IP address wastage.
Introduction of CIDR¶
To solve address wastage, CIDR (Classless Inter-Domain Routing) was introduced.
Instead of:
CIDR allows:
Networks can now be sized according to actual requirements.
Real-World Examples¶
| IP Address | Class |
|---|---|
| 10.5.10.20 | A |
| 172.20.15.8 | B |
| 192.168.1.100 | C |
| 230.10.20.5 | D |
| 245.1.2.3 | E |
Production Perspective¶
Modern enterprise networks rarely use classful routing.
Instead, they rely on:
- CIDR
- Variable Length Subnet Masking (VLSM)
- Route Summarisation
However, understanding IPv4 classes helps interpret default masks and recognise private address ranges.
Cloud Perspective¶
Cloud providers use CIDR instead of classes.
Example Virtual Private Clouds (VPCs):
Although these ranges originate from Class A, B, and C private spaces, cloud networking treats them as flexible CIDR blocks.
Kubernetes Perspective¶
Kubernetes clusters also use CIDR.
Examples:
Classful boundaries are ignored in favour of CIDR notation.
Hands-on Lab¶
Task 1¶
Identify the class of the following IP addresses:
Task 2¶
Write the default subnet mask for:
- Class A
- Class B
- Class C
Task 3¶
Determine the network and host bits for each class.
Task 4¶
Display your IPv4 address.
Identify which historical class it belongs to.
Task 5¶
Convert the first octet of these addresses to binary and identify the class using the leading bits.
Task 6¶
Calculate the maximum number of hosts for:
- Class A
- Class B
- Class C
Task 7¶
Research why CIDR replaced classful addressing and summarise the advantages.
Task 8¶
Create a comparison table showing Classes A–E, including:
- Address Range
- Default Mask
- Purpose
- Host Capacity
Binary Patterns¶
| Class | Leading Bits |
|---|---|
| A | 0 |
| B | 10 |
| C | 110 |
| D | 1110 |
| E | 1111 |
Linux Commands¶
| Command | Purpose |
|---|---|
ip addr | Display IP addresses |
hostname -I | Display assigned IPs |
ip route | Display routing table |
ping | Test connectivity |
Common Mistakes¶
❌ Thinking classes are used for modern routing.
✅ Modern routing uses CIDR.
❌ Confusing private ranges with classes.
✅ A class defines address structure; private ranges are reserved blocks.
❌ Memorising ranges without understanding default masks.
✅ Learn how masks relate to network and host bits.
❌ Assuming Class D hosts can be assigned to devices.
✅ Class D is reserved for multicast.
❌ Ignoring historical significance.
✅ Many certifications and interviews still reference IPv4 classes.
Best Practices¶
- Understand IPv4 classes before learning CIDR.
- Memorise the first-octet ranges for Classes A, B, and C.
- Learn the default subnet masks.
- Understand why CIDR replaced classful networking.
- Focus on concepts rather than memorisation alone.
Interview Questions¶
Beginner¶
- What are IPv4 address classes?
- What is the default subnet mask for Class C?
- Which class is used for multicast?
- Which class contains the address 172.16.10.5?
Intermediate¶
- Compare Class A, B, and C addressing.
- Why was Classful Addressing inefficient?
- Explain the purpose of Classes D and E.
- How many hosts can a Class C network support?
Architect Level¶
- Why did the Internet transition from classful addressing to CIDR?
- How does CIDR improve address utilisation?
- Why is understanding IPv4 classes still valuable in enterprise networking?
Summary¶
In this lesson, you learned:
- IPv4 Classes A–E
- Address ranges
- Default subnet masks
- Network and host capacities
- Binary class identification
- Limitations of classful addressing
- Why CIDR replaced classful networking
Although modern networking uses CIDR, IPv4 classes remain an important foundational concept. Understanding how addresses were historically divided helps explain subnet masks, private address ranges, and the evolution of IP addressing.
Key Takeaways¶
- IPv4 originally used five address classes.
- Class A, B, and C were used for host addressing.
- Class D is reserved for multicast.
- Class E is reserved for experimental purposes.
- CIDR replaced classful addressing to improve IP address utilisation.