Skip to content
Packet & bit fields templates

Packet — IPv4 Header (RFC 791)

The header every network diagram starts from, drawn at 32 bits a word in RFC bit order with the absolute bit indices on the ruler. Complete: every bit of the five fixed words is claimed, so the engine reports no gaps and the reader can trust that the layout is the whole layout.

Template previewPacket & bit fields
IPv4 header (RFC 791)32-bit words · 5 words · 160 bits laid out · 13 fields · ruler shows ABSOLUTE bit indicesMSB-first: bit 0 is the most significant bit of each 32-bit word, drawn leftmost; indices increase to the right.In both orders the most significant bit of a word is the leftmost column — only the numbering flips.Layout checks passed — 13 fields, 5 words, 160 bits: no gaps, no overlaps, nothing past the last word.MSBLSBword 0bits 0–31+0B012345678910111213141516171819202122232425262728293031word 1bits 32–63+4B3233343536373839404142434445464748495051525354555657585960616263word 2bits 64–95+8B6465666768697071727374757677787980818283848586878889909192939495word 3bits 96–127+12B96979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127word 4bits 128–159+16B128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159Versionbits 0–3 = 4IHLbits 4–7 · 4bDSCPbits 8–13 · 6bECNbits 14…Total lengthbits 16–31 · 16bIdentificationbits 32–47 · 16bFlagsbits 48–50 ·…Fragment offsetbits 51–63 · 13bTime to livebits 64–71 · 8bProtocolbits 72–79 · 8bHeader checksumbits 80–95 · 16bSource addressbits 96–127 · 32bDestination addressbits 128–159 · 32bNo overlaps: each of the 160 checked bits belongs to at most one field.No gaps: bits 0–159 fully covered by 13 fields.Every field ends inside the 5-word layout.

Make it your own.

title "IPv4 header (RFC 791)"
width 32
bitorder msb
words 5

0-3:   Version = 4
4-7:   IHL
8-13:  DSCP
14-15: ECN
16-31: Total length

32-47: Identification
48-50: Flags
51-63: Fragment offset

64-71: Time to live
72-79: Protocol
80-95: Header checksum

96-127:  Source address
128-159: Destination address