Introduction
Interpret sequence numbers, acknowledgement numbers, flags, window size and data offset. If bytes through 999 have already arrived, all 200 new bytes arrive in order, and no SYN or FIN is involved, the receiver's next expected sequence number is 1,200.
Method and concepts
Each side has an IP address and a 16-bit port. A server can serve many connections on the same listening port because the client endpoints distinguish them. After the initial SYN and SYN-ACK exchange, the client’s acknowledgment completes the usual three-way handshake.
- Select an entry to isolate the relevant case.
- Read the associated evidence and compare it with your local configuration.
TCP diagram
- Client sends SYN · seq 1000
- Server sends SYN + ACK · ack 1001
- Client acknowledges server SYN
- Client data starts at 1001
Worked examples
Read the Source and destination ports entry
- 16 bits each
- Interpret both endpoints together with their IP addresses and transport. A port number alone cannot identify an application instance.
TCP: Account for 600 bytes and a FIN
- Start with client SYN sequence 1000. The next available client sequence number is 1001.
- Send 600 data bytes covering 1001 through 1600 inclusive. After receiving them contiguously, the server can acknowledge 1601.
- A FIN sent at 1601 consumes one more position. Once accepted, it advances the acknowledgment to 1602. A retransmission of the original 600 bytes still uses 1001 through 1600.
Reference table
| TCP field | Width | Read it in context |
|---|---|---|
| Source and destination ports | 16 bits each | Interpret both endpoints together with their IP addresses and transport. A port number alone cannot identify an application instance. |
| Sequence number | 32 bits | Identifies the first data octet's sequence position in an ordinary data segment. SYN consumes one position before the first data byte. |
| Acknowledgment number | 32 bits | With ACK set, the number gives the next sequence position expected. An ACK of 1,500 cumulatively acknowledges through 1,499 within this sequence context. |
| Data offset | 4 bits in units of four bytes | Offset 5 means a 20-byte header. Offset 8 means 32 bytes, including 12 bytes of options or padding. |
| SYN, ACK, FIN and RST | Control flags | SYN synchronizes sequence numbers, ACK validates the acknowledgment field, FIN ends one sending direction and RST resets the connection. |
| Advertised window | 16-bit field | The receiver advertises available sequence space. Window scaling can enlarge effective windows after negotiation. |
| Checksum | 16 bits | Covers a pseudo-header, TCP header and data. Capture offload can affect what host-side traces show. |
Reading the result
The advertised receive window represents how much more data the receiver is prepared to accept. TCP congestion control independently limits how much the sender puts into the network. Either limit can constrain progress. A loss can trigger retransmission and delay delivery of later bytes already received.
Common mistakes
- Assuming one write at the sender always becomes one read at the receiver. A framed application protocol needs its own length or delimiter.
- Treating a TCP acknowledgment as proof that a database committed a transaction. It confirms progress in the peer’s TCP receive sequence.
Frequently asked questions
If a data segment starts at 1,000 and carries 200 bytes, which ACK follows?
If bytes through 999 have already arrived, all 200 new bytes arrive in order, and no SYN or FIN is involved, the receiver's next expected sequence number is 1,200.
Does an ACK always carry data?
No. An acknowledgment can appear on a data segment or on a segment with no payload.
What happens after the last 32-bit sequence number?
Sequence arithmetic wraps modulo 2³². TCP interprets values relative to the current windows so a connection can transfer far more than 4 GiB.
What does the TCP handshake establish?
The opening exchange synchronizes connection state and initial sequence numbers between endpoints. It does not prove that the application request will succeed.
Does TCP preserve application write boundaries?
No. TCP provides an ordered byte stream. Applications need their own framing, such as fixed-size records, delimiters, or a length prefix.
How does TCP respond to loss?
TCP uses acknowledgments, timers, and retransmission behavior to recover missing data. Congestion control also adjusts sending behavior when network capacity is constrained.
Is a TCP connection identified only by a port number?
No. A connection is distinguished by endpoint addresses and ports plus protocol context. The same port number can be used by many different connections.
How are flow control and congestion control different?
Flow control protects a receiver from being overrun using its advertised receive capacity. Congestion control responds to conditions in the network path to avoid overwhelming shared capacity.
Does TCP provide message boundaries?
No. It exposes an ordered byte stream. An application must frame its own messages, even when one write happens to align with one segment.
What is the difference between orderly close and reset?
An orderly FIN-based close signals that a sender has finished its stream direction. A reset aborts connection state and can indicate an error or explicit rejection.
Does TCP encryption come from TCP itself?
No. TCP transports bytes without encrypting them. Protocols such as TLS can protect application traffic carried over TCP.
What is a TCP MSS?
The Maximum Segment Size is the maximum TCP data payload an endpoint advertises for a segment, excluding the IP and TCP headers. It is commonly adjusted to fit the path MTU.
Why might a TCP handshake succeed but data stall?
The opening packets may fit while later larger packets encounter an MTU problem, loss, filtering, or application delay. Check retransmissions, acknowledgments, and path behavior.
What is a retransmission timeout?
It is a timer used to retransmit data that has not been acknowledged. TCP adapts timing based on observed round-trip behavior rather than assuming one fixed delay for every path.
What does the TCP receive window control?
It advertises how much data the receiver can accept before more acknowledgment is needed. Window scaling allows larger advertised windows on high-bandwidth or high-delay paths.
Do TCP ports identify applications by themselves?
No. A port is interpreted with protocol, endpoint address, socket state, and operating-system binding. Services can use non-default ports or share a host address.
Further learning and references
- RFC 9293 — TCP headers, sequence space and connection state
Reference source for the concepts and service described in this guide.
- RFC 7323 — TCP window scaling and timestamps

