IPv4 Addressing and Subnetting

An IPv4 address is 32 bits, written as four decimal octets: 192.168.10.25.

Classful Addressing

ClassFirst octetDefault maskNetworks / hosts
A1–126255.0.0.0 (/8)126 / 16,777,214
B128–191255.255.0.0 (/16)16,384 / 65,534
C192–223255.255.255.0 (/24)2,097,152 / 254
D224–239—Multicast
E240–255—Reserved

127.x.x.x is reserved for loopback. Private ranges: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.

Subnetting Example (CIDR)

Text
Given: 192.168.1.130/26

Mask /26 = 255.255.255.192  → block size = 256 − 192 = 64
Subnets in the 4th octet: 0, 64, 128, 192
130 falls in the 128 block:

Network address   : 192.168.1.128
First usable host : 192.168.1.129
Last usable host  : 192.168.1.190
Broadcast address : 192.168.1.191
Usable hosts      : 2^(32−26) − 2 = 62

IPv4 vs IPv6

IPv4IPv6
32-bit (~4.3 billion addresses)128-bit
Dotted decimalHexadecimal, colon-separated (2001:db8::1)
Header checksum, optionsSimplified fixed 40-byte header
Broadcast supportedNo broadcast (uses multicast/anycast)

ARP

The Address Resolution Protocol maps an IP address to a MAC address on a LAN using a broadcast request and a unicast reply.

Track your progress through the Computer Networks course