1. Classful Addressing
- Old system (before 1993).
- IPs are divided into predefined classes (A–E).
- Fixed subnet mask per class.
| Class | Range | Default Mask | Purpose |
|---|---|---|---|
| A | 1.0.0.0 – 126.255.255.255 | 255.0.0.0 (/8) | Large networks |
| B | 128.0.0.0 – 191.255.255.255 | 255.255.0.0 (/16) | Medium |
| C | 192.0.0.0 – 223.255.255.255 | 255.255.255.0 (/24) | Small |
| D | 224.0.0.0 – 239.255.255.255 | N/A | Multicast |
| E | 240.0.0.0 – 255.255.255.255 | N/A | Experimental |
⚠️ Problem: Wastes IPs (e.g., Class A gives ~16M addresses even if only a few are needed).
2. Classless Addressing (CIDR – Classless Inter-Domain Routing)
- Introduced in 1993 to replace Classful.
- Uses Variable-Length Subnet Masks (VLSM).
- CIDR Notation:
IP/prefix→ e.g.,192.168.1.0/26.
👉 /26 = first 26 bits for network, rest for hosts.
👉 Hosts = 2(32−prefix)−22^{(32-prefix)} – 22(32−prefix)−2.
3. CIDR Table (Must Memorise)
| Prefix | Subnet Mask | Hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
4. Subnetting (Breaking a Network)
Subnetting means dividing a big network into smaller networks.
👉 Like cutting a big cake into smaller pieces so more people can get their own piece.
Why do we subnet?
| Reason | Simple Meaning |
|---|---|
| Save IP addresses | Avoid wasting IPs |
| Improve security | Separate departments or devices |
| Reduce traffic | Each subnet has fewer devices |
| Better management | Easy to control networks |
Key idea
In subnetting, we borrow bits from the host part of an IP to create more networks.
Example with a /24 network:
- Original network: 192.168.1.0/24
- Usable hosts: 254 hosts (big network)
If we subnet (example /26):
- New mask: 255.255.255.192 (/26)
- Each subnet has 64 total addresses
- Usable hosts = 62 per subnet
- We get 4 smaller subnets
Simple Formula
Hosts per subnet = 2^(Host bits) – 2
Super Simple Example
You have a class with 50 students but the room capacity is 200.
- Big room = /24
- Instead you divide students into 4 rooms with 50 each = /26
In one line
👉 Subnetting = splitting one large network into many smaller networks by changing the subnet mask.
Quick Memory Trick
| CIDR | Mask | Hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
Ultra-short answer (2 lines)
Subnetting is dividing a large IP network into smaller logical networks.
It improves security, reduces traffic, and saves IP addresses.
5. Supernetting (Combining Networks)
Supernetting means combining multiple small networks into one bigger network.
👉 Opposite of subnetting
(Subnetting = divide | Supernetting = combine)
Why do we use Supernetting?
| Reason | Simple Meaning |
|---|---|
| Reduce routing tables | Fewer entries = faster routing |
| Improve routing efficiency | Saves memory & CPU in routers |
| Aggregate networks | Combine many networks into one summarized route |
| Simplify management | Easy to handle routing |
Example
Suppose we have 4 Class C networks:
192.168.0.0/24
192.168.1.0/24
192.168.2.0/24
192.168.3.0/24
Instead of writing 4 separate routes, we combine them:
Supernet: 192.168.0.0/22
So router needs only one entry instead of four.
Real-Life Example
Imagine you have four small notebooks for subjects; carrying all is difficult.
So you combine them into one big notebook → easier to carry.
In One Line
👉 Supernetting = merging multiple networks into one bigger summarized network to reduce routing entries.
Key Points
| Term | Meaning |
|---|---|
| Route Aggregation | Another name for supernetting |
| CIDR | Classless inter-domain routing (used for supernetting) |
| Done on | Public networks / ISPs mostly |
| Opposite of | Subnetting |
Quick difference
| Subnetting | Supernetting |
|---|---|
| Divide a network | Combine networks |
| Smaller networks | Larger network |
| Adds routing entries | Reduces routing entries |
Ultra-short answer (for exams)
Supernetting is the process of combining multiple contiguous networks into a single larger network using CIDR to reduce routing table size.
6. Key Terms
- VLSM: Different masks for different subnets.
- Aggregation: Combine networks → reduces routing entries.
- Formula for Hosts: 2(32−prefix)−22^{(32 – \text{prefix})} – 22(32−prefix)−2.
7. Quick Comparison Table
| Aspect | Classful | Classless (CIDR) |
|---|---|---|
| Subnet Mask | Fixed (A, B, C) | Variable (VLSM) |
| Efficiency | Wastes IPs | Efficient |
| Routing | Complex | Easier (aggregation) |
| Usage Today | Obsolete | Widely used |
✅ Exam Tips:
- If they ask about default masks → A = /8, B = /16, C = /24.
- If they ask about hosts in /26 → Formula → 2(32−26)−2=622^{(32-26)}-2 = 622(32−26)−2=62.
- CIDR = flexible, efficient, modern.
MCQ
1. In classful addressing, how many bits are used for the network portion in a Class A address?
- A. 8 bits
- B. 16 bits
- C. 24 bits
- D. 32 bits
Answer: A
2. What is the default subnet mask for a Class B IP address?
- A. 255.0.0.0
- B. 255.255.0.0
- C. 255.255.255.0
- D. 255.255.255.255
Answer: B
3. What is the purpose of CIDR (Classless Inter-Domain Routing)?
- A. To eliminate private IP addresses
- B. To enable more efficient use of IP address space
- C. To support only IPv6 addressing
- D. To simplify subnetting in IPv4
Answer: B
4. Which of the following CIDR notations represents the largest possible subnet?
- A. /30
- B. /24
- C. /8
- D. /32
Answer: C
5. Which address range is assigned to Class C in classful addressing?
- A. 0.0.0.0 to 127.255.255.255
- B. 128.0.0.0 to 191.255.255.255
- C. 192.0.0.0 to 223.255.255.255
- D. 224.0.0.0 to 239.255.255.255
Answer: C
6. In classful addressing, what is the maximum number of hosts that can be assigned to a Class A network?
- A. 254
- B. 65,534
- C. 16,777,214
- D. 2,097,152
Answer: C
7. What is the subnet mask for the CIDR notation 192.168.1.0/27?
- A. 255.255.255.128
- B. 255.255.255.224
- C. 255.255.255.0
- D. 255.255.255.252
Answer: B
8. Which of the following is true about Classless Addressing (CIDR)?
- A. It uses fixed subnet masks.
- B. It allows flexible and efficient address allocation.
- C. It is only applicable for IPv6.
- D. It uses classes to define IP address ranges.
Answer: B
9. What does the notation 192.168.1.0/24 represent?
- A. A network with 24 hosts
- B. A network with 256 hosts, and 254 usable IPs
- C. A Class B network
- D. A network with 16 bits allocated for hosts
Answer: B
10. In CIDR notation, what does the “/24” represent?
- A. 24 bits for the host portion
- B. 24 bits for the network portion
- C. The number of subnets in the network
- D. The number of possible IP addresses in the subnet
Answer: B
11. What is the subnet mask for a Class B network in classful addressing?
- A. 255.255.255.0
- B. 255.0.0.0
- C. 255.255.0.0
- D. 255.255.255.255
Answer: C
12. What is the total number of IP addresses available in the network 10.0.0.0/8?
- A. 256
- B. 65,536
- C. 16,777,216
- D. 4,294,967,296
Answer: C
13. In CIDR, what does the prefix “/16” signify?
- A. 16 bits are used for the network portion
- B. 16 bits are used for the host portion
- C. The network can have 16 subnets
- D. The network can have 16 hosts
Answer: A
14. Which of the following represents a supernet?
- A. Combining multiple /24 subnets into a /23 network
- B. Dividing a /8 network into smaller /24 subnets
- C. Using more bits for the host portion
- D. Using the full 32 bits for an address
Answer: A
15. Which IPv4 class is used for multicast traffic?
- A. Class A
- B. Class B
- C. Class C
- D. Class D
Answer: D
16. What is the advantage of CIDR over classful addressing?
- A. More predictable and easier routing
- B. Flexible IP address allocation
- C. Reduced need for IP address translation
- D. Fewer subnets
Answer: B
17. Which is the correct CIDR notation for the subnet mask 255.255.255.192?
- A. /26
- B. /27
- C. /28
- D. /29
Answer: A
18. How many subnets are created by using a /30 CIDR in the 192.168.1.0 network?
- A. 2
- B. 4
- C. 8
- D. 16
Answer: B
19. What is the major disadvantage of classful addressing?
- A. It supports only IPv6.
- B. It leads to inefficient IP address utilization.
- C. It requires too many bits for large networks.
- D. It allows dynamic IP address assignment.
Answer: B
20. What is the purpose of route aggregation in CIDR?
- A. To increase the size of routing tables
- B. To combine multiple routes into a single route
- C. To divide a network into smaller subnets
- D. To assign IP addresses automatically
Answer: B
