Understanding IP Address Subnetting Techniques

Aug 8, 2024

Lecture on Subnetting IP Addresses

Introduction

  • Overview of manually subnetting an IP address.
  • Common scenario: given an IP address (e.g., 192.16) and needing a scheme for multiple networks supporting 40 devices per subnet.

Manual Calculation Method

  • Convert CIDR notation to decimal mask.
  • Write out binary version of subnet mask.
  • Calculate the number of networks and hosts per network.
  • Identify network, subnet, and host bits.
  • Example:
    • 24 network bits, 2 subnet bits, 6 host bits.
    • Total subnets: 2^2 = 4.
    • Hosts per subnet: 2^6 - 2 = 62.
  • Important addresses:
    • Network Address (Subnet ID)
    • Broadcast Address
    • First Available Host Address
    • Last Available Host Address.

The Magic Number Method

  • Shortcut for the subnetting process.
  • Requires minimal math, can often be done in the head.
  • Useful charts:
    • CIDR block notations and their decimal masks.
    • Ranges of hosts per subnet.

Steps for Magic Number Method

  1. Convert the subnet mask to decimal.
  2. Identify the 'interesting octet'.
  3. Calculate the magic number (256 - subnet mask value in interesting octet).
  4. Calculate the host range, network address, and broadcast address.

Example Calculations

Example 1

  • IP Address: 165.245.77.14
  • Subnet Mask: 255.255.240.0
  • Process:
    • Copy IP if subnet mask is 255; copy zero if subnet mask is 0.
    • Calculate magic number: 256 - 240 = 16.
    • Determine subnet ID: 165.245.64.0.
    • Calculate broadcast address: 64 + 16 - 1 = 79 → 165.245.79.255.
    • First host: 165.245.64.1
    • Last host: 165.245.79.254

Example 2

  • IP Address: 10.180.122.244
  • Subnet Mask: 255.248.0.0
  • Process:
    • Subnet mask 255 → copy IP; zero → copy zero.
    • Interesting octet: second octet (248).
    • Magic number: 256 - 248 = 8.
    • Subnet ID: 10.176.0.0.
    • Broadcast address: 176 + 8 - 1 = 183 → 10.183.255.255.
    • First host: 10.176.0.1
    • Last host: 10.183.255.254.

Using Pre-made Charts

  • Example: IP Address 172.16.242.133 with /27.
  • Subnet mask: 255.255.255.224.
  • Magic number: 32.
  • Subnet ID: 172.16.242.128.
  • Broadcast address: 128 + 32 - 1 = 159 → 172.16.242.159.
  • First host: 172.16.242.129.
  • Last host: 172.16.242.158.

Summary

  • Subnetting involves converting CIDR to decimal, finding subnet ID, broadcast, first and last host addresses.
  • Magic Number Method simplifies the process.
  • Practice is essential to become proficient and quick in subnetting calculations, especially for exams.