Skip to content
Packet & bit fields templates

Packet — UDP Header, Eight Bytes

The whole of UDP in two words, and the clearest example of the run-length form: four consecutive sixteen-bit fields written as `+16:` rather than as absolute ranges, with the cursor doing the arithmetic so a later insertion does not require renumbering everything after it.

Template previewPacket & bit fields
UDP header (RFC 768)32-bit words · 2 words · 64 bits laid out · 4 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 — 4 fields, 2 words, 64 bits: no gaps, no overlaps, nothing past the last word.MSBLSBword 0bits 0–31+0B012345678910111213141516171819202122232425262728293031word 1bits 32–63+4B3233343536373839404142434445464748495051525354555657585960616263Source portbits 0–15 · 16bDestination portbits 16–31 · 16bLengthbits 32–47 · 16bChecksumbits 48–63 · 16bNo overlaps: each of the 64 checked bits belongs to at most one field.No gaps: bits 0–63 fully covered by 4 fields.Every field ends inside the 2-word layout.

Make it your own.

title "UDP header (RFC 768)"
width 32
bitorder msb
words 2

+16: Source port
+16: Destination port
+16: Length
+16: Checksum