Module 9: IP Addressing Deep Dive
This module takes you from basic IP understanding to complete mastery. You’ll learn to calculate subnets, understand CIDR notation, and deeply grasp how IP addressing works in real networks.Estimated Time: 4-5 hours
Difficulty: Intermediate
Prerequisites: Module 4 (Network Layer basics)
Difficulty: Intermediate
Prerequisites: Module 4 (Network Layer basics)
9.1 The Complete Picture of IP Addresses
What is an IP Address Really?
An IP address is a logical address assigned to a device on a network. Unlike MAC addresses (which are burned into hardware), IP addresses are:- Configurable: Can be changed
- Hierarchical: Contain network and host portions
- Routable: Used to find paths across networks
IPv4 Address Structure
A 32-bit number, typically shown in dotted-decimal notation:9.2 Network ID vs Host ID
Every IP address has two parts:| Part | Purpose | Analogy |
|---|---|---|
| Network ID | Identifies the network | Street name |
| Host ID | Identifies the specific device | House number |
Example
Mental Model: Think of the Network ID as your ZIP code (gets you to the right neighborhood) and Host ID as your street address (finds the exact house).
9.3 CIDR Notation Explained
CIDR (Classless Inter-Domain Routing) replaced the old class-based system. It uses a prefix length to indicate how many bits belong to the network portion.The Notation
Common CIDR Blocks
| CIDR | Subnet Mask | # of Hosts | Use Case |
|---|---|---|---|
| /32 | 255.255.255.255 | 1 | Single host |
| /31 | 255.255.255.254 | 2 | Point-to-point links |
| /30 | 255.255.255.252 | 2 | Point-to-point (with network/broadcast) |
| /29 | 255.255.255.248 | 6 | Tiny subnet |
| /28 | 255.255.255.240 | 14 | Small subnet |
| /27 | 255.255.255.224 | 30 | Small office |
| /26 | 255.255.255.192 | 62 | Medium subnet |
| /25 | 255.255.255.128 | 126 | Large subnet |
| /24 | 255.255.255.0 | 254 | Standard LAN |
| /16 | 255.255.0.0 | 65,534 | Large organization |
| /8 | 255.0.0.0 | 16,777,214 | Massive network |
Calculating Hosts
9.4 Subnetting Step-by-Step
Problem: Divide 192.168.1.0/24 into 4 equal subnets
Step 1: Determine bits needed| Subnet | Network Address | First Host | Last Host | Broadcast |
|---|---|---|---|---|
| 1 | 192.168.1.0/26 | 192.168.1.1 | 192.168.1.62 | 192.168.1.63 |
| 2 | 192.168.1.64/26 | 192.168.1.65 | 192.168.1.126 | 192.168.1.127 |
| 3 | 192.168.1.128/26 | 192.168.1.129 | 192.168.1.190 | 192.168.1.191 |
| 4 | 192.168.1.192/26 | 192.168.1.193 | 192.168.1.254 | 192.168.1.255 |
Quick Subnet Cheat Sheet
For /24 networks being subnetted:| New Prefix | Subnets | Hosts/Subnet | Block Size |
|---|---|---|---|
| /25 | 2 | 126 | 128 |
| /26 | 4 | 62 | 64 |
| /27 | 8 | 30 | 32 |
| /28 | 16 | 14 | 16 |
| /29 | 32 | 6 | 8 |
| /30 | 64 | 2 | 4 |
9.5 Private vs Public IP Addresses
The Problem
There are only ~4.3 billion IPv4 addresses (2^32), but billions of devices need to connect.The Solution: Private IP Ranges
RFC 1918 reserved three blocks for private use:| Range | CIDR | # of Addresses | Typical Use |
|---|---|---|---|
| 10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | Large enterprises, Cloud VPCs |
| 172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | Medium organizations |
| 192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 | 65,536 | Home/Small office |
Key Rules
Private IPs
- Not routable on the public internet
- Can be reused by any organization
- Need NAT to reach the internet
- Free to use, no registration needed
Public IPs
- Globally unique and routable
- Assigned by IANA → RIRs → ISPs
- Must be purchased/leased
- Required for internet-facing services
Can Multiple Organizations Use the Same Private IP?
Yes! This is exactly the point. Consider:192.168.1.5 internally, but that’s fine because:
- Private IPs never leave their local network
- NAT translates them to unique public IPs before packets hit the internet
- The internet only sees the public IPs
9.6 Special IP Addresses
| Address/Range | Purpose |
|---|---|
| 0.0.0.0 | ”This network” / Default route |
| 127.0.0.0/8 | Loopback (localhost) |
| 169.254.0.0/16 | Link-local (APIPA) - when DHCP fails |
| 224.0.0.0/4 | Multicast |
| 255.255.255.255 | Broadcast |
9.7 IPv6 Addressing
Why IPv6?
IPv4 has ~4.3 billion addresses. IPv6 has:IPv6 Format
Simplification Rules
-
Leading zeros can be omitted:
-
Consecutive zero groups can be replaced with
::(once per address):
IPv6 Address Types
| Type | Prefix | Description |
|---|---|---|
| Global Unicast | 2000::/3 | Public, routable (like IPv4 public) |
| Link-Local | fe80::/10 | Auto-configured, not routable |
| Unique Local | fc00::/7 | Private (like RFC 1918) |
| Loopback | ::1 | Localhost |
9.8 Practice Problems
Problem 1: Given 10.0.0.0/8, how many /24 networks can you create?
Problem 1: Given 10.0.0.0/8, how many /24 networks can you create?
Solution:
Problem 2: What subnet does 172.16.45.130/26 belong to?
Problem 2: What subnet does 172.16.45.130/26 belong to?
Solution:
Problem 3: Design subnets for an office with 3 departments
Problem 3: Design subnets for an office with 3 departments
Requirements:
Remaining: 192.168.10.112 - 192.168.10.255 (for future use)
- Engineering: 50 hosts
- Sales: 20 hosts
- HR: 10 hosts
- Starting block: 192.168.10.0/24
| Dept | Hosts Needed | Subnet Size | CIDR | Range |
|---|---|---|---|---|
| Engineering | 50 | /26 (62 hosts) | 192.168.10.0/26 | .1 - .62 |
| Sales | 20 | /27 (30 hosts) | 192.168.10.64/27 | .65 - .94 |
| HR | 10 | /28 (14 hosts) | 192.168.10.96/28 | .97 - .110 |
9.9 Key Takeaways
CIDR is Essential
Master /24, /26, /28 calculations. They appear in every cloud and network config.
Private IPs are Infinite
10.x.x.x can be used by millions of organizations simultaneously.
Always Plan for Growth
Leave room in your subnetting for future expansion.
IPv6 is Coming
No NAT needed, every device gets a public IP.
Next Module
Module 10: NAT & PAT Deep Dive
Understand how private networks communicate with the internet through Network Address Translation.