Sequencing
Cheat sheet · https://pcornel.dk/topic.php?topic=913
Answer
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.
Remember
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.
First checks
- 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.
Verify in this order
sender numbers bytes from its ISN → segments carry contiguous ranges → receiver ACKs the next expected byte → gaps trigger retransmission → stream continues in order
Where it usually breaks
physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result
Sequencing operational reference
| 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 |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=913