IPv4 Addressing
π Your Digital Passport: Decoding the World of IPv4 Addressing
Hey future network engineer, tech enthusiast, or anyone curious about how the internet really works!
Ever wondered how your computer finds its way across the vast digital landscape?
Itβs all thanks to IPv4 addresses β the digital passports that identify devices on networks.
This blog will take you on a journey through IPv4 addressing, perfect for:
- π Learners building fundamentals
- π Quick revision before exams
- π€ Interview preparation for CCNA/Networking roles
Letβs dive in! π
π What Exactly Is an IPv4 Address?
Think of the internet as a massive global city, where every device (your phone, laptop, router) needs a unique address to send and receive mail.
That address = IPv4 address.
- Itβs a 32-bit number that identifies a device at Layer 3 (Network Layer) of the OSI/TCP-IP model.
- Written in dotted decimal notation β split into 4 octets (8 bits each).
- Example:
1
2
11000000.10101000.00000001.00000001 (Binary)
= 192.168.1.1 (Decimal)
π For CCNA: Practice binary β decimal conversion (8-bit numbers, 0β255).
π’ Binary Basics (Quick Refresher)
Computers only understand 0s and 1s (binary).
- Base 2 system (values double at each position): 1, 2, 4, 8, 16, 32, 64, 128.
- Example Conversion:
1
2
Binary: 00101111
Decimal: 32 + 8 + 4 + 2 + 1 = 47
π‘ Exam Tip:
Know that 1 byte = 8 bits β 256 possible values (0β255).
π Network Portion vs. Host Portion
Every IPv4 address has two parts:
- Network Portion β Identifies the network (like the street name).
- Host Portion β Identifies the specific device (like the house number).
How do we separate them?
1. Prefix Length (CIDR Notation)
- Written as
/X, where X = number of network bits. - Example:
192.168.1.10/24β First 24 bits = network, last 8 bits = host.
2. Subnet Mask
- A 32-bit number with 1s = network bits, 0s = host bits.
- Example:
/24 = 255.255.255.0
π Key Network Attributes
For any network, you can identify:
- Network Address β All host bits = 0
- Broadcast Address β All host bits = 1
- First Usable Host β Network + 1
- Last Usable Host β Broadcast β 1
- Max Hosts β Formula =
2^h β 2(h = host bits)
π Example: 192.168.100.0/24
- Network:
192.168.100.0 - Broadcast:
192.168.100.255 - First Host:
192.168.100.1 - Last Host:
192.168.100.254 - Hosts: 254
π°οΈ A Blast from the Past β IPv4 Classes
Originally, IPs were divided into classes (AβE):
- Class A β 0β127 (/8) β Huge networks, millions of hosts
- Class B β 128β191 (/16) β Medium networks
- Class C β 192β223 (/24) β Small networks
- Class D β 224β239 β Multicast
- Class E β 240β255 β Experimental
β οΈ Now Obsolete β Replaced by CIDR (Classless) for flexibility.
π¦ Reserved IPv4 Addresses
Some IPs have special purposes:
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16β Private networks127.0.0.0/8β Loopback (e.g.,127.0.0.1)169.254.0.0/16β APIPA (when DHCP fails)255.255.255.255β Broadcast to all hosts in LAN224.0.0.0/4β Multicast
π IPv4 Header β The Anatomy of a Packet
When data travels, itβs wrapped in an IPv4 header (20β60 bytes, 14 fields).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| IHL |Type of Service| Total Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |Flags| Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Time to Live | Protocol | Header Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options (if any) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data |
| (Payload) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Key fields:
- Version β IPv4 or IPv6
- IHL β Header length
- DSCP/ECN β QoS (traffic priority)
- Total Length β Packet size
- Identification/Flags/Fragment Offset β Splitting large packets (MTU = 1500 bytes standard)
- TTL (Time to Live) β Prevent infinite looping
- Protocol β TCP, UDP, ICMP, OSPF, etc.
- Header Checksum β Error check
- Source & Destination IP β Sender & Receiver
π‘ Identifier vs. Locator
IPv4 addresses act as both:
- Identifier β Who is the device?
- Locator β Where is the device in the network?
But with NAT & DHCP, addresses often change.
So today, IPv4 works more reliably as a locator.
π Real-Life Analogy
- Street Name = Network Portion
- House Number = Host Portion
- Post Office (Router) β Decides where to forward letters (packets).
- Private Addresses = Apartment numbers inside a building (Intranet)
- NAT = Buildingβs main gate, converting private numbers to one public address.
π IPv6: The Road Ahead
- IPv4 = 32 bits β ~4.3 billion addresses (exhausted).
- IPv6 = 128 bits β Virtually unlimited.
- But IPv4 is still everywhere, so both coexist today.
π― Key Takeaways (Exam & Interview Revision)
β
Master binary β decimal conversions (up to 8 bits).
β
Identify network, broadcast, usable range, and max hosts quickly.
β
Understand CIDR notation vs. classful addressing.
β
Recall reserved IP ranges and their uses.
β
Know IPv4 header fields (TTL, Protocol, Checksum, etc.).
β
Be ready to explain Identifier vs. Locator with NAT examples.
π Conclusion: IPv4βs Enduring Legacy
IPv4 addressing remains the foundation of networking.
From its 32-bit structure to the clever use of subnetting & NAT, it continues to power billions of devices today.
Whether youβre revising for CCNA, preparing for an interview, or just learning networking basics, understanding IPv4 is non-negotiable.