🔢

Subnetting Techniques and Magic Number Method

Aug 6, 2024

Subnetting and the Magic Number Method

Overview

  • Manual subnetting process
    • Writing down CIDR notation
    • Determining decimal mask
    • Binary version of subnet mask
    • Calculate number of networks and hosts per network

Given Task

  • Network with IP address 192.16 needing subnetting
  • Requirement: More than one network, 40 devices per subnet
  • Manually create a chart to determine hosts per subnet
  • Slash 27 supports 30 devices per subnet, Slash 26 supports 62 hosts per network on four subnets

Manual Calculations

  • Write binary version of IP address and subnet mask
  • Determine network part, subnet bits, 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

Key Addresses to Determine

  • Network address (subnet ID)
  • Broadcast address
  • First available host address
  • Last available host address

Challenges

  • Time-consuming calculations
  • Need shortcut for exam efficiency

Magic Number Method

  • Shortcut for subnetting
  • Perform most calculations mentally or with minimal math
  • Useful charts can assist

Creating Useful Charts

  • Write down CIDR block notations and corresponding decimal subnet mask
  • Identify repeating values (e.g., 255.128.0.0 for /9 and /17)
  • Use shortcuts from these patterns
  • Creating charts showing interesting octets and magic numbers (128, 64, 32, etc.)
  • Separation of host ranges for easy reference

Steps in Magic Number Method

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

Example Calculation

  1. Identify Subnet ID
    • IP address: 165.245.77.14
    • Subnet mask: 255.255.240.0
    • Interesting octet: 240
    • Magic number: 256 - 240 = 16
  2. Calculate Broadcast Address
    • Subnet ID: 165.245.64.0
    • Add magic number, subtract 1 for broadcast: 64 + 16 - 1 = 79
    • Broadcast address: 165.245.79.255
  3. Determine Host Range
    • First host: Subnet ID + 1 = 165.245.64.1
    • Last host: Broadcast address - 1 = 165.245.79.254

Another Example Using Shortcuts

  • IP address: 10.180.122.244
  • Subnet mask: 255.248.0.0
  • Interesting octet: Second octet, value 248
  • Magic number: 256 - 248 = 8
  • Subnet ID: 10.176.0.0
  • Broadcast address: 10.183.255.255
  • Host range: First host = 10.176.0.1, Last host = 10.183.255.254

Final Summary

  • Example IP: 172.16.242.133
  • CIDR /27
  • Subnet mask: 255.255.255.224
  • Magic number: 32
  • Subnet ID: 172.16.242.128
  • Broadcast address: 172.16.242.159
  • Host range: First host = 172.16.242.129, Last host = 172.16.242.158

Practice Recommendation

  • Practice with different IP addresses and CIDR notations
  • Identify shortcuts
  • Perform subnetting tasks quickly for exams