# TCP sequence and ACK arithmetic · example 1

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/practice/transport/tcp-seq-1

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/practice/transport--tcp-seq-1/

Optional extension · no matching calculation in the two supplied papers

**Optional worked extension.** This calculation format was not found in the supplied December 2025 final or February 2026 re-exam. The numbers and practice marks are authored. Study the core concept and actual-paper questions first; this is extra explanation, not a TEE prediction.

### Practice question. A client SYN has Seq=1000; the server SYN has Seq=5000. No handshake data is sent. The client then sends 200 bytes in one segment and immediately finishes its sending direction. Find handshake ACKs, data-byte range, data ACK and FIN ACK. [5 practice marks]

#### Answer

## Given

Client ISN=1000; server ISN=5000; data=200 B; no sequence wrap or loss.

## To find

Each sequence/acknowledgement boundary.

## Formula and why



$$
\mathrm{first}=ISN+1,\quad \mathrm{next}=\mathrm{first}+L
$$



SYN and FIN consume one sequence value each; data consumes one value per byte; an empty ACK consumes none.

## Step-by-step solution

#### Step 1. Acknowledge SYNs

Server ACK=1001; client ACK=5001.

#### Step 2. Number the data

First byte=1001; last=1001+200−1=1200.

#### Step 3. Acknowledge data

Next expected byte=1200+1=1201; receiver sends ACK=1201.

#### Step 4. Acknowledge FIN

Client FIN Seq=1201; FIN ACK=1202.

**Final answer:** Handshake ACKs 1001 and 5001; data 1001…1200; data ACK 1201; FIN ACK 1202.

#### What this result means

An ACK reports the next expected byte, not the last received byte. Each direction has its own sequence space.
