🌐

Subnetting Overview and Method

Jun 11, 2025

Overview

This lecture covers subnetting in IPv4, focusing on how to determine subnet masks and use the magic number method to quickly calculate network addresses, broadcast addresses, and host ranges.

Subnetting Requirements and Calculations

  • Subnetting divides a network into smaller subnets for efficient IP address usage.
  • Given 192.168.1.0/24, the goal is subnets that support at least 40 devices each.
  • Default /24 mask (255.255.255.0) provides 1 network with 254 hosts.
  • /25 mask allows 2 subnets with 126 hosts each.
  • /26 mask allows 4 subnets with 62 hosts each (suitable for 40 host requirement).
  • /27 mask gives 8 subnets but only 30 hosts each (insufficient).
  • Use powers of two to calculate networks: subnet bits = number of subnets; host bits = (2^bits)-2 hosts.

The Magic Number Method

  • The magic number method quickly finds subnet details without binary conversions.
  • Steps:
    1. Convert subnet mask to decimal.
    2. Identify the "interesting octet" (not 255 or 0 in mask).
    3. Magic number = 256 - value of interesting octet in subnet mask.
    4. Use magic number for block/range calculations.
    5. Find network/subnet ID: lowest address in range.
    6. Find broadcast address: (subnet ID in interesting octet) + magic number - 1.
    7. First host is subnet ID + 1; last host is broadcast - 1.

Example Calculations

  • For 165.245.77.14 with 255.255.240.0, interesting octet is third (240).
  • Magic number: 256 - 240 = 16.
  • Find subnet range, identify correct block for the host; calculate subnet ID and broadcast accordingly.
  • Repeat process for other examples with varying subnet masks and interesting octets.

Efficient Subnetting Tools

  • Charts compare CIDR notation, subnet mask, and magic number for each octet.
  • Predefined charts allow instant lookup without repeated calculation.

Key Terms & Definitions

  • Subnet Mask — A 32-bit number dividing IP addresses into network and host parts.
  • CIDR (Classless Inter-Domain Routing) Notation — Format like /24 indicating number of network bits.
  • Interesting Octet — The octet of the subnet mask not equal to 255 or 0, used for calculations.
  • Magic Number — The number used to determine subnet block size (256 minus subnet mask value in interesting octet).
  • Subnet ID — The first address in a subnet; also called network address.
  • Broadcast Address — The last address in a subnet, used for communication to all hosts in the subnet.
  • First/Last Host — Usable IP addresses, excluding subnet ID and broadcast.

Action Items / Next Steps

  • Practice the magic number method with different IP addresses and subnet masks.
  • Create or use subnetting charts for reference.
  • Review related subnetting readings and complete any assigned exercises.