Classful and Classless addressing (CIDR)

1. Classful Addressing

  • Definition: IP addresses are divided into predefined classes (A, B, C, D, E), based on fixed prefix lengths.
  • Structure: Each class has a specific default subnet mask.

Classes Overview

ClassRangeDefault Subnet MaskPurpose
A1.0.0.0 to 126.255.255.255255.0.0.0 (8 bits)Large networks
B128.0.0.0 to 191.255.255.255255.255.0.0 (16 bits)Medium networks
C192.0.0.0 to 223.255.255.255255.255.255.0 (24 bits)Small networks
D224.0.0.0 to 239.255.255.255N/AMulticast
E240.0.0.0 to 255.255.255.255N/AExperimental

Key Points

  • Easy to understand but inefficient in address allocation.
  • Fixed boundaries lead to wasted IP addresses.

2. Classless Addressing (CIDR – Classless Inter-Domain Routing)

  • Definition: Allows flexible division of IP address space by using variable-length subnet masks (VLSM).
  • CIDR Notation: Represents IP address with a prefix (e.g., 192.168.1.0/24).
  • /24 means the first 24 bits are used for the network portion.

Benefits of CIDR

  1. Efficient Address Allocation: Reduces wasted IP addresses.
  2. Scalability: Supports both small and large networks.
  3. Simplifies Routing: Aggregates multiple routes (route summarization).

Example

  • 192.168.1.0/26:
  • Subnet Mask: 255.255.255.192.
  • Hosts: 2^(32-26) = 64 – 2 = 62 hosts.

3. Key Differences

FeatureClassful AddressingClassless Addressing (CIDR)
Address ClassesDivided into classes (A, B, C)No fixed classes
Subnet MaskDefault and fixedVariable-length (VLSM)
EfficiencyWastes IP addressesEfficient utilization
RoutingMore complexSimplified (aggregation)

4. CIDR Notation Table

PrefixSubnet Mask# of Hosts
/24255.255.255.0256 – 2 = 254
/25255.255.255.128128 – 2 = 126
/26255.255.255.19264 – 2 = 62
/27255.255.255.22432 – 2 = 30
/28255.255.255.24016 – 2 = 14

5. Subnetting in CIDR

  • Goal: Divide a large network into smaller sub-networks.
  • Example:
  • Network: 192.168.1.0/24.
  • Subnet into 4 smaller networks:
    • 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/26.

6. Supernetting in CIDR

  • Goal: Combine smaller networks into a larger one to reduce routing table entries.
  • Example:
  • Combine 192.168.0.0/24 and 192.168.1.0/24 into a single route:
    • Result: 192.168.0.0/23.

7. Key Terms to Remember

  • VLSM (Variable-Length Subnet Mask): Assigns subnet masks of different lengths to different subnets.
  • Subnet Mask: Defines how many bits are used for the network portion.
  • Aggregation: Combining multiple smaller networks into a larger one.
  • Host Calculation:
  • Formula: ( 2^{(32 – \text{prefix})} – 2 ).

8. Quick Comparison

AspectClassful AddressingClassless Addressing (CIDR)
SimplicitySimple but rigidFlexible and efficient
Address WastageHighLow
Use TodayObsoleteWidely used

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