Data Communication & Networks

IPv4 Study Guide

 Interactive study guide for ECE 422: Decode packet structures, master subnetting logic, and simulate network traffic.

The IPv4 Datagram

Hover over the packet fields to reveal technical specifications and functions.

Bits
0-3
4-7
8-15
16-31

IPv4 Header Structure

The IPv4 header is typically 20 bytes (without options). It contains all necessary information to deliver the packet from source to destination across interconnected networks.

Total Header Length: 20-60 Bytes Minimum Payload: 8 Bytes

Addressing Architecture

An IPv4 address is a 32-bit number that uniquely identifies a host on a network. It is hierarchically divided into a Network Portion (Prefix) and a Host Portion.

  • Dotted Decimal: Human-readable format (e.g., 192.168.1.1).
  • Binary: Machine-readable format (e.g., 11000000.10101000...).
  • Classful Addressing: Legacy system dividing address space into Classes A, B, C, D (Multicast), and E (Reserved).
Class Leading Bits Default Mask Networks
A 0 /8 128 (2^7)
B 10 /16 16,384
C 110 /24 2,097,152

Visualizing the 32 Bits

. . .
Octet 1 Octet 2 Octet 3 Octet 4
Detected Class: Class C
Supports up to 254 hosts per network.

Subnetting Logic

Subnetting divides a single network into smaller logical sub-networks. The Subnet Mask determines the boundary between the network and host bits.

The Problem

Flat networks (e.g., Class A) are inefficient and create massive broadcast domains. Routing tables become bloated.

Borrowing Bits

We "borrow" bits from the Host portion to create a Subnet portion.

/24 -> /26
(Borrowed 2 bits)
Subnets = 2² = 4

Hierarchy

Creates a hierarchy:
Network . Subnet . Host

Subnet Master Calculator

Input any IP and CIDR to calculate network details instantly.

Network Address
---
Usable Host Range
---
Broadcast Address
---
Total Hosts
---
Subnet Mask (Binary & Decimal)
---
---