IP Addressing & Subnetting — Complete Guide

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:

232=4,294,967,296 total addresses

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

Assignable Hosts=2h2

Where:

  • h = number of host bits
  • Subtract 2 for network and broadcast addresses

Example: /24

  • Host bits = 8
  • Assignable = 282=254

Calculating Number of Subnets

Formula:

Subnets=2s

Where:

  • s = number of borrowed bits (bits added to the default mask)

Example: Borrow 3 bits → 23=8 subnets.

Interesting Octet & Block Size

Formula:

Block Size=256Interesting Octet

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:

2128=3.4×1038

IPv6 uses:

  • 128‑bit addresses
  • Hexadecimal notation
  • No broadcast addresses
  • Vastly simplified subnetting

Example:

2001:db8:abcd:0012::/64

CIDR Summary Table

CIDRHostsBlock SizeNotes
/242541Common LAN
/25126128Split /24 in half
/266264Cameras, IoT
/273032Small networks
/3024Point‑to‑point links

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *


Math Captcha
2 × 1 =