CCNA Notes 3 # IP Address & Subnetting Explained — Complete Visual Guide for Beginners (CCNA)
IP Address & Subnetting
Your complete interactive guide to understanding IP addressing, subnet masks, CIDR notation, and subnetting from scratch.
IP Address Fundamentals
An IPv4 address is a 32-bit number that uniquely identifies every device on a network. It's written in dotted decimal notation — four numbers (0–255) separated by dots.
Each group is called an octet (8 bits). Four octets × 8 bits = 32 bits total.
IP Address Classes
| Class | First Octet | Default Mask | Network Bits | Host Bits | Max Hosts/Net | Purpose |
|---|---|---|---|---|---|---|
| A | 1 – 126 | 255.0.0.0 /8 | 8 (N.H.H.H) | 24 | 16,777,214 | ISPs, large orgs |
| B | 128 – 191 | 255.255.0.0 /16 | 16 (N.N.H.H) | 16 | 65,534 | Medium networks |
| C | 192 – 223 | 255.255.255.0 /24 | 24 (N.N.N.H) | 8 | 254 | Small/home nets |
| D | 224 – 239 | — | — | — | — | Multicast only |
| E | 240 – 255 | — | — | — | — | Experimental/Research |
- 0.0.0.0 — Default routing / DHCP
- 127.x.x.x — Loopback (NIC test)
- 10.0.0.0/8 — Private IP range
- Usable public: 1–9 and 11–126
- APIPA: 169.254.0.0/16
- ↳ Auto Private IP (no DHCP)
- Private: 172.16.0.0 – 172.31.255.255 /12
- Private: 192.168.0.0 – 192.168.255.255
- Subnet: /24 (255.255.255.0)
- Most common in home/office networks
Private vs Public IP
| Attribute | 🔒 Private IP | 🌐 Public IP |
|---|---|---|
| Assigned by | Network Administrator | ISP (Internet Service Provider) |
| Uniqueness | Locally unique (within LAN) | Globally unique (worldwide) |
| Registration | Unregistered | Registered |
| Cost | Free | Paid |
| Used for | LAN / Internal communication | WAN / Internet communication |
| Ranges | A 10.0.0.0 – 10.255.255.255 B 172.16.0.0 – 172.31.255.255 C 192.168.0.0 – 192.168.255.255 | All IPs not listed as private. Routable on the internet. |
Subnet Mask
A subnet mask is a 32-bit address written in dotted decimal, just like an IP. It tells you which part of an IP address is the network and which part is the host.
- 🔵 ON bits (1s) → define the network portion
- 🟠 OFF bits (0s) → define the host portion
Classful (Default)
Uses the default subnet mask for the IP class. Simple but wastes many IP addresses.
Classless (CIDR)
Uses any subnet mask with any class. Prevents IP waste. Used in modern networks.
CIDR Notation
Classless Inter-Domain Routing (CIDR) is a compact way to write subnet masks by counting the number of consecutive ON bits (1s) from the left.
Example: 255.255.248.0 in binary is:
| CIDR | Subnet Mask (4th octet) | Borrowed Bits | Subnets (2ⁿ) | Block Size | Hosts/Subnet (2ʰ−2) | Last ON bit |
|---|---|---|---|---|---|---|
| /24 | .0 | 0 | 1 | 256 | 254 | — |
| /25 | .128 | 1 | 2 | 128 | 126 | 128 |
| /26 | .192 | 2 | 4 | 64 | 62 | 64 |
| /27 | .224 | 3 | 8 | 32 | 30 | 32 |
| /28 | .240 | 4 | 16 | 16 | 14 | 16 |
| /29 | .248 | 5 | 32 | 8 | 6 | 8 |
| /30 | .252 | 6 | 64 | 4 | 2 | 4 |
| /31 | .254 | 7 | 128 | 2 | 0 (P2P only) | 2 |
| /32 | .255 | 8 | 256 | 1 | 0 (host route) | 1 |
Subnetting Deep Dive
Subnetting is the process of dividing a large network into multiple smaller sub-networks (subnets). This is done by borrowing bits from the host portion of an IP address and using them for additional network bits.
n = number of borrowed bits (extra ON bits added to the default mask)
h = number of remaining host bits (OFF bits in the mask). −2 removes Network ID and Broadcast ID.
The value of the last set bit (1) in the subnet mask. Each subnet starts at multiples of this block size.
Starting from a Class C default /24, we borrow 2 bits making it /26.
Borrowed: 1 1 | 0 0 0 0 0 0
↑ ↑
n=2 borrowed → 2² = 4 subnets
h=6 host bits → 2⁶−2 = 62 hosts
Block size → 64 (last ON bit)
| # | Network ID | First Host | Last Host | Broadcast |
|---|---|---|---|---|
| 1 | .0 | .1 | .62 | .63 |
| 2 | .64 | .65 | .126 | .127 |
| 3 | .128 | .129 | .190 | .191 |
| 4 | .192 | .193 | .254 | .255 |
FLSM vs VLSM
FLSM — Fixed Length Subnet Mask
- All subnets are thesame size
- Uses default /8, /16, /24 masks per class
- Simple to design and implement
- Wastes IP addresses (not ideal for modern use)
- Good for study/learning purposes
Even if one subnet only needs 5 hosts — wastes 57!
VLSM — Variable Length Subnet Mask
- Subnets can bedifferent sizes
- Uses any subnet mask with any class
- Efficient use of IP address space
- Used in all real-world networks today
- Enables route summarization
192.168.1.64 /28 → 14 hosts (small dept)
192.168.1.80 /30 → 2 hosts (P2P link)
Route Summarization (Supernetting)
Route Summarization (also called Supernetting or Aggregation) combines multiple smaller subnets into one larger summary route. This reduces the size of routing tables and improves router efficiency.
Summarize: 192.168.100.0/24 through 192.168.110.0/24
Highest: 192.168.110.0
110 = 0110 1110
110 = 0110 1110
~~~~
Common: 0110 0 = first 5 bits match → but we check crossing over 11 networks
→ 01100000 = 96 (set differing bits to 0)
Octet 2: 8 common bits (168 = same)
Octet 3: 3 common bits (0110 0...)
Total: 8 + 8 + 3 = /19
Subnet Mask: 255.255.224.0
Covers: 192.168.96.0 → 192.168.127.255
Quick Reference
n = borrowed bits
h = host bits left
256 − last mask octet
Comments
Post a Comment