CCNA Notes 3 # IP Address & Subnetting Explained — Complete Visual Guide for Beginners (CCNA)


CCNA / Networking Fundamentals

IP Address & Subnetting

Your complete interactive guide to understanding IP addressing, subnet masks, CIDR notation, and subnetting from scratch.

32
Bits in IPv4
4.3B
Total IPs (2³²)
5
IP Classes
/0–/32
CIDR Range
01

IP Address Fundamentals

What is an IP Address?

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.

156 . 89 . 24 . 15

Each group is called an octet (8 bits). Four octets × 8 bits = 32 bits total.

Two Parts of Every IP
Network Bits
Same for ALL devices on the same LAN. Identifies the network. Cannot be changed.
Host Bits
Unique for EACH device on the network. Identifies the specific host. Can be changed.
Anatomy of an IP Address — 158.80.164.3
158
10011110
1st Octet
·
80
01010000
2nd Octet
·
164
10100100
3rd Octet
·
3
00000011
4th Octet
 Network portion
 Host portion (Class C example)
Range: 0 per octet (00000000₂) → 255 per octet (11111111₂)
Interactive — IP to Binary Converter
192
11000000
1
1
0
0
0
0
0
0
168
10101000
1
0
1
0
1
0
0
0
1
00000001
0
0
0
0
0
0
0
1
10
00001010
0
0
0
0
1
0
1
0
Total IPv4 Addresses
2³² = 4,294,967,296 ≈ 4.3 Billion unique addresses worldwide.
Octet Range
Min: 0 (00000000₂) — Max: 255 (11111111₂) per octet.
Default Gateway
0.0.0.0 is used for default routing and as a wildcard mask / DHCP placeholder.
Loopback Address
127.0.0.0 – 127.255.255.255 — reserved for NIC/TCP-IP testing. Your own machine.
Network ID
First IP in a subnet. All host bits are turned OFF (0). Identifies the network on a router.
Broadcast ID
Last IP in a subnet. All host bits are turned ON (1). Sends to every device on the LAN.
02

IP Address Classes

Class Range — First Octet (0 to 255)
Class A
0–127
Class B
128–191
Class C
192–223
D
224–239
E
240–255
Class Details & Specifications
ClassFirst OctetDefault MaskNetwork BitsHost BitsMax Hosts/NetPurpose
A1 – 126255.0.0.0 /88 (N.H.H.H)2416,777,214ISPs, large orgs
B128 – 191255.255.0.0 /1616 (N.N.H.H)1665,534Medium networks
C192 – 223255.255.255.0 /2424 (N.N.N.H)8254Small/home nets
D224 – 239Multicast only
E240 – 255Experimental/Research
Class A Special
  • 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
Class B Special
  • APIPA: 169.254.0.0/16
  • ↳ Auto Private IP (no DHCP)
  • Private: 172.16.0.0 – 172.31.255.255 /12
Class C Special
  • Private: 192.168.0.0 – 192.168.255.255
  • Subnet: /24 (255.255.255.0)
  • Most common in home/office networks
03

Private vs Public IP

Attribute🔒 Private IP🌐 Public IP
Assigned byNetwork AdministratorISP (Internet Service Provider)
UniquenessLocally unique (within LAN)Globally unique (worldwide)
RegistrationUnregisteredRegistered
CostFreePaid
Used forLAN / Internal communicationWAN / 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.
💡 Memory Tip
Private IPs are like your home address within a building complex — unique inside, but unknown to the outside world. Public IPs are like the building's street address — visible to everyone globally.
04

Subnet Mask

What is a 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
Default Subnet Masks by Class
Class A255.0.0.0N.H.H.H/8
Class B255.255.0.0N.N.H.H/16
Class C255.255.255.0N.N.N.H/24
Classful vs Classless

Classful (Default)

Uses the default subnet mask for the IP class. Simple but wastes many IP addresses.

192.168.1.0 / 255.255.255.0 (/24)

Classless (CIDR)

Uses any subnet mask with any class. Prevents IP waste. Used in modern networks.

192.168.1.0 / 255.255.255.192 (/26)
05

CIDR Notation

What is CIDR?

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:

1
1
1
1
1
1
1
1
·
1
1
1
1
1
1
1
1
·
1
1
1
1
1
0
0
0
·
0
0
0
0
0
0
0
0
■ 21 ON bits = /21■ 11 OFF bits = host portionSo: 255.255.248.0 = /21
Block Size Reference — 4th Octet
CIDRSubnet Mask (4th octet)Borrowed BitsSubnets (2ⁿ)Block SizeHosts/Subnet (2ʰ−2)Last ON bit
/24.001256254
/25.12812128126128
/26.19224646264
/27.22438323032
/28.240416161416
/29.248532868
/30.252664424
/31.254712820 (P2P only)2
/32.255825610 (host route)1
📐 Block Size Rule
Block Size = value of the last ON bit in the subnet mask. Example: /26 → last ON bit is at position 64 → block size = 64. This is also = 256 − the 4th octet value of the subnet mask.
06

Subnetting Deep Dive

What is Subnetting?

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.

