Back to course

Introduction to Subnetting (Why and How)

Networking Fundamentals: The 0 to Hero Guide

Lesson 36: Introduction to Subnetting (Why and How)

Subnetting is the practice of logically dividing a single large network into smaller, more efficient sub-networks (subnets).

Why Subnet?

  1. Reduce Broadcast Traffic: Smaller subnets mean smaller broadcast domains. This reduces network congestion and saves CPU resources on hosts.
  2. Security: Subnets allow administrators to isolate traffic. If one subnet is compromised, the others remain protected.
  3. Organization/Management: It mirrors the physical layout of the organization (e.g., separating the Accounting department from the Marketing department).
  4. IP Address Conservation (Historically): While less relevant today due to CIDR, subnetting originally allowed large Class A or B networks to be divided efficiently without wasting large blocks of host addresses.

The Mechanics of Subnetting (Stealing Bits)

Subnetting is achieved by borrowing bits from the Host portion of the IP address and dedicating them to the Network ID. These borrowed bits create additional subnets.

  • When we borrow a host bit, we change the corresponding 0 in the subnet mask to a 1 (e.g., changing 0 to 128 in decimal).
  • The number of subnets created is calculated by $2^S$, where $S$ is the number of borrowed bits.
  • The number of usable hosts per subnet is calculated by $2^H - 2$, where $H$ is the remaining host bits (we subtract 2 for the Network and Broadcast addresses).

Example: Borrowing 2 bits from a Class C network creates $2^2 = 4$ subnets.