IPv4 header fields

The IPv4 header is a variable Layer 3 header (RFC 791, 20–60 bytes) containing everything a router uses to forward, fragment and deliver IPv4 packets.

Facts / key topics

Field-by-field

How it works, step by step

  1. Packet created: host builds the IPv4 header (min 20 bytes).
  2. Forwarding: router checks destination IP, decrements TTL by 1, recomputes the header checksum.
  3. Fragmentation (if needed): if the MTU is too small the router fragments, setting MF + Fragment Offset.
  4. Error/recovery: TTL = 0 → drop + ICMP Time Exceeded; DF set + MTU too small → ICMP Fragmentation Needed.

Fields (exam critical)

Field Size Explanation
Version 4 bits Always 4
IHL 4 bits Header length
DSCP / ECN 8 bits QoS
Total Length 16 bits Header + data
Identification 16 bits Fragment ID
Flags 3 bits DF / MF
Fragment Offset 13 bits Fragment position
TTL 8 bits Loop prevention
Protocol 8 bits L4 protocol (TCP=6, UDP=17)
Header Checksum 16 bits Error detection
Source IP 32 bits Sender
Destination IP 32 bits Receiver
Options variable Rarely used
Padding variable Alignment

Key terminology

Term Explanation
IHL Internet Header Length
TTL Time To Live
DF Don’t Fragment
MF More Fragments
Fragment Offset Position in the original packet
Header Checksum Recomputed at every hop

Elements table

Element Description CCNA CCNP
Variable header 20–60 bytes
Fragmentation Router-based
TTL Loop prevention
Checksum CPU load
Options Advanced use

Dependencies & special considerations

Design & best practices

Exam tips ⚠️

30-second summary

Level Expectation
CCNA Header fields, TTL, fragmentation
CCNP MTU design, performance, ICMP errors, IPv6 comparison