🔗

Understanding Subnetting and IP Addressing

Apr 23, 2025

Subnetting and IP Addressing Scheme

Introduction

  • Understanding subnetting masks, CIDR block notation, and IPv4 fundamentals.
  • Objective: Develop an IP addressing scheme with more than one network address supporting 40 devices per subnet.

Given Network Details

  • IP Address: 192.168.1.0/24
  • Default Subnet Mask: 255.255.255.0
    • One network with 254 hosts.

Subnetting Steps

  1. Borrowing Bits from Host Side:

    • SL/25: Subnet Mask 255.255.255.128 -> 2 networks with 126 hosts.
    • SL/26: Subnet Mask 255.255.255.192 -> 4 networks with 62 hosts.
    • SL/27: Subnet Mask 255.255.255.224 -> 8 networks with 30 hosts.
  2. Optimal Subnet:

    • SL/26 provides 4 networks, 62 hosts each (best for 40 devices).

Calculations Using Powers of Two

  • Network Address: 192.168.1.0
  • Subnet Mask: 255.255.255.192
  • 2^2 = 4 networks
  • 2^6 - 2 = 62 hosts/subnet

Magic Number Method

  • Purpose: Simplify subnet calculations.
  • Key Information Needed:
    1. Network Address/Subnet ID
    2. Broadcast Address
    3. First and Last Available Host Addresses

Calculating Using Magic Number Method

  • Steps:
    1. Convert subnet mask to decimal.
    2. Identify 'Interesting Octet'.
    3. Calculate Magic Number: 256 - Interesting Octet.
    4. Calculate Host Range.
    5. Determine Network and Broadcast Addresses.

Example Calculations

  • IP Address: 165.24.77.14 with Subnet Mask 255.255.240.0

    • Subnet ID: 165.24.64.0
    • Broadcast Address: 165.24.79.255
    • First Host: 165.24.64.1
    • Last Host: 165.24.79.254
  • Another IP Example: 10.180.1.122 with Subnet Mask 255.240.0.0

    • Subnet ID: 10.176.0.0
    • Broadcast Address: 10.183.255.255
    • First Host: 10.176.0.1
    • Last Host: 10.183.255.254

Using a Predefined Chart

  • Simplifies calculations with preset values for interesting octets.
  • Example: 172.16.24.233/27
    • Subnet Mask for Octet 4: 224
    • Magic Number: 32
    • Subnet: 172.16.24.128
    • Broadcast: 172.16.24.159
    • First IP: 172.16.24.129
    • Last IP: 172.16.24.158

Conclusion

  • Magic Number Method is efficient and avoids binary-decimal conversion.
  • Predefined charts can further speed up the process.