Use this Topic for retransmissions, out-of-order delivery, duplicate segments, capture interpretation, asymmetric captures and cases where the network passes packets but the TCP stream stalls or recovers slowly.
Sequencing
TCP sequencing numbers bytes, not packets. Each direction has its own sequence space; a segment sequence number identifies the first payload byte carried, while retransmission can send the same byte range again in a different packet.
1. In Wireshark, pick the stream and use relative sequence numbers.
2. Follow one direction: does Seq advance by the payload length each segment?
3. Find the first gap (Wireshark flags "previous segment not captured").
4. Is the missing range retransmitted, and when?
5. Match the time of the gap with interface drops or errors on the path.
sender numbers bytes from its ISN → segments carry contiguous ranges → receiver ACKs the next expected byte → gaps trigger retransmission → stream continues in order
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification and known-good state Verify boundary
A healthy flow shows coherent byte-range progression in both directions with acknowledgements advancing as data becomes contiguous. Short reordering may occur without user-visible loss if the receiver buffers it and ACK/SACK feedback lets the sender avoid unnecessary recovery. To validate, select one stream, note payload lengths and sequence ranges, then follow the receiver ACK number and SACK blocks. If device counters show drops, align the counter delta, interface/member and timestamp with the exact stalled sequence range. If a capture is taken on a host, account for segmentation/receive offload: a very large captured segment can be a local software representation, not an on-wire frame of that size.
Step 2 Verification & troubleshooting Narrow the fault
1. Verify IP path and return path.
2. Confirm destination port is listening.
3. Inspect the three-way handshake.
5. Validate application request/response.
Step 3 Failure signatures and troubleshooting branches Narrow the fault
Start at the first place ACK progress stops. If the capture shows later sequence ranges but one earlier range missing, determine whether the gap is real loss, reordering or capture loss by checking the opposite-direction ACK/SACK feedback and a second observation point where practical. Repeated retransmission of the same range with no acknowledgement suggests that range or its feedback is not crossing the path. Duplicate ACKs can indicate a gap but are not evidence of congestion or a specific failing device. If ACKs advance normally while the application reports a stall, move the investigation above TCP delivery. For intermittent problems, compare ECMP/LAG member counters and timestamps before replacing links; one bad hashed member can affect only selected flows.
Step 4 When the problem is really fixed Narrow the fault
A sequencing fix is closed only when the original stream transfers the same workload without the prior persistent gap/retransmission pattern and acknowledgement progression remains consistent. Verify that retransmissions return to a reasonable baseline for that workload rather than assuming zero retransmissions is required. If a link/member/policy change was made, correlate improvement at the same capture point and confirm an adjacent known-good flow remains healthy. A Wireshark label such as “TCP Retransmission” is an analyzer inference based on capture visibility; it is not itself observed device Evidence or root-cause evidence. Preserve the actual byte ranges, timestamps and path context if you later create Evidence.
Step 5 Common mistakes Narrow the fault
- Reading relative sequence numbers as absolute.
- Ignoring out-of-order segments.
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.
Packet order in a capture is not automatically TCP delivery order. Capture location, NIC offload, ECMP and retransmission can change what you see. Judge byte ranges, acknowledgement progress and timing together.
- Packet capture:
tcpdump -nn -i <if> host <ip> and port <p>or Wireshark filtertcp.stream eq <n>. ss -tni(Linux) /netstat -ano(Windows) — connection state, RTT, retransmits and windows.Test-NetConnection <host> -Port <p>/nc -vz <host> <p>— does the handshake complete?show tcp brief(IOS) — TCP sessions to the device itself.show interfaces <if> | include drops|errors— drops on the path.
ReferenceImportant terms & boundaries4 sections · depth on demand
Key operational limits
- SYN, SYN-ACK, ACK establish a connection
- Sequence and acknowledgement numbers track bytes
In depth
Sequence numbers
TCP numbers every byte it sends, not every segment. RFC 9293 defines a 32-bit sequence space from 0 to 2^32 − 1, with all arithmetic done modulo 2^32, so numbers wrap around. SYN and FIN each take up one sequence number, while a segment carrying only an ACK takes none. The receiver uses the numbers to put data back in order, to throw away duplicates, and to decide which segments fall inside its window.
Sequence variables (RFC 9293)
| Variable | Meaning |
|---|---|
| SND.UNA | Oldest byte sent but not yet acknowledged |
| SND.NXT | Next byte to send |
| RCV.NXT | Next byte expected from the peer |
| RCV.WND | How many bytes beyond RCV.NXT will be accepted |
Segment acceptability
A segment is accepted if part of it lies inside RCV.NXT to RCV.NXT + RCV.WND − 1. Anything outside is answered with an ACK showing what is expected, unless it is a reset. This window check is also part of what makes blind injection of RSTs harder.
host$ tshark -r capture.pcap -Y "tcp.stream==3" -T fields -e frame.number -e tcp.seq -e tcp.len -e tcp.ack -e tcp.analysis.flags
12 1 1448 1
13 1449 1448 1
14 4345 1448 1 Previous segment not captured
15 2897 1448 1 Out-Of-Order
host$ tshark -r capture.pcap -q -z conv,tcp
(Wireshark shows relative sequence numbers that start at 0 for each connection. The real ISN is random.)
Reading sequence anomalies
| Wireshark label | Meaning |
|---|---|
| Previous segment not captured | A gap: loss before the capture point, or the capture missed it |
| Out-of-order | The segment arrived after a later one: reordering or a late retransmission |
| Retransmission | The same sequence range was sent again |
| Spurious retransmission | It was resent even though it had already been acknowledged |
Wrap-around on fast links
At 10 Gbit/s, the 32-bit space wraps in a few seconds. The timestamp option and PAWS keep old duplicates from being mistaken for new data.
Documented example, not captured output.
Quick reference
TCP sequencing numbers every byte sent. The receiver uses sequence numbers to put segments back in order, detect missing data and discard duplicates, so applications get an exact byte stream even if packets arrive out of order.
| Field | Meaning |
|---|---|
| Sequence number | Position of the first byte in this segment |
| Initial sequence number (ISN) | Random starting value per connection |
| Next expected sequence | Sequence + payload length |
Wireshark shows relative sequence numbers (starting at 0) by default to make analysis easier; firewalls that randomise ISNs may confuse tools that compare captures from both sides.
Mechanics and state ownership
TCP presents an ordered byte stream even though IP can deliver segments out of order, duplicate them or lose them. Each endpoint chooses an initial sequence number and advances the sequence space by the number of payload bytes sent; SYN and FIN also consume one number. The receiver tracks the next contiguous byte expected and can buffer later bytes while a gap remains. Retransmission sends a previously numbered byte range again; it does not create new application data. Sequence wrap is handled modulo 2^32 with window-bounded comparisons. During analysis, relative sequence numbers are easier to reason about than raw values, but the key invariant is the same: identify which byte range was expected, whether it arrived, and whether acknowledgement state advanced.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in IP Fundamentals → TCP → Sequencing. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc9293.html · confidence 94%Quick lookup tables
Sequencing operational reference
Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.
| Sequence observation | Meaning | Common false inference | Next check |
|---|---|---|---|
| ACK advances | Receiver has contiguous bytes through ACK-1 | Application must be healthy | Receiver/application processing |
| Duplicate ACK | Receiver repeats next byte expected | Congestion is proven | Missing range + SACK + path timing |
| Retransmitted range | Sender repeats existing byte numbers | Sender/NIC is faulty | Why original or ACK was lost |
| Out-of-order segment | Later bytes arrived before earlier bytes | Packet loss necessarily occurred | Does ACK/SACK recover quickly? |
| Large host-capture segment | May reflect TSO/GRO/LRO | Jumbo packet was on wire | Capture nearer wire / offload state |