Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

TCP Header Field Reference

Direct answer

Every TCP segment starts with a header of at least 20 bytes: source and destination port, sequence number, acknowledgment number, flags, receive window, checksum and options.

When to use this

Use it to read a TCP capture: what was sent, what was acknowledged, what is being resent, and whether the receiver is holding the sender back.

First 30 seconds

1. Isolate one connection (both addresses and ports).

2. Read SYN and SYN-ACK: options, window scale.

3. Follow sequence numbers one way and acknowledgments the other.

4. Same sequence range twice → retransmission.

5. Acknowledgment stuck while data arrives → a gap. Window near zero → the receiver is slow.

Operational verification

ports identify the connection → sequence numbers advance by the bytes sent → acknowledgment numbers follow → window stays above zero → no sequence range repeated

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard
Key commandtcpdump -ni eth0 -S host 192.0.2.10 and tcp port 443
Scope / prerequisiteUse it to read a TCP capture: what was sent, what was acknowledged, what is being resent, and whether the receiver is h…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational verification Verify boundary
tcpdump -ni eth0 -S host 192.0.2.10 and tcp port 443
ss -ti dst 192.0.2.10

tcpdump prints, per segment, the flags, the sequence range (seq 1000:1500), the acknowledgment number, the window and the options; -S shows absolute numbers. ss -ti on Linux shows what the kernel knows about a live connection: round-trip time, congestion window, retransmissions.

In Wireshark, follow one connection (tcp.stream eq N) and read sequence, next sequence and acknowledgment columns side by side for both directions. The first two packets, SYN and SYN-ACK, contain the options — including the window scale — that apply to the rest.

Known-good: sequence numbers advance without gaps, acknowledgments follow them, and the window stays comfortably above zero.

Step 2 Failure isolation workflow Narrow the fault
  • The same sequence range appears twice. A retransmission: the original, or its acknowledgment, was lost — or the capture point sees a duplicate.
  • The acknowledgment number stops advancing while data keeps arriving. A gap: one segment is missing and the receiver repeats the same acknowledgment.
  • The window shrinks towards zero. The receiving application is not reading; the sender has to pause.
  • Window values look tiny. The capture does not include the handshake, so the scaling factor is unknown.
  • Segments appear larger than the MTU in a capture on the sender. The network card splits them after the capture point (segmentation offload).
  • Sequence numbers jump unexpectedly between two capture points. A firewall or load balancer rewrites them, or terminates the connection and opens its own.
  • Checksum errors on outgoing packets in a local capture. The card computes the checksum after capture; not a real error.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

Sequence numbers count bytes, not packets. The acknowledgment number is the next byte expected — everything before it has arrived. Each direction has its own numbering. The window field must be multiplied by the scale agreed in the handshake.

Key checks
  • tcpdump -ni <if> -S host <ip> and tcp port <port> — flags, sequence range, acknowledgment, window, options per segment.
  • ss -ti dst <ip> — the kernel's view of a live connection: round-trip time, window, retransmissions.
  • Wireshark: tcp.stream eq N, then the sequence, next-sequence and acknowledgment columns.
ReferenceWhat it is1 section · depth on demand

Mechanics & mental model

Every TCP segment begins with a header of at least 20 bytes. It names the two ports, carries the numbers that make delivery reliable — sequence and acknowledgment — and holds the flags, the receive window and any options.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

Reading a TCP capture is reading these fields. The sequence and acknowledgment numbers show what was sent, what arrived and what is being resent; the window shows whether the receiver is holding the sender back; the flags show how the connection opens and ends.

ReferenceHow it works1 section · depth on demand

How it works

FieldSizeMeaning
Source port16 bitsThe sender's port
Destination port16 bitsThe receiver's port
Sequence number32 bitsThe position, in the sender's byte stream, of the first data byte in this segment
Acknowledgment number32 bitsThe next byte the sender of this segment expects to receive — everything before it has arrived
Data offset4 bitsLength of the header in 32-bit words; 5 without options
Flags8 bitsSYN, ACK, FIN, RST, PSH, URG and two congestion bits
Window16 bitsHow many more bytes the sender of this segment can accept
Checksum16 bitsCovers header, data and the IP addresses
Urgent pointer16 bitsRarely used
Options0–40 bytesMaximum segment size, window scaling, selective acknowledgment, timestamps

