IPv4 & IPv6 Addressing

Layer 3 headers, CIDR subnetting, MTU fragmentation, and the transition to IPv6.

1. The IPv4 Header (20 Bytes)

The standard IPv4 header contains fields essential for routing and fragmentation.

Ver/IHL 0x45 1B
TOS DSCP/ECN 1B
Length Total Bytes 2B
Flags/Frag DF/MF 4B
TTL Time 1B
Proto TCP=6 1B
Source IP 32-bit 4B
Dest IP 32-bit 4B

2. Subnetting & CIDR (IPv4)

CIDR (Classless Inter-Domain Routing) allows variable-length subnet masks (VLSM), replacing legacy Class A/B/C addressing.

Private Address Space (RFC 1918)

Not routable on the public Internet. Requires NAT.

Subnet Mask Cheat Sheet

CIDR Subnet Mask Usable Hosts Use Case
/24 255.255.255.0 254 Standard LAN
/28 255.255.255.240 14 Small DMZ
/30 255.255.255.252 2 Legacy P2P Link
/31 255.255.255.254 2 Modern P2P Link (RFC 3021)
/32 255.255.255.255 1 Loopback / Host Route

3. IPv6 Fundamentals

IPv6 uses 128-bit addresses, hex notation, and a simplified header.

IPv6 Header vs IPv4

Address Types

NDP (Neighbor Discovery Protocol)

Replaces ARP. Uses ICMPv6.

4. MTU & Fragmentation

MTU (Maximum Transmission Unit) is typically 1500 bytes.


References