Classless Inter-Domain Routing (CIDR)

1.7 Given a scenario, use appropriate IPv4 network addressing

Subnetting

📘CompTIA Network+ (N10-009)


1. What is CIDR?

CIDR stands for Classless Inter-Domain Routing.

It is a method used to allocate IP addresses more efficiently than the old system, which was based on IP classes (Class A, B, C). CIDR allows networks to be divided into smaller or larger segments without being limited to the traditional class sizes.

  • Old “classful” IP addressing wasted IP addresses.
  • CIDR solves this by letting network administrators define prefix lengths that fit the actual number of hosts needed.

2. How CIDR Works

CIDR replaces the old “Class A/B/C” system with a prefix notation, also called CIDR notation.

Format:

IP_address/prefix_length
  • IP_address: the network address (e.g., 192.168.1.0)
  • prefix_length: number of bits used for the network portion (e.g., /24)

Example:

192.168.1.0/24
  • /24 means the first 24 bits are the network part.
  • The remaining 8 bits are for host addresses.
  • This allows for 256 IP addresses (2^8), minus 2 reserved addresses (network and broadcast), so 254 usable hosts.

3. CIDR vs Classful Addressing

FeatureClassfulCIDR
Network SizesFixed: A, B, CFlexible, any size
EfficiencyCan waste IPsUses IPs efficiently
Notation192.168.1.0 (class implied)192.168.1.0/24 (prefix defines size)
RoutingMore routes neededAggregation possible (fewer routes)

Key point: CIDR allows you to create networks that exactly match your needs without wasting IP addresses.


4. Calculating Networks with CIDR

To calculate networks, you need to understand how prefix length affects the number of hosts.

Formula for Hosts per Network

Number of hosts = 2^(32 - prefix_length) - 2
  • Subtract 2 for network address and broadcast address.

Example:

IP: 10.0.0.0/28
Prefix length: 28
Host bits = 32 - 28 = 4
Number of hosts = 2^4 - 2 = 14 usable hosts

Example:

IP: 192.168.1.0/26
Host bits = 32 - 26 = 6
Number of hosts = 2^6 - 2 = 62 usable hosts

5. Why CIDR is Used in IT Networks

CIDR has several practical IT uses:

  1. Efficient IP allocation:
    A company can create multiple subnets of the exact size they need.
    • Example: One subnet for 50 devices, one for 200 devices, without wasting IPs.
  2. Route aggregation:
    • Multiple smaller networks can be grouped into a single routing table entry.
    • Example: Instead of routing each /24 separately, you could route 192.168.0.0/22 to cover 192.168.0.0 to 192.168.3.255.
  3. Supports modern internet:
    • The internet uses CIDR to prevent routing tables from becoming too large.
  4. Subnetting within an organization:
    • IT administrators can segment departments efficiently:
      • /28 for small labs
      • /24 for medium departments
      • /22 for large branches

6. CIDR Notation Cheat Sheet for Exam

CIDRHost BitsUsable HostsNetwork Size
/3022Point-to-point links
/2936Small subnet
/28414Small subnet
/27530Medium subnet
/26662Medium subnet
/257126Large subnet
/248254Typical office subnet
/239510Large office or lab
/22101022Very large subnet

TIP for the exam: Know /24, /26, /28, /30 for subnetting questions.


7. Key Exam Points about CIDR

  1. CIDR replaces classful addressing.
  2. It uses prefix length (/xx) instead of class A/B/C.
  3. Efficient IP allocation → no wasted addresses.
  4. Allows subnetting and route aggregation.
  5. Formula for usable hosts: 2^(32 - prefix) - 2
  6. Common CIDR prefixes for subnetting practice: /30, /28, /26, /24.

8. Real IT Environment Example (for clarity)

Imagine an IT administrator managing an office network:

  • The HR department has 25 employees → assign 192.168.1.0/27 (30 usable IPs).
  • The IT lab has 10 devices → assign 192.168.1.32/28 (14 usable IPs).
  • The Main office has 200 employees → assign 192.168.0.0/24 + 192.168.1.0/24 or a single /23 subnet (510 hosts).

CIDR makes it easy to fit each subnet to the exact number of devices, saving IP addresses and simplifying routing.


Summary:
CIDR is about flexibility and efficiency. It’s essential for subnetting in modern networks and is heavily tested in Network+ exams. Understanding how to calculate host ranges, usable addresses, and applying prefix lengths is key to passing the exam.


Buy Me a Coffee