Pcornel
Networking · IP Fundamentals › TCP

Sequencing

Cheat sheet · https://pcornel.dk/topic.php?topic=913

Back to the Topic

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 filter tcp.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 observationMeaningCommon false inferenceNext check
ACK advancesReceiver has contiguous bytes through ACK-1Application must be healthyReceiver/application processing
Duplicate ACKReceiver repeats next byte expectedCongestion is provenMissing range + SACK + path timing
Retransmitted rangeSender repeats existing byte numbersSender/NIC is faultyWhy original or ACK was lost
Out-of-order segmentLater bytes arrived before earlier bytesPacket loss necessarily occurredDoes ACK/SACK recover quickly?
Large host-capture segmentMay reflect TSO/GRO/LROJumbo packet was on wireCapture 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

Confirmation

Confirm action

Continue?