Post

IPv4 Addressing

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 networks
  • 127.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 LAN
  • 224.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.

πŸ™Œ Connect With Me

GitHub LinkedIn YouTube Gmail

This post is licensed under CC BY 4.0 by the author.