IPv4 Addressing and Subnetting
IPv4 Addressing and Subnetting
Learning Objectives
Understand the IPv4 address format and classes
Differentiate between classful and classless addressing
Use CIDR notation to calculate the number of hosts
Subnet a network and find valid host and broadcast addresses
Apply IP addressing in real-world network design scenarios
What is an IP Address?
An IP address (Internet Protocol address) is a unique identifier for each device on a
network, similar to a house address in a city. It allows devices to locate and communicate
with each other.
Example:
Special Address:
127.0.0.1 is called the loopback address. It points to your own device and is used for
testing.
CIDR Notation
Format: IP_address/prefix_length
Example: 192.168.1.0/24
/24 means the first 24 bits are for the network; the remaining bits are for hosts.
Prefix Table
Option 1 – Classful
Option 2 – CIDR
Try /23 → 9 host bits → 2^9 = 512 total IPs → 510 usable
Best fit
Assign: 192.168.0.0/23
Type Value
Network 192.168.0.0
Broadcast 192.168.1.255
Usable Range 192.168.0.1 – 192.168.1.254
Subnetting Basics
Subnetting is dividing one large network into smaller logical networks.
Why Subnet?
Efficient IP usage
Improved security and isolation
Reduces network congestion
Subnetting Example – Divide into 4 Subnets
Given:
Network: 192.168.1.0/24
Goal: Create 4 equal subnets
We want 16 subnets.
Formula: 2^n ≥ 16
n = 4 bits (since 2⁴ = 16)
Original: /16
Borrow 4 bits → New = /20
New subnet mask: 255.255.240.0
Explanation:
Original: /8
Borrow 8 bits → New = /16
New subnet mask: 255.255.0.0
Explanation:
Each new subnet is incremented by 1 in the second octet (because the third and fourth
octets remain within each block of 65,536 addresses).
Network: 192.168.0.0/24
Devices (laptop, phones): 192.168.0.1 – 192.168.0.254
Router’s IP: 192.168.0.1
Broadcast: 192.168.0.255
Practice Problems
Question:
Subnet the network 192.168.10.0/24 into 8 subnets.
Instructions:
Question:
Subnet the network 172.16.0.0/16 into 16 subnets.
Instructions:
Question:
Subnet the network 10.0.0.0/8 into 64 subnets.
Instructions: