Navigating the Digital Highway: Understanding IP Addresses and CIDR Blocks from Scratch

WhoAmI => notes.sohag.pro/author
Search for a command to run...

WhoAmI => notes.sohag.pro/author
No comments yet. Be the first to comment.
How Terraform Turns Your Cloud Infrastructure into a Well-Oiled Machine! Imagine you're planning a big party, and instead of manually setting up each decoration, arranging chairs, and preparing food, you have a magical assistant who does everything e...
I had a solid list of reasons my life wasn't moving faster, until a grainy old lecture pointed out the one name missing from it

The finale isn't a victory lap. It's the story of the control I shipped that did nothing, the footgun still sitting in my demo, and the handful of things I'd keep exactly as they are.

How do you hold a large payment for a second pair of eyes without ever letting the unapproved money touch a balance, and how do you stream that decision to the outside world without standing up a broker?

How do you show the total under a parent account when the whole system refuses to store a balance? A recursive query, a trigger that refuses to draw a circle, and a rule about what actually has to sum to zero.

Every time I wanted to change an FX rate I had to edit a file on the server and restart the app. So I moved rates and markup into a live admin API, and then audited it hard enough to find the bug that quietly undid the whole thing.

Imagine the internet as a massive city, and each device is like a house. Just as every house has a unique address, every device connected to the internet has a unique identifier called an IP (Internet Protocol) address. This address helps data find its way from one device to another, just like a postal address helps mail reach the right destination.
Binary is the computer's native language - a system using only two digits: 0 and 1. Think of it like a light switch that can only be on (1) or off (0). Every piece of digital information is essentially a series of these switches.
Decimal is the number system we use daily, with 10 digits (0-9). When we talk about IP addresses, we typically use decimal notation.
Each binary digit (bit) represents a power of 2:
Far right bit = 2^0 (1)
Next bit = 2^1 (2)
Next bit = 2^2 (4)
And so on...
Example Conversion: Binary: 1010
1 × 2³ = 8
0 × 2² = 0
1 × 2¹ = 2
0 × 2⁰ = 0 Result: 8 + 0 + 2 + 0 = 10 (Decimal)
An IP address is typically 32 bits long (IPv4), divided into four octets:
Each octet is 8 bits
Range: 0-255 in decimal
Example: 192.168.1.1
Class A: 1.0.0.0 to 126.255.255.255
Class B: 128.0.0.0 to 191.255.255.255
Class C: 192.0.0.0 to 223.255.255.255
CIDR is like a flexible zoning system for internet addresses. Instead of rigid address classes, it allows more precise network segmentation.
Format: IP Address/Prefix Length
Example: 192.168.1.0/24
"/24" means first 24 bits are network portion
Meaning 24/8=3, first 3 portion is fixed, only last portion can be changed to 0-255

Think of CIDR like a neighborhood:
IP Address = Specific house
Prefix = Defining the entire neighborhood boundaries
/24 = 255.255.255.0
/16 = 255.255.0.0
/8 = 255.0.0.0
Businesses use CIDR to:
Organize network infrastructure
Implement security boundaries
Manage IP address allocation efficiently
Cloud providers use CIDR blocks to:
Allocate IP ranges to customers
Manage network isolation
Enable secure multi-tenant environments
128-bit address space
Solves IP address exhaustion
Notation: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Calculate usable host addresses
Plan network growth
Optimize network performance
NAT (Network Address Translation)
IPv6 adoption
Dynamic IP allocation
Use of private IP ranges
Implementing firewall rules
Network segmentation
Always have a network addressing plan
Use online CIDR calculators
Understand your network's specific requirements
Regularly audit and optimize IP allocations
Understanding IP addresses and CIDR blocks is like mastering the road map of the digital world. With practice, you'll navigate network configurations with confidence!