Sequence numbers count bytes, not packets. A segment with sequence number 1000 and 500 bytes of data covers bytes 1000 to 1499; the next segment starts at 1500. The SYN and the FIN each use up one sequence number although they carry no data.

The acknowledgment number is cumulative. "ACK 1500" means "I have everything up to 1499; send 1500 next". If the segment starting at 1500 is lost but later ones arrive, the receiver keeps answering "ACK 1500" — these repeated acknowledgments are how the sender recognises the gap.

Each direction has its own numbering. The client's sequence numbers are acknowledged by the server's acknowledgment numbers, and the reverse. Both start from a random initial value chosen at the handshake.

Relative numbers. Wireshark displays sequence numbers starting from 0 for readability. The real 32-bit values are in the packet; switch the display if a capture must be compared with a firewall log.

The window is the receiver's free buffer space. With the window scaling option, the value in the field is multiplied by a factor agreed in the handshake, so the field alone does not give the true size.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

The TCP header field by field

RFC 9293 defines a fixed 20-byte header, followed by options. The Data Offset field gives the header length in 32-bit words, so options can extend the header up to 60 bytes. In order, the fields are source port, destination port (16 bits each), sequence number and acknowledgement number (32 bits each), data offset (4 bits), reserved bits, eight control bits (CWR, ECE, URG, ACK, PSH, RST, SYN, FIN), window (16 bits), checksum (16 bits) and urgent pointer (16 bits).

Fields and what they tell you

FieldSizeOperational use
Source / destination port16 + 16Identify the application and the connection
Sequence number32Position of the first data byte; spot gaps and retransmissions
Acknowledgement number32Next byte expected; spot loss (duplicate ACKs)
Data offset4Header length: 5 means 20 bytes, no options
Flags8Segment purpose: open, data, close, reset, ECN
Window16Receive window, scaled if window scaling was negotiated
Checksum16Mandatory; covers a pseudo-header, the header and the data
Urgent pointer16Rarely used today
Options0–40 bytesMSS, window scale, SACK, timestamps

Header length in captures

Data offsetHeader lengthTypical segment
520 bytesNo options (rare on modern stacks)
832 bytesData segment with timestamps (12 bytes of options)
1040 bytesSYN with MSS, SACK-permitted, timestamps and window scale
host$ sudo tcpdump -ni eth0 -S -c 3 'host 10.30.0.15 and tcp port 443'
10:41:02.100 IP 10.110.0.64.50414 > 10.30.0.15.443: Flags [S], seq 1830472001, win 64240, options [mss 1460,sackOK,TS val 1 ecr 0,nop,wscale 7], length 0
10:41:02.101 IP 10.30.0.15.443 > 10.110.0.64.50414: Flags [S.], seq 409117, ack 1830472002, win 65160, options [mss 1460,sackOK,TS val 9 ecr 1,nop,wscale 7], length 0
10:41:02.101 IP 10.110.0.64.50414 > 10.30.0.15.443: Flags [.], ack 409118, win 502, options [nop,nop,TS val 2 ecr 9], length 0
host$ tshark -r capture.pcap -Y tcp -T fields -e tcp.hdr_len -e tcp.flags.str -e tcp.window_size_value -e tcp.window_size | head -3

-S prints absolute sequence numbers. Without it, tcpdump shows relative numbers after the first segment. In the third line, win 502 is the raw value; with window scale 7 the real window is 502 × 128 = 64,256 bytes. Wireshark shows both values (window_size_value and window_size).

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 9293

Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → TCP Header Field Reference. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc9293.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
tcp header fieldstcp seq acktcp window
Embedded quick reference

Operational notes

Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.

TCP Header Fields

Seq/Ack/window/flags/options.

30-second lookup

  • Open Packet Field Explorer for field-level metadata.
  • Use Packet Decoders for bit/flag values where relevant.
  • Use Paste Output / Structured Parser for CLI evidence.
  • Use Packet Filters to prove the wire boundary.

Evidence rule

A decoded field proves what is present in that packet/output at that moment. Continue through the verification chain before concluding end-to-end behavior.

Confirmation

Confirm action

Continue?