IP addressing is the foundation of all networking. Every device on a network must have a unique IP address, and subnetting determines how networks are divided, how many hosts they support, and how routing behaves.
This guide covers IPv4, IPv6, subnet masks, CIDR notation, calculating network ranges, and converting between number systems — all using the formulas already shown in your Number Systems page .
IPv4 Addressing Basics
An IPv4 address is 32 bits, producing:
IPv4 is written in dotted‑decimal format:
192.168.1.10
Each octet is 8 bits.
Subnet Masks & CIDR Notation
A subnet mask defines how many bits belong to:
- Network portion
- Host portion
Example:
255.255.255.0 = /24
Meaning:
- 24 network bits
- 8 host bits
Calculating Assignable Hosts
Where:
- = number of host bits
- Subtract 2 for network and broadcast addresses
Example: /24
- Host bits = 8
- Assignable =
Calculating Number of Subnets
Formula:
Where:
- = number of borrowed bits (bits added to the default mask)
Example: Borrow 3 bits → subnets.
Interesting Octet & Block Size
Formula:
The interesting octet is the octet where the subnet mask stops being 255.
Example:
Mask: 255.255.255.192
Interesting Octet = 192
Block Size = 256 - 192 = 64
Subnets:
0–63
64–127
128–191
192–255
Calculating Network & Broadcast Addresses
Given an IP and mask:
Step 1 — Find block size
Use the formula above.
Step 2 — Determine which block the IP falls into
Example:
IP: 192.168.1.130
Mask: /26 (block size 64)
Blocks:
- 0–63
- 64–127
- 128–191 ← IP falls here
- 192–255
Step 3 — Network & Broadcast
Network: 192.168.1.128
Broadcast: 192.168.1.191
Step 4 — Usable Range
192.168.1.129 – 192.168.1.190
Binary, Hex, and Octal Conversions
Your Number Systems page already includes the conversion examples:
Decimal → Hexadecimal
Example from your draft: 2748 → ABC (A=10, B=11, C=12)
Decimal → Binary
Repeated division by 2 (your draft shows the full breakdown)
Binary → Hex
Group bits into 4s.
Binary → Octal
Group bits into 3s.
These conversions are essential for understanding subnetting at the bit level.
IPv6 Addressing Basics
Your draft includes the total IPv6 address space:
IPv6 uses:
- 128‑bit addresses
- Hexadecimal notation
- No broadcast addresses
- Vastly simplified subnetting
Example:
2001:db8:abcd:0012::/64
CIDR Summary Table
| CIDR | Hosts | Block Size | Notes |
|---|---|---|---|
| /24 | 254 | 1 | Common LAN |
| /25 | 126 | 128 | Split /24 in half |
| /26 | 62 | 64 | Cameras, IoT |
| /27 | 30 | 32 | Small networks |
| /30 | 2 | 4 | Point‑to‑point links |
Leave a Reply