IP header
also: IPv4 header, IPv6 header, network layer header
The IP header is the metadata section at the beginning of an IP packet that contains addressing and routing information, including source IP, destination IP, TTL, and protocol type.
An IP header is a fixed-size structure (typically 20 bytes for IPv4) prepended to every IP packet. It contains essential information needed to route the packet across a network and deliver it to the correct destination.
Key fields in an IPv4 header include: source IP address and destination IP address (where the packet comes from and where it's going), TTL (Time To Live) (prevents infinite routing loops), protocol type (indicates if it carries TCP, UDP, ICMP, etc.), and header checksum (detects corruption). For example, when you send data via HTTP, the application layer data gets wrapped in TCP headers, which then gets wrapped in an IP header before transmission.
IPv6 headers are larger (40 bytes minimum) but serve the same purpose with additional fields like traffic class and flow label for quality-of-service handling.