🌐

Understanding CIDR and Classless Subnetting

Apr 23, 2025

Lecture Notes: Classless Subnetting and CIDR Notation

Overview

  • Transition from class-based to classless subnetting since 1993.
  • Classless subnetting allows for flexible subnet mask allocation beyond traditional Class A, B, C.
  • Uses CIDR (Classless Inter-Domain Routing) notation.

Key Concepts

CIDR Notation

  • Subnet masks are expressed as a count of leading 1 bits.
  • Example:
    • Decimal 255.0.0.0 equivalent to /8 in CIDR.
    • 192.168.1.44/24 implies a subnet mask of 255.255.255.0.

Configuration Practices

  • Devices often require subnet mask in different formats:
    • Operating systems (e.g., Windows) may require decimal format.
    • Routers/switches may use CIDR notation.
  • Check device documentation for format preferences.

Subnet Masks

Binary and Decimal Conversion

  • Subnet masks use contiguous 1s followed by 0s.
  • Example Conversion:
    • 11111111.11111111.11111111.00000000 to Decimal: 255.255.255.0 and CIDR: /24

Examples of CIDR Conversion

Example 1:

  • Subnet with all 1s in first two octets.
  • Binary: 11111111.11111111.00000000.00000000
  • Decimal: 255.255.0.0
  • CIDR: /16

Example 2:

  • Subnet with first three octets all 1s, and two 1s in fourth octet.
  • Binary: 11111111.11111111.11111111.11000000
  • Decimal: 255.255.255.192
  • CIDR: /26

Example 3:

  • Subnet with first octet all 1s, second octet with four 1s.
  • Binary: 11111111.11110000.00000000.00000000
  • Decimal: 255.240.0.0
  • CIDR: /12

CIDR Notation to Decimal

  • Reference chart for binary to decimal conversion for each octet.
  • Example:
    • /19 translates to binary 11111111.11111111.11100000.00000000
    • Decimal: 255.255.224.0

Application and Reverse Calculation

Calculating from CIDR to Binary

  • Example: /26 implies three full octets of 1s and two 1s in the fourth octet.
  • Binary: 11111111.11111111.11111111.11000000
  • Decimal: 255.255.255.192

Reverse Example

  • Given CIDR /20, convert to binary and decimal.
  • Binary: 11111111.11111111.11110000.00000000
  • Decimal: 255.255.240.0

Conclusion

  • CIDR notation simplifies subnetting by focusing on the number of 1s in the subnet mask.
  • Understanding binary to decimal conversion is crucial for network configuration.
  • Use charts for efficient conversion between formats.