Skip to main content

Header Field Maps

Compact field-by-field tables for the headers covered across this course, in one place for lookup.

IPv4 header

FieldBytes / bitsPurpose
Version4 bitsIP version - 4 for IPv4
IHL4 bitsHeader length in 32-bit words (accounts for options)
ToS / DSCP1 byteDifferentiated Services Code Point - marks traffic for QoS/priority handling
Total length2 bytesLength of header plus payload, in bytes
Identification2 bytesGroups fragments that belong to the same original packet
Flags3 bitsDF (don't fragment) and MF (more fragments follow)
Fragment offset13 bitsWhere this fragment's data starts, in 8-byte units, within the original packet
TTL1 byteDecremented at each hop; packet is dropped when it hits 0 (prevents routing loops)
Protocol1 byteWhich transport protocol is inside - 6 = TCP, 17 = UDP, 1 = ICMP
Header checksum2 bytesError-check over the IP header only (recomputed at every hop, since TTL changes)
Source address4 bytesSending host's IP
Destination address4 bytesReceiving host's IP
No payload checksum

IP's checksum covers only its own header - not the payload. Payload correctness is left to the transport layer (TCP/UDP checksums) and the link layer (Ethernet FCS). This is also why the IP checksum must be recalculated at every hop: TTL changes on every hop, so the header it covers changes too.

TCP header

The full derivation and flag-by-flag breakdown lives in The TCP Segment Header; this is the same fields, compressed for lookup.

FieldBytes / bitsPurpose
Source port2Local socket that sent this segment
Destination port2Socket on the receiver to demux to
Sequence number4Byte offset of the first data byte in this segment
Acknowledgment number4Next byte the sender of this segment expects to receive
Header length4 bitsTCP header length in 32-bit words
Flags9 bitsSYN, ACK, FIN, RST, PSH, URG (+ 3 congestion-notification bits)
Window2Receive window (rwnd) - flow control
Checksum2Error-detection over header, payload, and a pseudo-header of IP fields
Urgent pointer2Offset to urgent data, only meaningful when URG is set
Options0-40Variable-length extensions - MSS, window scaling, SACK, timestamps

UDP header

UDP's header is a fraction of TCP's size - no sequencing, no window, no options, just enough to demultiplex and error-check.

FieldBytesPurpose
Source port2Local socket that sent this datagram
Destination port2Socket on the receiver to demux to
Length2Length of header plus payload, in bytes
Checksum2Error-detection over header, payload, and a pseudo-header of IP fields (optional in IPv4, mandatory in IPv6)

Ethernet frame

Full context on frames, switching, and forwarding lives in Switches & Ethernet; the field table alone, for lookup:

FieldSizePurpose
Preamble8 bytesSync the receiver's clock; mark the start of a frame
Destination MAC6 bytesWhich interface on this link should receive the frame
Source MAC6 bytesWhich interface sent it (how switches self-learn)
Type2 bytesWhich protocol is inside (0x0800 = IPv4, 0x0806 = ARP, 0x86DD = IPv6)
Payload46-1500 bytesThe network-layer packet (padded up to the 46-byte minimum)
FCS4 bytesFrame Check Sequence - a CRC over the frame for error detection
0%0 of 63 pages studied