From absolute beginner to subnetting mastery
Student Note: This guide is designed to take you from zero knowledge to complete understanding. Follow along with all the interactive elements!
An IP (Internet Protocol) address is a unique identifier assigned to each device on a network. It serves two main purposes:
IPv4 addresses are 32-bit numbers typically represented in dotted-decimal notation:
Each octet (number between dots) represents 8 bits, ranging from 0 to 255.
Class | Range | Purpose |
---|---|---|
A | 1.0.0.0 - 126.255.255.255 | Large networks |
B | 128.0.0.0 - 191.255.255.255 | Medium networks |
C | 192.0.0.0 - 223.255.255.255 | Small networks |
Identifies the network itself (host bits all 0s)
Sends to all hosts on network (host bits all 1s)
Think of an IP address like a phone number: the area code identifies the network (city), and the local number identifies the specific device (house).
Computers communicate in binary (base-2), using only 0s and 1s. Understanding binary is crucial because:
Each binary digit represents a power of 2:
Add up the values where there's a 1: 128 + 64 = 192
Find the largest power of 2 that fits, then subtract and repeat:
Practice converting between decimal and binary until you can do it quickly. Start by memorizing the powers of 2: 128, 64, 32, 16, 8, 4, 2, 1.
A subnet mask is a 32-bit number that divides an IP address into network and host portions. It works like a filter:
The line separates network bits (left) from host bits (right)
CIDR | Subnet Mask | Class |
---|---|---|
/8 | 255.0.0.0 | A |
/16 | 255.255.0.0 | B |
/24 | 255.255.255.0 | C |
When applied to an IP address, the subnet mask determines:
Think of the subnet mask as a stencil that reveals only the network portion of an IP address when you "press" it against the address.
Classless Inter-Domain Routing (CIDR) is a method for allocating IP addresses and routing Internet Protocol packets. It replaces the older classful network architecture.
CIDR represents the subnet mask as a suffix indicating the number of network bits:
Where 192.168.1.0 is the network address and 24 is the number of network bits.
Approach | Flexibility | Efficiency |
---|---|---|
Classful | Fixed sizes (A, B, C) | Wastes addresses |
CIDR | Any size needed | Optimizes usage |
CIDR notation is just a shorthand way to represent subnet masks. The number after the slash tells you how many 1s are in the subnet mask's binary representation.
Subnetting involves borrowing bits from the host portion to create additional network portions. Here's the complete process:
Identify your subnetting needs:
Select the network address you'll be subnetting:
This gives us 254 usable host addresses (2^8 - 2).
Determine how many bits to borrow from the host portion:
Calculate the new subnet mask based on borrowed bits:
This gives us 8 subnets (2^3) with 30 hosts each (2^5 - 2).
Determine the network address, host range, and broadcast address for each subnet:
Subnet | Network Address | Host Range | Broadcast |
---|
Always double-check your calculations! A common mistake is forgetting to account for the network and broadcast addresses when counting hosts.
Let's work through some practical examples to solidify your understanding:
Scenario: You have been assigned 192.168.10.0/24. You need to create:
Scenario: You have 172.16.0.0/16. You need:
Scenario: You have 10.0.0.0/8. Create subnets for:
Practice is key! Work through as many examples as you can find. Start with simple cases and gradually increase complexity.
Once you've mastered the fundamentals, these advanced concepts will deepen your understanding:
VLSM allows different subnets to have different subnet masks within the same network, optimizing address space:
Key Benefit: More efficient use of IP space by assigning appropriately sized subnets.
The opposite of subnetting - combining multiple networks into a larger one:
Key Benefit: Reduces routing table size in core routers.
IPv6 uses a different approach with its 128-bit addresses:
Key Difference: IPv6 subnetting is simpler as address space is abundant.
Used in routing protocols and ACLs, they're the inverse of subnet masks:
Master basic subnetting before moving to these advanced topics. They build on the same fundamental concepts you've already learned.
Test your knowledge with these interactive tools:
What is the network address for 192.168.5.37/27?
Regular practice is the best way to master subnetting. Try to work through a few problems every day until the process becomes second nature.