Better Performance
Reduces broadcast traffic
💎
Efficient IPs
Minimizes IP waste
🔐
Better Security
Isolates network segments
🎛️
More Control
Easier management
Subnetting Formulas
2ⁿ
Number of Subnets
n = number of borrowed bits (extra ON bits added to the default mask)
2ʰ − 2
Hosts per Subnet
h = number of remaining host bits (OFF bits in the mask). −2 removes Network ID and Broadcast ID.
Last ON bit
Block Size
The value of the last set bit (1) in the subnet mask. Each subnet starts at multiples of this block size.
Worked Example — 192.168.10.0 /26

Starting from a Class C default /24, we borrow 2 bits making it /26.

Bit positions: 128 64 | 32 16 8 4 2 1
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)
0–63
64–127
128–191
192–255
#Network IDFirst HostLast HostBroadcast
1.0.1.62.63
2.64.65.126.127
3.128.129.190.191
4.192.193.254.255
Subnet Mask: 255.255.255.192
Network IP Address
CIDR Prefix (e.g. /26)
4
Subnets (2^2)
62
Hosts/Subnet
255.255.255.192
Subnet Mask
64
Block Size
2
Borrowed Bits
6
Host Bits
Showing 4 of 4 subnets:
#
Network ID
First–Last Host
Broadcast
1
192.168.1.0
192.168.1.1 – 192.168.1.62
192.168.1.63
2
192.168.1.64
192.168.1.65 – 192.168.1.126
192.168.1.127
3
192.168.1.128
192.168.1.129 – 192.168.1.190
192.168.1.191
4
192.168.1.192
192.168.1.193 – 192.168.1.254
192.168.1.255
07

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
FLSM EXAMPLE
192.168.1.0 /26 → 4 subnets all with 62 hosts each
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
VLSM EXAMPLE
192.168.1.0 /26 → 62 hosts (large dept)
192.168.1.64 /28 → 14 hosts (small dept)
192.168.1.80 /30 → 2 hosts (P2P link)
🌐 Real World
VLSM is what every real network engineer uses. For example, router-to-router (point-to-point) links use /30 (only 2 hosts needed), while a large office uses /22 (1022 hosts). VLSM ensures zero waste.
08

Route Summarization (Supernetting)

What is Route Summarization?

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.

Step-by-Step Example

Summarize: 192.168.100.0/24 through 192.168.110.0/24

1
Identify the Range
Find the lowest and highest network addresses in the group.
Lowest: 192.168.100.0
Highest: 192.168.110.0
2
Convert the Differing Octet to Binary
Focus on the 3rd octet (where networks differ).
100 = 0110 0100
110 = 0110 1110
3
Find the Common Bits (Left to Right)
Compare bit-by-bit from the left. Stop when bits first differ.
100 = 0110 0100
110 = 0110 1110
~~~~
Common: 0110 0 = first 5 bits match → but we check crossing over 11 networks
→ 01100000 = 96 (set differing bits to 0)
4
Count Common Bits for CIDR
Total common bits across octets 1+2+3 gives the CIDR prefix.
Octet 1: 8 common bits (192 = same)
Octet 2: 8 common bits (168 = same)
Octet 3: 3 common bits (0110 0...)
Total: 8 + 8 + 3 = /19
Result — Summary Network
Summary Route: 192.168.96.0 /19
Subnet Mask: 255.255.224.0
Covers: 192.168.96.0 → 192.168.127.255
🚀 Why Route Summarization Matters
Instead of advertising 11 individual /24 routes to all routers, you advertise just ONE /19 summary route. This keeps routing tables small, reduces memory usage on routers, and speeds up routing decisions across large networks.
09

Quick Reference

Network ID
First IP of a subnet. All host bits = 0. Used to identify the network on routers globally.
Broadcast ID
Last IP of a subnet. All host bits = 1. Sends packet to ALL devices on the LAN.
Loopback
127.0.0.1 — Points back to your own device. Used to test the TCP/IP stack without needing a network.
APIPA
169.254.x.x — Auto-assigned when DHCP fails. Means your device can't reach the DHCP server.
CIDR
Shorthand for subnet masks — /24 = 255.255.255.0. Counts consecutive ON bits from the left.
Borrowed Bits
Extra bits taken from the host portion to create more subnets. Each borrowed bit doubles the subnet count.
Block Size
Value of the last ON bit in subnet mask. Each subnet starts at multiples of this value. /26 → 64.
Supernetting
Combining multiple subnets into one summary route. Reduces routing table entries. Opposite of subnetting.
Multicast
Class D (224–239) IPs send one packet to a group of devices subscribed to a multicast group.
The 3 Golden Formulas
2ⁿ
Number of Subnets
n = borrowed bits
2ʰ−2
Number of Hosts
h = host bits left
256−mask
Block Size
256 − last mask octet
R. CHOUDHARY // IP Address & Subnetting
CCNA Networking Fundamentals · IPv4 Addressing · Complete Reference Guide

Comments

Popular posts from this blog

Network Topologies

Network Devices

CCNA Notes #01: Computer Networks — Types & Classification (Complete Guide)