Computer Networks · TEE · practice

TCP sequence and ACK arithmetic · example 3

Unit 5 · Process delivery, UDP, TCP and SCTP · optional practice

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=4000; the server SYN has Seq=9000. No handshake data is sent. The client then sends 1024 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=4000; server ISN=9000; data=1024 B; no sequence wrap or loss.

To find

Each sequence/acknowledgement boundary.

Formula and why

\mathrm{first}=ISN+1,\quad \mathrm{next}=\mathrm{first}+LLaTeX: \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=4001; client ACK=9001.

Step 2. Number the data

First byte=4001; last=4001+1024−1=5024.

Step 3. Acknowledge data

Next expected byte=5024+1=5025; receiver sends ACK=5025.

Step 4. Acknowledge FIN

Client FIN Seq=5025; FIN ACK=5026.

Final answer: Handshake ACKs 4001 and 9001; data 4001…5024; data ACK 5025; FIN ACK 5026.