Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

TCP Flags & Reset Forensics

Direct answer

TCP flags mark what a segment is for: SYN opens, ACK acknowledges, FIN closes one direction politely, RST aborts the connection at once.

When to use this

Use it when connections are refused or reset: work out at which point the reset came and which device really sent it.

First 30 seconds

1. Find the reset and what came just before: a SYN, a request, a long silence?

2. After a SYN → ss -ltn on the server; no listener, or a firewall reject.

3. After silence → an idle timeout on the path; add keepalives.

4. Compare the reset's TTL with the server's other packets.

5. Capture at the server too: did it send the reset — or receive one?

Operational verification

SYN answered by SYN-ACK → data exchanged with ACKs → each side sends FIN when done → no RST from either end or from a device between them

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 'tcp[tcpflags] & (tcp-rst) != 0'
Scope / prerequisiteUse it when connections are refused or reset: work out at which point the reset came and which device really sent it.
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 'tcp[tcpflags] & (tcp-rst) != 0'
tcpdump -ni eth0 -v host 192.0.2.10 and tcp port 443
ss -ltn

The first prints only resets. With -v, tcpdump also prints the IP TTL and identification of each packet, for comparing a reset with the same host's other packets. ss -ltn on the server confirms whether anything listens on the port.

In Wireshark: tcp.flags.reset == 1 finds resets; then open the connection (Follow → TCP Stream) and look at what immediately preceded the reset — a SYN, a data segment after a long pause, a particular request.

Known-good: connections open with SYN, SYN-ACK, ACK and end with FIN from both sides, without resets.

Step 2 Failure isolation workflow Narrow the fault
  • RST straight after the SYN. No listener on that port, or a firewall rejecting; compare the TTL with a ping reply from the same server.
  • RST after the first request is sent. The application or an inspection device rejects the content; a reset whose TTL differs from the server's points to the device.
  • RST on the first packet after a long silence. Something in the path, or the server, dropped the idle connection; add keepalives or lengthen the timeout.
  • RST from the server during a download. The application aborted — check its logs — or the server ran out of resources.
  • Both ends report "reset by peer" and neither sent one. A device in the middle reset both sides.
  • RST from a client immediately after SYN-ACK. The client did not send the SYN — a spoofed source or a scan — or its firewall forgot its own request.
  • No reset, just a timeout. A silent drop, not a rejection; look for a filter or a routing problem.
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

A reset in answer to a SYN means nothing listens there — or a firewall rejected. A reset after an idle period is a device that forgot the connection. A reset with a different IP TTL from the server's other packets was sent by something in between. Silent drops give timeouts, not resets.

Key checks
  • tcpdump -ni <if> 'tcp[tcpflags] & (tcp-rst) != 0' — only resets.
  • tcpdump -ni <if> -v host <ip> and tcp port <port> — with TTL and IP ID, to compare a reset with the host's other packets.
  • ss -ltn on the server — a listener on the port?
  • Wireshark: tcp.flags.reset == 1, then follow the stream.
ReferenceWhat it is1 section · depth on demand

Mechanics & mental model

TCP flags are single bits in the header that mark what a segment is for: opening a connection, acknowledging data, closing politely, or aborting. A reset (RST) is the abort — it ends the connection immediately, with no further exchange.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

A reset is the clearest signal TCP gives, and the most misattributed. The device that receives it sees only "connection reset by peer" — but the reset may have been sent by the server's operating system, by the application, or by a firewall in between pretending to be the server. Working out who sent it, and at what point in the connection, usually identifies the fault.

ReferenceHow it works1 section · depth on demand

How it works

FlagValueMeaning
FIN0x01"I have no more data to send" — orderly close of one direction
SYN0x02Opens a connection and sets the starting sequence number
RST0x04Abort: the connection does not exist or must end now
PSH0x08Deliver the data to the application without waiting for more
ACK0x10The acknowledgment number is valid; set on every segment after the first SYN
URG0x20Urgent data; rarely used
ECE, CWR0x40, 0x80Explicit congestion notification

Normal combinations: SYN; SYN+ACK; ACK; PSH+ACK (data); FIN+ACK. Tools abbreviate them — [S], [S.], [.], [P.], [F.], [R], [R.] in tcpdump.

When a reset is sent — and by whom.

MomentSenderMeaning
In reply to a SYNThe server's operating systemThe host is up, but nothing listens on that port
In reply to a SYNA firewallThe rule says "reject" — it answers on the server's behalf
In the middle of a connectionThe application, through the operating systemThe application closed abruptly, crashed, or closed while unread data remained
On a packet for a connection the host no longer knowsThe operating systemThe host restarted, or timed the connection out, and the other side did not notice
After an idle period, on the next packetA firewall or load balancerIts entry for the connection expired
In the middle of a connection, to both sidesAn inspection deviceIt decided to block the content

A firewall that drops silently produces no reset at all — only retransmissions and a timeout.

Telling the real sender. A reset forged by a device on the path carries the server's address, but usually betrays itself:

  • Its IP TTL differs from that of the server's other packets, since it travelled fewer hops.
  • Its IP identification field or TCP options do not fit the pattern of the server's other packets.
  • A capture taken at the server shows no reset leaving — or shows the server receiving a reset too.

Capturing at both ends settles it.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Reset forensics: who sent the RST and why

A reset ends a connection immediately, so finding its origin is often the key to a "connection dropped" problem. RFC 9293 defines when TCP sends one. A segment that arrives for a connection that doesn't exist (CLOSED) gets a RST. An ACK that arrives at a listening socket gets a RST. In SYN-SENT, an ACK that doesn't acknowledge the SYN gets a RST. In synchronised states, RFC 5961 checks apply: only a RST whose sequence number exactly equals RCV.NXT resets the connection, while an in-window but inexact RST triggers a challenge ACK.

Who sends resets

SourceTypical triggerClue in the capture
The destination hostNothing listening on the portRST, ACK in direct reply to the SYN
The destination hostThe application aborts (linger 0, crash)RST in the middle of a connection, from the server's address
A firewall or IPSPolicy reject, or a session that timed outTTL or IP ID that differs from the server's other packets
A load balancerHealth or idle timeoutRST from the VIP, often after an idle period
Either host after a rebootOld connection no longer knownRST answering data on a connection

Separating host resets from middlebox resets

CheckHost-generatedMiddlebox-generated
IP TTLSame as the host's other packetsOften different
TimingImmediateMay follow a fixed idle time
Sequence numberFits the connection exactlySometimes slightly off, causing challenge ACKs
Both directionsSeen at both endsMay be sent to both ends while the real hosts never sent one
host$ sudo tcpdump -ni eth0 -v 'tcp[tcpflags] & tcp-rst != 0 and host 10.30.0.15'
10:52:11.402 IP (tos 0x0, ttl 61, id 0, ...) 10.30.0.15.443 > 10.110.0.64.50414: Flags [R], seq 409982, win 0, length 0
host$ sudo tcpdump -ni eth0 -v 'tcp and host 10.30.0.15' | grep -o "ttl [0-9]*" | sort | uniq -c
    812 ttl 62
      1 ttl 61
fw# show conn address 10.110.0.64 detail
fw# show asp drop | include tcp

One RST with TTL 61 among server packets with TTL 62 means something one hop closer than the server sent that reset. Here that is most likely the firewall.

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 Flags & Reset Forensics. 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 resettcp flagssyn ack rst
Embedded quick reference

Operational notes

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

TCP Flags Decoder

SYN/ACK/FIN/RST/PSH/URG/ECE/CWR.

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?