Skip to content
Packet & bit fields templates

Packet — TCP Header (RFC 9293)

Twenty bytes of TCP with each control flag on its own bit, which is the part a prose description always compresses into 'flags' and the part anyone reading a capture actually needs. Written with run-length fields after the first word to show the two notations mixing.

Template previewPacket & bit fields
TCP header (RFC 9293)32-bit words · 5 words · 160 bits laid out · 17 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 — 17 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+16B128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159Source portbits 0–15 · 16bDestination portbits 16–31 · 16bSequence numberbits 32–63 · 32bAcknowledgement numberbits 64–95 · 32bData offsetbits 96–99 · 4bReservedbits 100–103 = 0C…bi…E…bi…U…bi…A…bi…P…bi…R…bi…S…bi…F…bi…Windowbits 112–127 · 16bChecksumbits 128–143 · 16bUrgent pointerbits 144–159 · 16bNo overlaps: each of the 160 checked bits belongs to at most one field.No gaps: bits 0–159 fully covered by 17 fields.Every field ends inside the 5-word layout.

Make it your own.

title "TCP header (RFC 9293)"
width 32
bitorder msb
words 5

0-15:  Source port
16-31: Destination port

32-63: Sequence number
64-95: Acknowledgement number

96-99:   Data offset
100-103: Reserved = 0
104: CWR
105: ECE
106: URG
107: ACK
108: PSH
109: RST
110: SYN
111: FIN
112-127: Window

128-143: Checksum
144-159: Urgent pointer